3v4l.org

run code in 300+ PHP versions simultaneously
<?php <?php class Foo { public function test() { echo 'test'; } } function changeMe(&$obj) { $obj = function(){ $test = function(){echo 'im a test';}; }; } $foo = new Foo(); var_dump($foo); changeMe($foo); $foo->test();
Output for 5.3.0 - 5.3.28, 5.4.0 - 5.4.26
Parse error: syntax error, unexpected '<' in /in/M7CCU on line 4
Process exited with code 255.

preferences:
172.72 ms | 1395 KiB | 63 Q