3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Super { private $foo = 123; // Same as `private $foo = 123;` function printSuper(){ return $this->foo; } } class Child extends Super { public $foo = 456; // Same as `private $foo = 456;` function printChild(){ return $this->foo; } } $o = new Child(); echo $o->printSuper(); // 123 echo $o->printChild(); // 456

This is an error 500

Value for `_results` contains invalid data `array`


preferences:
223.34 ms | 2243 KiB | 10 Q