3v4l.org

run code in 300+ PHP versions simultaneously
<?php class ClassWithMagicConstants { const A = __DIR__; const B = __FILE__; const C = __NAMESPACE__; const D = __CLASS__; const E = __LINE__; public static $a = self::A; protected static $b = self::B; private static $c = self::C; } const NS_CONST = 'test'; class ClassWithConstantsAndInheritance extends ClassWithMagicConstants { const A = 'overridden'; const H = M_PI; const J = NS_CONST; public static $h = self::H; } $refClass = new ReflectionClass('ClassWithConstantsAndInheritance'); var_dump($refClass->getStaticProperties());
Output for git.master, git.master_jit, rfc.property-hooks
array(3) { ["h"]=> float(3.141592653589793) ["a"]=> string(3) "/in" ["b"]=> string(9) "/in/aDdQ6" }

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.64 ms | 401 KiB | 8 Q