3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php class Example implements Serializable { /* Serializable */ public function serialize() { // We need to serialize everything because a run-time object of this class hasn't a reference return serialize(array( 'label' => 'a label', 'links' => 'some links', 'attrs' => 'some attrs', )); } public function unserialize($s) { return 'pie'; } } $o = new Example $o->self = $o; echo serialize($o);
Output for 5.4.0 - 5.4.5
Parse error: syntax error, unexpected '$o' (T_VARIABLE) in /in/vNjnv on line 22
Process exited with code 255.
Output for 5.3.0 - 5.3.15
Parse error: syntax error, unexpected T_VARIABLE in /in/vNjnv on line 22
Process exited with code 255.