3v4l.org

run code in 300+ PHP versions simultaneously
<?php $fn = function () { return get_called_class(); }; var_dump((new ReflectionFunction($fn))->getClosureScopeClass()); class C { private static $test = 'In class C'; public static function s_fn() { $fn1 = function () { var_dump(D::$test); }; $fn2 = function () { var_dump(static::$test); }; var_dump($fn1()); var_dump($fn2()); } } class D extends C { private static $test = 'In class D'; } D::s_fn();
Output for git.master, git.master_jit, rfc.property-hooks
NULL Fatal error: Uncaught Error: Cannot access private property D::$test in /in/EVhHP:9 Stack trace: #0 /in/EVhHP(11): C::{closure}() #1 /in/EVhHP(20): C::s_fn() #2 {main} thrown in /in/EVhHP on line 9
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:
39.23 ms | 401 KiB | 8 Q