3v4l.org

run code in 300+ PHP versions simultaneously
<?php class A { private function do_something (bool $str) { echo "private function"; } public function call_something(A $obj) { //call_user_func([$obj, 'do_something'], true); $obj->do_something(true); } } class B extends A { public function do_something (string $value) { echo "subclass"; } } class C extends B { private function do_something (string $value) { echo "subclass"; } } $a = new A(); $c = new C(); $c->call_something($a);
Output for git.master, git.master_jit, rfc.property-hooks
Fatal error: Access level to C::do_something() must be public (as in class B) in /in/UPRZC 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:
51.03 ms | 401 KiB | 8 Q