3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php class A { private $b = 'foo'; } class B extends A { public function __sleep() { return array('b'); } } class C extends A implements Serializable { public function unserialize($serialized) { /*... */ } public function serialize() { $b = new ReflectionProperty('A', 'b'); $b->setAccessible(true); return serialize(array('b' => $b->getValue($this))); } } var_dump(serialize(new A())); var_dump(serialize(new B())); var_dump(serialize(new C())); var_dump((array) new C()));
Output for 5.3.0 - 5.4.14
Parse error: syntax error, unexpected ')' in /in/T7sKk on line 30
Process exited with code 255.