3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php class Bar { $derp = 'fucking dumb'; } class Foo { public function __sleep() { $name = 'this'; $$name = new Bar; } } $d = new Foo; $d->bar(); print_r(unserialize(serialize($d)));
Output for 5.4.0 - 5.4.19
Parse error: syntax error, unexpected '$derp' (T_VARIABLE), expecting function (T_FUNCTION) in /in/1giZ1 on line 3
Process exited with code 255.
Output for 5.3.0 - 5.3.27
Parse error: syntax error, unexpected T_VARIABLE, expecting T_FUNCTION in /in/1giZ1 on line 3
Process exited with code 255.