3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php class Test { public $prop1, $prop2,$prop3,$prop4; //private $prop11, $prop12,$prop13,$prop14; //protected $prop21, $prop22,$prop23,$prop24; public countProps() { return get_object_vars($this); } } $t = new Test; echo count( get_object_vars($t) ); echo "\n"; echo $t->countProps();
Output for 5.4.0 - 5.4.28
Parse error: syntax error, unexpected 'countProps' (T_STRING), expecting variable (T_VARIABLE) in /in/ctHTg on line 7
Process exited with code 255.
Output for 5.3.0 - 5.3.28
Parse error: syntax error, unexpected T_STRING, expecting T_VARIABLE in /in/ctHTg on line 7
Process exited with code 255.