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());

Here you find the average performance (time & memory) of each version. A grayed out version indicates it didn't complete successfully (based on exit-code).

VersionSystem time (s)User time (s)Memory (MiB)
7.1.70.1800.01014.97
7.1.60.2300.00733.09
7.1.50.2530.02032.77
7.1.40.2730.01332.32
7.1.30.4330.00732.54
7.1.20.2130.01332.66
7.1.10.2230.02014.26
7.1.00.2930.01314.53
7.0.200.3270.00714.68
7.0.190.3630.00314.50
7.0.180.2370.01314.13
7.0.170.3270.00714.19
7.0.160.2770.01313.95
7.0.150.2430.02014.00
7.0.140.2770.01014.38
7.0.130.2530.01314.52
7.0.120.3000.01014.40
7.0.110.2570.01014.20
7.0.100.2270.01014.31
7.0.90.3600.00714.28
7.0.80.3030.01714.23
7.0.70.2430.01014.21
7.0.60.2370.01014.10
7.0.50.2930.01014.58
7.0.40.2570.01014.70
7.0.30.3600.01014.54
7.0.20.0100.01714.36
7.0.10.3700.01014.32
7.0.00.2470.00714.33

preferences:
144.64 ms | 1394 KiB | 7 Q