3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $objA = (new \stdClass())->A = 1; $objB = (new \stdClass())->B = 2; $objC = (new \stdClass())->C = 3; $objD = (new \stdClass())->D = 4; $arr1 = [ $objA, $objC ]; $arr2 = [ $objB, $objD ]; var_dump(in_array($arr1, $objA)); var_dump(array_diff($arr1, $arr2));
Output for 7.0.0 - 7.3.0beta2
Fatal error: Cannot use temporary expression in write context in /in/ho7MF on line 3
Process exited with code 255.
Output for hhvm-3.22.0
Warning: in_array() expects parameter 2 to be an array or collection in /in/ho7MF on line -1 bool(false) array(2) { [0]=> int(1) [1]=> int(3) }
Output for hhvm-3.15.4 - 3.21.3
Warning: in_array() expects parameter 2 to be an array or collection in /in/ho7MF on line 15 bool(false) array(2) { [0]=> int(1) [1]=> int(3) }
Output for 5.6.30
Parse error: syntax error, unexpected '=' in /in/ho7MF on line 3
Process exited with code 255.