3v4l.org

run code in 300+ PHP versions simultaneously
<?php function test($obj){ static $c; $c = $c ? $c : function(){ return 'baz'; }; $obj->store = $c; } test($x = new stdclass); test($y = new stdclass); var_dump($x->store === $y->store);

preferences:
35.41 ms | 402 KiB | 5 Q