3v4l.org

run code in 300+ PHP versions simultaneously
<?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.0.31, 7.1.0 - 7.1.21, 7.2.0 - 7.2.9
Fatal error: Cannot use temporary expression in write context in /in/ho7MF on line 3
Process exited with code 255.

preferences:
194.86 ms | 1395 KiB | 71 Q