3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $pole1 = [1,15,18,19,22]; $pole2 = [2,7,18,19,23]; $pole3 = array_diff($pole1, $pole2); var_dump($pole3); echo "\n\r"; var_dump(array_diff($pole2, $pole3));
Output for 5.4.0 - 7.1.0
array(3) { [0]=> int(1) [1]=> int(15) [4]=> int(22) } array(5) { [0]=> int(2) [1]=> int(7) [2]=> int(18) [3]=> int(19) [4]=> int(23) }
Output for 4.4.2 - 4.4.9, 5.1.0 - 5.3.29
Parse error: syntax error, unexpected '[' in /in/QgmP6 on line 3
Process exited with code 255.
Output for 4.3.0 - 4.3.1, 4.3.5 - 4.4.1, 5.0.0 - 5.0.5
Parse error: parse error, unexpected '[' in /in/QgmP6 on line 3
Process exited with code 255.
Output for 4.3.2 - 4.3.4
Parse error: parse error in /in/QgmP6 on line 3
Process exited with code 255.