3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $struct = [ 'username' => '', 'password' => '', 'someId' => 1, ]; $input = [ 'username' => '', 'password' => '', 'someId' => 1, ]; var_dump(array_diff(array_merge_recursive($input, $struct), $struct));
Output for 7.0.0 - 7.2.0
Notice: Array to string conversion in /in/HtvkD on line 16 Notice: Array to string conversion in /in/HtvkD on line 16 Notice: Array to string conversion in /in/HtvkD on line 16 array(3) { ["username"]=> array(2) { [0]=> string(0) "" [1]=> string(0) "" } ["password"]=> array(2) { [0]=> string(0) "" [1]=> string(0) "" } ["someId"]=> array(2) { [0]=> int(1) [1]=> int(1) } }
Output for 5.4.12 - 5.6.21
Notice: Array to string conversion in /in/HtvkD on line 16 Notice: Array to string conversion in /in/HtvkD on line 16 Notice: Array to string conversion in /in/HtvkD on line 16 Notice: Array to string conversion in /in/HtvkD on line 16 Notice: Array to string conversion in /in/HtvkD on line 16 Notice: Array to string conversion in /in/HtvkD on line 16 Notice: Array to string conversion in /in/HtvkD on line 16 Notice: Array to string conversion in /in/HtvkD on line 16 Notice: Array to string conversion in /in/HtvkD on line 16 Notice: Array to string conversion in /in/HtvkD on line 16 Notice: Array to string conversion in /in/HtvkD on line 16 array(3) { ["username"]=> array(2) { [0]=> string(0) "" [1]=> string(0) "" } ["password"]=> array(2) { [0]=> string(0) "" [1]=> string(0) "" } ["someId"]=> array(2) { [0]=> int(1) [1]=> int(1) } }
Output for 5.3.22 - 5.3.29
Parse error: syntax error, unexpected '[' in /in/HtvkD on line 3
Process exited with code 255.