3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php class Foo { private $bar = '120'; protected $var = '240'; public function __sleep() { return ['bar']; } } $obj = new Foo(); echo serialize($obj);
based on 6EBPA
Output for 5.4.9 - 7.3.0rc4
O:3:"Foo":1:{s:8:"Foobar";s:3:"120";}
Output for 5.3.19 - 5.3.29
Parse error: syntax error, unexpected '[' in /in/JoBp8 on line 10
Process exited with code 255.