3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php class c1 { public $a = 1; public $b = 2; } class c2 implements Serializable { public serialize() { return 'test'; } public unserialize($str) {} } $o1 = new c1; $o2 = new c2; echo serialize($o1) . "\n"; echo serialize($o2) . "\n";
Output for 5.4.0 - 5.4.17
Parse error: syntax error, unexpected 'serialize' (T_STRING), expecting variable (T_VARIABLE) in /in/4ScgV on line 8
Process exited with code 255.
Output for 5.3.0 - 5.3.27
Parse error: syntax error, unexpected T_STRING, expecting T_VARIABLE in /in/4ScgV on line 8
Process exited with code 255.