3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Base { public static function noClosure() { echo 'Context of '.get_called_class().', no closure: '; echo Left::$prot; echo "\n"; } public static function withClosure() { echo 'Context of '.get_called_class().', with closure: '; $cl = function(){ echo Left::$prot; echo "\n"; }; $cl(); } } class Left extends Base { protected static $prot = 'works.'; } class Right extends Base { } Base::noClosure(); Right::noClosure(); Base::withClosure(); Right::withClosure();
Output for git.master, git.master_jit, rfc.property-hooks
Context of Base, no closure: works. Context of Right, no closure: works. Context of Base, with closure: works. Context of Right, with closure: works.

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