3v4l.org

run code in 500+ PHP versions simultaneously
<?php trait Foo { private function sayHello() { echo "Hello!" . PHP_EOL; } } class Bar { use Foo; public function welcome() { return $this->sayHello(); } } class Baz extends Bar { public function welcome() { return $this->sayHello(); } } $bar = new Bar; $baz = new Baz; $bar->welcome(); $baz->welcome();
Output for git.master, git.master_jit, rfc.property-hooks
Hello! Fatal error: Uncaught Error: Call to private method Bar::sayHello() from scope Baz in /in/keT0W:22 Stack trace: #0 /in/keT0W(29): Baz->welcome() #1 {main} thrown in /in/keT0W on line 22
Process exited with code 255.

This tab shows result from various feature-branches currently under review by the php developers. Contact me to have additional branches featured.

Active branches

Archived branches

Once feature-branches are merged or declined, they are no longer available. Their functionality (when merged) can be viewed from the main output page


preferences:
42.05 ms | 1536 KiB | 4 Q