3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Foo { public function publicFN() { echo "\npublic call\n"; } protected function protectedFN() { echo "\nprotected call\n"; } private function privateFN() { echo "\nprivate call\n"; } } $foo = new Foo(); foreach (['publicFN', 'protectedFN', 'privateFN'] as $fn) { $callable = [$foo, $fn]; if (method_exists($foo, $fn)) { printf("%s::%s() exists\n", get_class($foo), $fn); } if (is_callable($callable)) { $callable(); } }
Output for git.master_jit, git.master, rfc.property-hooks
Foo::publicFN() exists public call Foo::protectedFN() exists Foo::privateFN() exists

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:
32.74 ms | 405 KiB | 5 Q