3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php private class myparent { public function foo($bar) { // do stuff } } class mychild extends myparent { public $val; private function bar(myparent &$baz) { // do stuff } public function __construct($val) { $this->val = $val; } } $child = new mychild('hello world'); $child->foo('test'); $reflection = new reflectionClass('myparent'); echo $reflection->isInstantiable() ? 'yes' : 'no';
Output for 5.4.0 - 5.4.19
Parse error: syntax error, unexpected 'private' (T_PRIVATE) in /in/KaPaD on line 2
Process exited with code 255.
Output for 5.3.0 - 5.3.27
Parse error: syntax error, unexpected T_PRIVATE in /in/KaPaD on line 2
Process exited with code 255.