3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php abstract 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.0.5 - 7.1.0
no
Output for 5.0.0 - 5.0.4
yes
Output for 4.4.2 - 4.4.9
Parse error: syntax error, unexpected T_CLASS in /in/2MM0K on line 2
Process exited with code 255.
Output for 4.3.1, 4.3.5 - 4.4.1
Parse error: parse error, unexpected T_CLASS in /in/2MM0K on line 2
Process exited with code 255.
Output for 4.3.2 - 4.3.4
Parse error: parse error in /in/2MM0K on line 2
Process exited with code 255.
Output for 4.3.0
Parse error: parse error, unexpected T_CLASS in /in/Ypjri on line 2
Process exited with code 255.