3v4l.org

run code in 300+ PHP versions simultaneously
<?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.18 - 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.4.0 - 5.4.17
Parse error: syntax error, unexpected 'private' (T_PRIVATE) in /in/sU99f 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/sU99f on line 2
Process exited with code 255.

preferences:
176.41 ms | 1395 KiB | 55 Q