3v4l.org

run code in 300+ PHP versions simultaneously
<?php class ParentClass { public static function whoami() { echo static::class; } } class Child extends ParentClass { public static function whoami() { echo "Don't call me now!"; parent::whoami(); } } $className = ParentClass::class; $method = 'whoami'; $closure = function(array $args) use ($className, $method) { return forward_static_call_array([$className, $method], $args); }; $bindedClosure = $closure->bindTo(null, Child::class); $bindedClosure->__invoke([]);
Output for git.master, git.master_jit, rfc.property-hooks
Child

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