3v4l.org

run code in 300+ PHP versions simultaneously
<?php interface A { const NONE = 0; } abstract class B implements A { protected static $values; public static function get() { if (null === static::$values) { $r = new \ReflectionClass(get_called_class()); static::$values = $r->getConstants(); } return static::$values; } } class C extends B { const BLA = 1; protected static $values; } class D extends B { const BLAHA = 1; protected static $values; } var_dump(C::get()); var_dump(D::get());
Output for git.master, git.master_jit, rfc.property-hooks
array(2) { ["BLA"]=> int(1) ["NONE"]=> int(0) } array(2) { ["BLAHA"]=> int(1) ["NONE"]=> int(0) }

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:
69.21 ms | 401 KiB | 8 Q