3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php class Test { protected $a = array(); function getA() { return $this->a; } } $byReflection = (new ReflectionClass('Test'))->newInstanceWithoutConstructor(); $bySerialization = unserialize('O:4:"Test":{}'); var_dump($byReflection); var_dump($bySerialization)
Output for 5.4.0 - 5.4.29
Parse error: syntax error, unexpected end of file in /in/c7I17 on line 15
Process exited with code 255.
Output for 5.3.0 - 5.3.28
Parse error: syntax error, unexpected T_OBJECT_OPERATOR in /in/c7I17 on line 11
Process exited with code 255.