3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Enum { private static $cache = []; public static function __callStatic($name, $params) { $className = get_called_class(); if(!isset(self::$cache[$name])) { self::$cache[$name] = new $className($className::$$name); } return self::$cache[$name]; } } class Operator { public const A = 22; private const EQUALS = ['=']; private $symbol; private function __const(string $symbol) { $this->symbol = $symbol; } } $a = "A"; var_dump(Operator::$a); var_dump(Enum::EQUALS());
Output for git.master, git.master_jit, rfc.property-hooks
Fatal error: Uncaught Error: Access to undeclared static property Operator::$a in /in/2LVU4:26 Stack trace: #0 {main} thrown in /in/2LVU4 on line 26
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:
56.01 ms | 401 KiB | 8 Q