3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php class foo { private function __construct() {} } class bar extends foo { private function __construct() {} static public foob() { return new self(); } } var_dump(bar::foob());
Output for 5.4.0 - 5.4.30
Parse error: syntax error, unexpected 'foob' (T_STRING), expecting variable (T_VARIABLE) in /in/DU7eF on line 9
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/DU7eF on line 9
Process exited with code 255.