3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Bar { private function test() { $this->testPrivate(); $this->privatefoo(); } private function testPrivate() { echo "Bar::testPrivate\n"; } } class Foo extends Bar { private function testPrivate() { echo "Foo::testPrivate\n"; } private function privatefoo(){ echo "Foo::privatefoo"; } public function testFooScope() { $this->testPrivate(); } } class Zot extends Foo { } $myZot = new Zot(); $myZot->test(); //What would this do other than Bar::testPrivate $myZot->testFooScope();
Output for git.master, git.master_jit, rfc.property-hooks
Fatal error: Uncaught Error: Call to private method Bar::test() from global scope in /in/hjfPk:42 Stack trace: #0 {main} thrown in /in/hjfPk on line 42
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:
47.45 ms | 401 KiB | 8 Q