3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Test{ const OFF = -2147483647; // Logging is turned Off const OFF_STR = 'OFF'; const FATAL = -1; // Identical to Emergency const FATAL_STR = 'FATAL'; const EMERGENCY = 0; // System is unusable const EMERGENCY_STR = 'EMERGENCY'; const ALERT = 100; // Action Must be Taken Immediately const ALERT_STR = 'ALERT'; const CRITICAL = 200; // Critical Conditions const CRITICAL_STR = 'CRITICAL'; const ERROR = 300; // Error Conditions const ERROR_STR = 'ERROR'; const WARNING = 400; // Warning Conditions const WARNING_STR = 'WARNING'; const NOTICE = 500; // Normal, but significant conditions const NOTICE_STR = 'NOTICE'; const INFO = 600; // Informational messages const INFO_STR = 'INFO'; const DEBUG = 700; // Debug Level Messages const DEBUG_STR = 'DEBUG'; const TRACE = 800; // Trace Level Messages const TRACE_STR = 'TRACE'; const ALL = 2147483647; // Every Possible Log Level const ALL_STR = 'ALL'; private function Test($level, $levelStr){ $this->level = $level; $this->levelStr = $levelStr; } public static function getSomething(){ $cName = 'SOMETHING'; $sName = 'something'; self::setMap($cName,$sName); return self::$someMap[constant('Test::'.$cName)]; } public static function initLevelMap(){ $oClass = new ReflectionClass (__CLASS__); $constants = $oClass->getConstants(); foreach ($constants as $constant => $value){ if (is_int($value) && array_key_exists($constant.'_STR', $constants)){ print "$constant looks good.\n"; } } //var_dump($constants); } public static function setMap($cName,$sName){ if(!isset(self::$someMap[constant('Test::'.$cName)])) { print "setting it"; self::$someMap[constant('Test::'.$cName)] = new Test(constant('Test::'.$cName), $sName); } return self::$someMap; } } Test::initLevelMap();

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.40.0150.00018.78
8.3.30.0000.01419.06
8.3.20.0080.00020.21
8.3.10.0050.00221.73
8.3.00.0040.00419.38
8.2.170.0140.00322.96
8.2.160.0090.00620.33
8.2.150.0080.00024.18
8.2.140.0000.00924.66
8.2.130.0120.00326.16
8.2.120.0050.00220.96
8.2.110.0030.00622.25
8.2.100.0090.00317.78
8.2.90.0080.00017.91
8.2.80.0000.00919.44
8.2.70.0000.00818.05
8.2.60.0040.00418.03
8.2.50.0060.00318.10
8.2.40.0040.00420.64
8.2.30.0030.00618.13
8.2.20.0020.00517.80
8.2.10.0040.00418.18
8.2.00.0070.00017.63
8.1.270.0000.01023.96
8.1.260.0040.00426.35
8.1.250.0040.00428.09
8.1.240.0060.00323.79
8.1.230.0080.00420.98
8.1.220.0080.00017.74
8.1.210.0110.00018.77
8.1.200.0030.00517.23
8.1.190.0000.00917.23
8.1.180.0000.00818.10
8.1.170.0040.00418.71
8.1.160.0040.00422.07
8.1.150.0040.00418.88
8.1.140.0000.00717.35
8.1.130.0000.00717.79
8.1.120.0070.00017.50
8.1.110.0000.00717.34
8.1.100.0000.00717.40
8.1.90.0040.00417.46
8.1.80.0070.00017.50
8.1.70.0030.00317.40
8.1.60.0000.00817.61
8.1.50.0080.00017.43
8.1.40.0040.00417.52
8.1.30.0000.00917.61
8.1.20.0000.00817.56
8.1.10.0050.00217.49
8.1.00.0030.00717.56
8.0.300.0080.00020.16
8.0.290.0070.00016.63
8.0.280.0000.00718.32
8.0.270.0070.00017.28
8.0.260.0000.00617.14
8.0.250.0000.00717.00
8.0.240.0070.00016.93
8.0.230.0000.00716.98
8.0.220.0040.00416.83
8.0.210.0030.00316.92
8.0.200.0040.00416.82
8.0.190.0040.00416.85
8.0.180.0040.00416.91
8.0.170.0000.00916.93
8.0.160.0030.00316.89
8.0.150.0000.00716.75
8.0.140.0040.00416.86
8.0.130.0060.00013.32
8.0.120.0040.00416.87
8.0.110.0040.00416.85
8.0.100.0040.00416.89
8.0.90.0000.00716.70
8.0.80.0060.01316.88
8.0.70.0040.00416.84
8.0.60.0040.00416.75
8.0.50.0000.00816.79
8.0.30.0110.00717.01
8.0.20.0080.01217.40
8.0.10.0040.00416.90
8.0.00.0080.01016.82
7.4.330.0050.00015.14
7.4.320.0030.00316.61
7.4.300.0070.00016.45
7.4.290.0080.00016.59
7.4.280.0000.00716.51
7.4.270.0000.00716.38
7.4.260.0030.00616.58
7.4.250.0020.00516.48
7.4.240.0040.00316.46
7.4.230.0000.00716.41
7.4.220.0090.00916.50
7.4.210.0030.01016.69
7.4.200.0070.00016.68
7.4.160.0070.01416.73
7.4.150.0110.00717.40
7.4.140.0140.00317.86
7.4.130.0060.01116.60
7.4.120.0080.01216.50
7.4.110.0030.01316.41
7.4.100.0110.00716.55
7.4.90.0140.00316.40
7.4.80.0050.01119.39
7.4.70.0060.01216.66
7.4.60.0030.01316.63
7.4.50.0000.00816.27
7.4.40.0120.00516.57
7.4.30.0030.01416.61
7.4.10.0090.00914.88
7.4.00.0070.00914.98
7.3.330.0000.00613.40
7.3.320.0050.00013.19
7.3.310.0000.00716.39
7.3.300.0030.00316.38
7.3.290.0030.01116.37
7.3.280.0080.00916.34
7.3.270.0190.00717.40
7.3.260.0030.01616.60
7.3.250.0130.00416.52
7.3.240.0140.00516.49
7.3.230.0060.01016.39
7.3.210.0050.01116.20
7.3.200.0180.00619.39
7.3.190.0190.00016.55
7.3.180.0100.00716.50
7.3.170.0090.00916.54
7.3.160.0110.00516.34
7.3.130.0060.01314.96
7.3.120.0050.01114.87
7.3.110.0050.01114.85
7.3.100.0070.00814.84
7.3.90.0060.00914.80
7.3.80.0050.00914.88
7.3.70.0060.01014.72
7.3.60.0100.00514.89
7.3.50.0060.00814.89
7.3.40.0050.00714.89
7.3.30.0080.00714.66
7.3.20.0060.00816.67
7.3.10.0030.01016.86
7.3.00.0020.01116.77
7.2.330.0060.01216.52
7.2.320.0080.01216.71
7.2.310.0100.01016.78
7.2.300.0080.00816.59
7.2.290.0110.00616.71
7.2.260.0100.01015.27
7.2.250.0100.00814.98
7.2.240.0090.00615.18
7.2.230.0080.00815.06
7.2.220.0060.01015.24
7.2.210.0030.01215.18
7.2.200.0070.00715.05
7.2.190.0090.00615.04
7.2.180.0040.00615.02
7.2.170.0050.00815.03
7.2.160.0100.00315.04
7.2.150.0070.00717.05
7.2.140.0000.01517.01
7.2.130.0120.00317.05
7.2.120.0040.01217.03
7.2.110.0120.00617.05
7.2.100.0060.01216.68
7.2.90.0040.01116.98
7.2.80.0040.01116.95
7.2.70.0070.00317.01
7.2.60.0140.00616.82
7.2.50.0070.00716.70
7.2.40.0130.00316.83
7.2.30.0070.00717.05
7.2.20.0100.00316.86
7.2.10.0000.01116.86
7.2.00.0040.01118.04
7.1.330.0040.01315.71
7.1.320.0090.00515.70
7.1.310.0040.00815.85
7.1.300.0030.00815.59
7.1.290.0060.00815.69
7.1.280.0070.00515.78
7.1.270.0030.01115.83
7.1.260.0060.00615.85
7.1.250.0030.00915.83
7.1.240.0100.00315.88
7.1.230.0040.01115.75
7.1.220.0070.00715.99
7.1.210.0040.01215.68
7.1.200.0050.00715.91
7.1.190.0100.00715.84
7.1.180.0000.01615.71
7.1.170.0060.00915.70
7.1.160.0070.00715.95
7.1.150.0060.00615.79
7.1.140.0000.01415.68
7.1.130.0030.01015.91
7.1.120.0090.00616.02
7.1.110.0070.00715.82
7.1.100.0030.00816.82
7.1.90.0040.00815.79
7.1.80.0040.01115.97
7.1.70.0010.00916.52
7.1.60.0050.01517.64
7.1.50.0050.01116.21
7.1.40.0060.00915.68
7.1.30.0030.01315.76
7.1.20.0070.00715.83
7.1.10.0030.01015.53
7.1.00.0030.03919.20
7.0.330.0100.00315.16
7.0.320.0000.01515.27
7.0.310.0040.01115.47
7.0.300.0040.00815.41
7.0.290.0100.00315.50
7.0.280.0070.00715.39
7.0.270.0000.01215.49
7.0.260.0090.00615.60
7.0.250.0070.00315.46
7.0.240.0070.00715.59
7.0.230.0120.00315.54
7.0.220.0070.00715.57
7.0.210.0000.00915.43
7.0.200.0030.00716.02
7.0.190.0040.01215.54
7.0.180.0040.00715.46
7.0.170.0090.00315.43
7.0.160.0000.00815.51
7.0.150.0060.00315.50
7.0.140.0030.04118.73
7.0.130.0030.01015.32
7.0.120.0060.00615.44
7.0.110.0080.00415.49
7.0.100.0080.00015.50
7.0.90.0070.00315.59
7.0.80.0120.00015.44
7.0.70.0050.01315.43
7.0.60.0030.04017.75
7.0.50.0030.03116.76
7.0.40.0040.03016.91
7.0.30.0120.03016.70
7.0.20.0180.03116.59
7.0.10.0090.03716.86
7.0.00.0040.02916.80
5.6.400.0060.00614.63
5.6.390.0080.00814.31
5.6.380.0070.01014.02
5.6.370.0060.00614.35
5.6.360.0070.00314.13
5.6.350.0030.00714.21
5.6.340.0000.01514.45
5.6.330.0070.01014.59
5.6.320.0070.00714.32
5.6.310.0000.01214.61
5.6.300.0040.01114.04
5.6.290.0090.00314.63
5.6.280.0060.04017.75
5.6.270.0100.00314.47
5.6.260.0050.00514.61
5.6.250.0030.00514.30
5.6.240.0070.00714.42
5.6.230.0080.01114.24
5.6.220.0040.01114.29
5.6.210.0050.04417.50
5.6.200.0140.04016.27
5.6.190.0100.04017.51
5.6.180.0170.04217.52
5.6.170.0170.03917.55
5.6.160.0100.03917.34
5.6.150.0080.03416.19
5.6.140.0070.03216.24
5.6.130.0040.04116.31
5.6.120.0070.02317.73
5.6.110.0050.04717.74
5.6.100.0070.04317.62
5.6.90.0050.03817.69
5.6.80.0090.04117.29
5.6.70.0040.01214.11
5.6.60.0030.00914.16
5.6.50.0030.01214.14
5.6.40.0070.00714.15
5.6.30.0060.00614.42
5.6.20.0060.01014.24
5.6.10.0070.00714.34
5.6.00.0100.00314.60
5.5.380.0120.00614.37
5.5.370.0000.01614.29
5.5.360.0060.00914.48
5.5.350.0050.04517.42
5.5.340.0050.03316.23
5.5.330.0060.02517.19
5.5.320.0140.02517.36
5.5.310.0080.02617.26
5.5.300.0050.04116.16
5.5.290.0090.03416.06
5.5.280.0090.03217.63
5.5.270.0070.03717.64
5.5.260.0060.04117.61
5.5.250.0050.02417.40
5.5.240.0170.04417.15
5.5.230.0070.00314.03
5.5.220.0030.00714.27
5.5.210.0000.01514.10
5.5.200.0030.01214.38
5.5.190.0030.01414.43
5.5.180.0060.01114.05
5.5.170.0030.01014.33
5.5.160.0100.00014.29
5.5.150.0040.01114.12
5.5.140.0030.00614.07
5.5.130.0060.01213.96
5.5.120.0100.00313.91
5.5.110.0070.00714.13
5.5.100.0000.01414.07
5.5.90.0050.00514.13
5.5.80.0040.01114.35
5.5.70.0000.01414.32
5.5.60.0040.01113.98
5.5.50.0150.00014.38
5.5.40.0030.00614.39
5.5.30.0040.01414.03
5.5.20.0000.01413.86
5.5.10.0080.00614.17
5.5.00.0000.01713.79
5.4.450.0080.02415.46
5.4.440.0130.02615.40
5.4.430.0200.02215.45
5.4.420.0120.02215.56
5.4.410.0220.02415.38
5.4.400.0150.02315.46
5.4.390.0180.02315.44
5.4.380.0250.03815.12
5.4.370.0180.04315.12
5.4.360.0150.03215.04
5.4.350.0270.02815.04
5.4.340.0220.04215.20
5.4.330.0000.00611.61
5.4.320.0070.02312.06
5.4.310.0050.02812.06
5.4.300.0050.02012.06
5.4.290.0050.02512.06
5.4.280.0040.02712.01
5.4.270.0090.02512.01
5.4.260.0060.02312.01
5.4.250.0020.02312.01
5.4.240.0030.02512.01
5.4.230.0040.02212.00
5.4.220.0040.02212.01
5.4.210.0020.02412.01
5.4.200.0070.02112.00
5.4.190.0060.02212.00
5.4.180.0070.01912.00
5.4.170.0080.01912.01
5.4.160.0050.02212.00
5.4.150.0040.02312.00
5.4.140.0070.02211.85
5.4.130.0050.02311.84
5.4.120.0020.02411.82
5.4.110.0020.02511.82
5.4.100.0060.02311.82
5.4.90.0040.02411.82
5.4.80.0060.02111.82
5.4.70.0030.02111.81
5.4.60.0070.01911.81
5.4.50.0070.02011.81
5.4.40.0040.02011.80
5.4.30.0050.02011.81
5.4.20.0060.02011.81
5.4.10.0040.02211.80
5.4.00.0020.02311.55
5.3.290.0080.02012.20
5.3.280.0040.02312.16
5.3.270.0060.02312.17
5.3.260.0060.02212.16
5.3.250.0070.02212.16
5.3.240.0040.02212.16
5.3.230.0020.02412.15
5.3.220.0060.02212.14
5.3.210.0040.02312.14
5.3.200.0020.02512.14
5.3.190.0030.02312.14
5.3.180.0040.02212.14
5.3.170.0050.02212.13
5.3.160.0070.02012.14
5.3.150.0060.02312.14
5.3.140.0050.01912.13
5.3.130.0050.02512.13
5.3.120.0060.02312.13
5.3.110.0030.02612.13
5.3.100.0020.02411.87
5.3.90.0020.02211.86
5.3.80.0070.02011.86
5.3.70.0070.02111.86
5.3.60.0070.02211.85
5.3.50.0030.02311.82
5.3.40.0050.02711.82
5.3.30.0080.02311.80
5.3.20.0040.02311.69
5.3.10.0060.01811.67
5.3.00.0040.02311.67
5.2.170.0040.0309.24
5.2.160.0050.0279.24
5.2.150.0080.0269.24
5.2.140.0070.0349.23
5.2.130.0010.0329.20
5.2.120.0020.0329.20
5.2.110.0050.0359.20
5.2.100.0070.0259.20
5.2.90.0040.0299.20
5.2.80.0090.0429.19
5.2.70.0020.0339.19
5.2.60.0080.0329.14
5.2.50.0050.0329.11
5.2.40.0040.0349.09
5.2.30.0060.0389.07
5.2.20.0080.0369.06
5.2.10.0050.0318.96
5.2.00.0030.0388.83
5.1.60.0060.0328.11
5.1.50.0060.0308.11
5.1.40.0020.0268.09
5.1.30.0040.0408.44
5.1.20.0060.0338.46
5.1.10.0020.0288.19
5.1.00.0050.0318.19
5.0.50.0030.0316.66
5.0.40.0040.0276.52
5.0.30.0040.0336.34
5.0.20.0020.0206.30
5.0.10.0050.0216.28
5.0.00.0090.0386.27
4.4.90.0040.0144.78
4.4.80.0020.0154.75
4.4.70.0030.0154.76
4.4.60.0020.0164.76
4.4.50.0030.0144.77
4.4.40.0010.0264.70
4.4.30.0040.0134.75
4.4.20.0050.0134.85
4.4.10.0050.0134.85
4.4.00.0030.0244.76
4.3.110.0020.0164.67
4.3.100.0030.0144.66
4.3.90.0010.0164.63
4.3.80.0030.0244.58
4.3.70.0040.0134.63
4.3.60.0010.0164.63
4.3.50.0020.0154.63
4.3.40.0020.0244.54
4.3.30.0000.0183.30
4.3.20.0010.0173.28
4.3.10.0020.0153.24
4.3.00.0000.01315.90

preferences:
48.22 ms | 400 KiB | 5 Q