3v4l.org

run code in 500+ PHP versions simultaneously
<?php class x { private function foo() { echo __METHOD__; } function YinX() { $y = new y(); $y->foo(); } } class y extends x { function YinY() { $this->foo(); } } // here, Y can call private foo(); (new x)->YinX(); // here, Y cannot call foo() (new y)->YinY(); ?>
Output for git.master_jit, git.master
x::foo Fatal error: Uncaught Error: Call to private method x::foo() from scope y in /in/rFjoe:14 Stack trace: #0 /in/rFjoe(22): y->YinY() #1 {main} thrown in /in/rFjoe on line 14
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:
45.93 ms | 869 KiB | 4 Q