3v4l.org

run code in 300+ PHP versions simultaneously
<?php class B { private $x = 'x'; function foo() { return $this->x; } } class C extends B { private $x = 'y'; function foo() { return $this->x . parent::foo(); } } $c = new C; var_export($c->foo());

preferences:
43.53 ms | 402 KiB | 5 Q