3v4l.org

run code in 300+ PHP versions simultaneously
<?php function foo() { yeld (object)[]; } $foo1 = foo(); $foo2 = foo(); var_dump( spl_object_hash($foo1), spl_object_hash($foo2), spl_object_hash(foo()), spl_object_hash(foo()) );
Output for 5.4.0 - 5.4.19, 5.5.0 - 5.5.3
Parse error: syntax error, unexpected '(object)' (object) (T_OBJECT_CAST) in /in/3NTjm on line 6
Process exited with code 255.
Output for 5.3.0 - 5.3.27
Parse error: syntax error, unexpected T_OBJECT_CAST in /in/3NTjm on line 6
Process exited with code 255.

preferences:
185.01 ms | 1395 KiB | 59 Q