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)
8.3.60.0150.00318.55
8.3.50.0110.00416.23
8.3.40.0110.00418.89
8.3.30.0090.00618.60
8.3.20.0000.00818.95
8.3.10.0030.00623.67
8.3.00.0040.00419.35
8.2.180.0130.01016.88
8.2.170.0100.00322.96
8.2.160.0100.00320.47
8.2.150.0080.00025.66
8.2.140.0030.00524.66
8.2.130.0040.00420.57
8.2.120.0080.00026.35
8.2.110.0060.00320.36
8.2.100.0080.00417.91
8.2.90.0030.00519.22
8.2.80.0060.00317.97
8.2.70.0040.00417.63
8.2.60.0040.00417.93
8.2.50.0040.00418.10
8.2.40.0040.00422.32
8.2.30.0040.00420.83
8.2.20.0000.00718.00
8.2.10.0030.00618.06
8.2.00.0040.00418.18
8.1.280.0180.00325.92
8.1.270.0050.00322.26
8.1.260.0080.00026.35
8.1.250.0080.00028.09
8.1.240.0030.00620.87
8.1.230.0040.00819.01
8.1.220.0040.00417.74
8.1.210.0060.00318.77
8.1.200.0030.00617.25
8.1.190.0040.00417.23
8.1.180.0000.00818.10
8.1.170.0040.00418.56
8.1.160.0050.00219.06
8.1.150.0000.00818.83
8.1.140.0000.01019.53
8.1.130.0040.00418.86
8.1.120.0030.00317.35
8.1.110.0050.00317.46
8.1.100.0040.00417.27
8.1.90.0000.01017.37
8.1.80.0070.00417.38
8.1.70.0030.00317.43
8.1.60.0000.00817.42
8.1.50.0070.00017.37
8.1.40.0050.00317.48
8.1.30.0000.00817.49
8.1.20.0040.00417.70
8.1.10.0040.00417.56
8.1.00.0000.00717.56
8.0.300.0040.00418.77
8.0.290.0070.00016.75
8.0.280.0030.00318.49
8.0.270.0000.00817.20
8.0.260.0030.00316.87
8.0.250.0000.00716.96
8.0.240.0000.00816.95
8.0.230.0030.00717.02
8.0.220.0070.00016.84
8.0.210.0060.00316.79
8.0.200.0060.00016.82
8.0.190.0040.00416.96
8.0.180.0000.00816.81
8.0.170.0000.00716.95
8.0.160.0000.00716.94
8.0.150.0000.00716.86
8.0.140.0030.00316.82
8.0.130.0030.00313.37
8.0.120.0080.00016.90
8.0.110.0000.00816.86
8.0.100.0040.00416.68
8.0.90.0040.00416.77
8.0.80.0090.01316.94
8.0.70.0080.00016.77
8.0.60.0050.00316.80
8.0.50.0000.00816.80
8.0.30.0100.00717.09
8.0.20.0120.00717.40
8.0.10.0040.00416.92
8.0.00.0060.01116.60
7.4.330.0030.00315.55
7.4.320.0070.00016.46
7.4.300.0030.00316.52
7.4.290.0060.00316.48
7.4.280.0040.00416.55
7.4.270.0000.00716.50
7.4.260.0030.00313.28
7.4.250.0000.00716.46
7.4.240.0040.00416.65
7.4.230.0040.00416.68
7.4.220.0150.01216.53
7.4.210.0070.01016.52
7.4.200.0070.00016.44
7.4.160.0110.00616.44
7.4.150.0100.00717.40
7.4.140.0070.01217.86
7.4.130.0120.01216.70
7.4.120.0080.01116.54
7.4.110.0100.01416.29
7.4.100.0100.01316.54
7.4.90.0090.00916.44
7.4.80.0150.00319.39
7.4.70.0100.00716.44
7.4.60.0130.00316.64
7.4.50.0030.01016.50
7.4.40.0030.01316.45
7.4.30.0130.00316.57
7.4.00.0070.01215.08
7.3.330.0000.00613.16
7.3.320.0020.00313.33
7.3.310.0070.00016.34
7.3.300.0030.00316.31
7.3.290.0030.00316.31
7.3.280.0080.00816.32
7.3.270.0030.01617.40
7.3.260.0120.00516.50
7.3.250.0110.00916.44
7.3.240.0100.01016.45
7.3.230.0120.00916.53
7.3.210.0130.00316.42
7.3.200.0000.01616.25
7.3.190.0110.00616.59
7.3.180.0150.00316.62
7.3.170.0130.00316.39
7.3.160.0060.00916.49
7.3.120.0100.01015.02
7.3.110.0160.00314.59
7.3.100.0150.00314.68
7.3.90.0090.00614.59
7.3.80.0100.00314.94
7.3.70.0100.00314.86
7.3.60.0060.00614.34
7.3.50.0030.01214.95
7.3.40.0030.00714.68
7.3.30.0000.01014.87
7.3.20.0060.00916.68
7.3.10.0090.00616.57
7.3.00.0080.00816.44
7.2.330.0120.00616.80
7.2.320.0090.00916.45
7.2.310.0110.00616.70
7.2.300.0090.00916.66
7.2.290.0000.01516.66
7.2.250.0040.01515.20
7.2.240.0000.02114.93
7.2.230.0080.00414.93
7.2.220.0040.00715.07
7.2.210.0060.00914.85
7.2.200.0030.01014.89
7.2.190.0030.01314.93
7.2.180.0000.01415.03
7.2.170.0130.00315.10
7.2.120.0060.00616.57
7.2.110.0000.00816.66
7.2.100.0070.00316.56
7.2.90.0070.00716.39
7.2.80.0090.00316.69
7.2.70.0060.00816.54
7.2.60.0080.00616.75
7.2.50.0030.01016.70
7.2.40.0070.00716.76
7.2.30.0100.00716.85
7.2.20.0120.00016.62
7.2.10.0080.00316.64
7.2.00.0090.00718.22
7.1.330.0040.01115.59
7.1.320.0030.00915.58
7.1.310.0030.01015.41
7.1.300.0040.00715.27
7.1.290.0030.01015.81
7.1.280.0090.00315.71
7.1.270.0060.00915.70
7.1.260.0090.00615.49
7.1.240.0030.01015.63
7.1.230.0120.00015.57
7.1.220.0160.00015.65
7.1.210.0000.01415.64
7.1.200.0050.00615.59
7.1.190.0070.00715.57
7.1.180.0060.00315.73
7.1.170.0000.01015.43
7.1.160.0040.00815.34
7.1.150.0140.00015.34
7.1.140.0120.00315.46
7.1.130.0060.00615.49
7.1.120.0070.00715.76
7.1.110.0070.00715.63
7.1.100.0060.00816.98
7.1.90.0100.00315.66
7.1.80.0100.00315.51
7.1.70.1400.00615.41
7.1.60.1300.01524.47
7.1.50.0170.00724.19
7.1.40.1200.01223.86
7.1.30.1300.01024.05
7.1.20.0800.01324.09
7.1.10.1230.00715.02
7.1.00.1250.00715.20
7.0.320.0030.00915.01
7.0.310.0070.00715.33
7.0.300.0080.00415.34
7.0.290.0040.01115.15
7.0.280.0090.00015.11
7.0.270.0030.00915.26
7.0.260.0070.00715.03
7.0.250.0060.00915.46
7.0.240.0070.00415.49
7.0.230.0070.00715.44
7.0.220.0090.00315.40
7.0.210.0090.00315.21
7.0.200.1120.00914.89
7.0.190.0060.01015.01
7.0.180.1130.00814.62
7.0.170.1230.01314.63
7.0.160.1200.00814.84
7.0.150.1270.00714.88
7.0.140.1010.01014.89
7.0.130.1170.01014.89
7.0.120.1180.01014.76
7.0.110.1070.01014.88
7.0.100.1010.01114.74
7.0.90.1120.00814.74
7.0.80.1010.00614.81
7.0.70.1040.00914.71
7.0.60.1120.00314.62
7.0.50.0980.00814.80
7.0.40.1270.00813.89
7.0.30.1220.01113.75
7.0.20.0840.01613.89
7.0.10.1060.00313.79
7.0.00.1000.01014.01
5.6.380.0070.00714.33

preferences:
53.84 ms | 400 KiB | 5 Q