3v4l.org

run code in 300+ PHP versions simultaneously
<?php abstract class parentCl { protected function parentMethod($arg) { echo "parent call $arg", PHP_EOL; } } class childCl extends parentCl { public function __construct() { echo "construct", PHP_EOL; } protected function childMethod($params) { echo "child call", PHP_EOL; } protected function childMethod2($params) { echo "child call2", PHP_EOL; } public function __call($name, $args) { call_user_func([$this, $name], ...$args); call_user_func([$this, 'parentMethod'], ...$args); } } //like this case, $n = new childCl(); $n->childMethod(123); $n->childMethod2(1234);
Output for git.master, git.master_jit, rfc.property-hooks
construct child call parent call 123 child call2 parent call 1234

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