3v4l.org

run code in 300+ PHP versions simultaneously
<?php //var_dump(get_defined_constants(true)['Core']); class Foo { const ERR_SOME_CONST = 6001; const ERR_SOME_OTHER_CONST = 5001; function bar() { $x = 6001; $fooClass = new ReflectionClass ( 'Foo' ); $constants = $fooClass->getConstants(); $constants = get_defined_constants(true)['user']; var_dump($constants); $constName = null; foreach ( $constants as $name => $value ) { if ( $value == $x ) { $constName = $name; break; } } echo $constName; } } echo (new Foo)->bar();

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.0070.01116.73
8.3.50.0120.01021.88
8.3.40.0060.01518.97
8.3.30.0110.00419.07
8.3.20.0070.00020.30
8.3.10.0050.00323.66
8.3.00.0040.00420.77
8.2.180.0040.01118.26
8.2.170.0120.00922.96
8.2.160.0030.01020.52
8.2.150.0050.00324.18
8.2.140.0080.00024.66
8.2.130.0070.00026.16
8.2.120.0080.00019.48
8.2.110.0070.01022.16
8.2.100.0120.00018.15
8.2.90.0080.00019.41
8.2.80.0040.00417.97
8.2.70.0000.00817.75
8.2.60.0080.00017.93
8.2.50.0060.00618.07
8.2.40.0050.00318.22
8.2.30.0080.00018.34
8.2.20.0050.00317.83
8.2.10.0000.00818.13
8.2.00.0030.00519.46
8.1.280.0070.01325.92
8.1.270.0080.00023.96
8.1.260.0040.00426.35
8.1.250.0050.00228.09
8.1.240.0030.00622.19
8.1.230.0080.00319.16
8.1.220.0030.00617.78
8.1.210.0080.00018.77
8.1.200.0090.00017.35
8.1.190.0000.00817.22
8.1.180.0040.00418.10
8.1.170.0030.00618.65
8.1.160.0040.00422.05
8.1.150.0080.00018.55
8.1.140.0040.00417.39
8.1.130.0000.00717.77
8.1.120.0000.00817.40
8.1.110.0040.00417.37
8.1.100.0050.00317.52
8.1.90.0050.00217.52
8.1.80.0000.00717.40
8.1.70.0050.00317.43
8.1.60.0060.00317.62
8.1.50.0000.00817.57
8.1.40.0000.00717.55
8.1.30.0050.00517.70
8.1.20.0040.00417.71
8.1.10.0040.00417.61
8.1.00.0090.00017.52
8.0.300.0080.00018.77
8.0.290.0040.00416.75
8.0.280.0000.00718.49
8.0.270.0070.00017.28
8.0.260.0060.00017.32
8.0.250.0070.00017.03
8.0.240.0040.00417.04
8.0.230.0000.00716.91
8.0.220.0000.00717.02
8.0.210.0030.00317.01
8.0.200.0030.00317.09
8.0.190.0000.00716.94
8.0.180.0050.00216.90
8.0.170.0040.00417.04
8.0.160.0030.00316.97
8.0.150.0040.00416.95
8.0.140.0040.00416.95
8.0.130.0000.00513.41
8.0.120.0030.00516.95
8.0.110.0040.00416.99
8.0.100.0020.00517.05
8.0.90.0040.00416.87
8.0.80.0030.01216.93
8.0.70.0040.00416.89
8.0.60.0040.00416.85
8.0.50.0000.00716.84
8.0.30.0120.00717.10
8.0.20.0100.00817.40
8.0.10.0040.00417.07
8.0.00.0110.01016.76
7.4.330.0000.00615.14
7.4.320.0000.00616.65
7.4.300.0000.00616.46
7.4.290.0030.00316.58
7.4.280.0090.00016.63
7.4.270.0070.00016.62
7.4.260.0070.00016.64
7.4.250.0040.00416.55
7.4.240.0000.00716.63
7.4.230.0070.00016.58
7.4.220.0100.01416.63
7.4.210.0150.00616.69
7.4.200.0000.00716.59
7.4.160.0130.00316.70
7.4.150.0160.00317.40
7.4.140.0090.00817.86
7.4.130.0130.00416.64
7.4.120.0100.00816.57
7.4.110.0170.00716.46
7.4.100.0090.00916.62
7.4.90.0100.00716.39
7.4.80.0140.00719.39
7.4.70.0120.00616.63
7.4.60.0100.00616.50
7.4.50.0070.00016.55
7.4.40.0060.01616.58
7.4.30.0030.01616.51
7.4.00.0140.00015.07
7.3.330.0030.00313.26
7.3.320.0050.00013.23
7.3.310.0000.00716.50
7.3.300.0000.00716.36
7.3.290.0130.00416.46
7.3.280.0050.01216.40
7.3.270.0090.00917.40
7.3.260.0180.01216.51
7.3.250.0140.00316.46
7.3.240.0000.01716.54
7.3.230.0070.01116.39
7.3.210.0090.01216.58
7.3.200.0090.00919.39
7.3.190.0000.02016.65
7.3.180.0080.01516.34
7.3.170.0110.00616.78
7.3.160.0100.00716.63
7.3.120.0030.01214.88
7.2.330.0000.01716.51
7.2.320.0070.01116.67
7.2.310.0040.01116.48
7.2.300.0110.00516.48
7.2.290.0100.01016.87
7.1.70.0070.00017.17
7.1.60.0070.01019.70
7.1.50.0090.01217.11
7.1.00.0000.08022.33
7.0.200.0030.00616.97
7.0.140.0100.07022.07
7.0.100.0100.07719.98
7.0.90.0100.06719.87
7.0.80.0230.08319.88
7.0.70.0170.07719.93
7.0.60.0370.08719.89
7.0.50.0200.07020.27
7.0.40.0000.05019.96
7.0.30.0130.07320.04
7.0.20.0070.08020.15
7.0.10.0070.06720.12
7.0.00.0100.06320.18
5.6.280.0030.07720.94
5.6.250.0070.05320.72
5.6.240.0070.08020.53
5.6.230.0100.04720.69
5.6.220.0070.08720.51
5.6.210.0000.05720.57
5.6.200.0070.05021.08
5.6.190.0030.08021.09
5.6.180.0130.05721.07
5.6.170.0070.04721.14
5.6.160.0100.07321.11
5.6.150.0170.07721.11
5.6.140.0000.05321.11
5.6.130.0130.07721.04
5.6.120.0030.06721.12
5.6.110.0130.06321.27
5.6.100.0170.04321.13
5.6.90.0100.04320.96
5.6.80.0070.04720.50
5.6.70.0030.04320.43
5.6.60.0070.07020.46
5.6.50.0030.06720.59
5.6.40.0070.08020.36
5.6.30.0230.06720.40
5.6.20.0170.06720.56
5.6.10.0100.04020.41
5.6.00.0170.04320.30
5.5.380.0130.04020.52
5.5.370.0170.07020.47
5.5.360.0100.07720.45
5.5.350.0100.07020.44
5.5.340.0170.06720.95
5.5.330.0070.08020.93
5.5.320.0030.08720.93
5.5.310.0130.03720.87
5.5.300.0070.06720.90
5.5.290.0030.04720.93
5.5.280.0070.09720.91
5.5.270.0030.08020.85
5.5.260.0130.06020.78
5.5.250.0070.07720.72
5.5.240.0130.07020.27
5.5.230.0070.08320.20
5.5.220.0030.07320.32
5.5.210.0030.07020.31
5.5.200.0130.07020.21
5.5.190.0200.05320.18
5.5.180.0070.08020.27
5.5.160.0070.04320.25
5.5.150.0130.07020.26
5.5.140.0100.04320.11
5.5.130.0170.06720.30
5.5.120.0100.03720.29
5.5.110.0100.03720.28
5.5.100.0070.06020.11
5.5.90.0130.07020.12
5.5.80.0170.04720.07
5.5.70.0170.06720.09
5.5.60.0100.05320.19
5.5.50.0030.07720.14
5.5.40.0030.08019.99
5.5.30.0100.07720.18
5.5.20.0130.03320.07
5.5.10.0100.04320.07
5.5.00.0070.03720.08
5.4.450.0170.07719.20
5.4.440.0100.04319.48
5.4.430.0230.06019.52
5.4.420.0070.07319.50
5.4.410.0100.07019.32
5.4.400.0070.05318.91
5.4.390.0070.06719.05
5.4.380.0130.06719.14
5.4.370.0130.06319.09
5.4.360.0070.07319.03
5.4.350.0070.07719.13
5.4.340.0030.08319.03
5.4.320.0030.08019.09
5.4.310.0100.04019.04
5.4.300.0100.03319.04
5.4.290.0030.07018.84
5.4.280.0100.07719.23
5.4.270.0070.04019.12
5.4.260.0030.03718.90
5.4.250.0070.04318.89
5.4.240.0070.07718.87
5.4.230.0030.08019.21
5.4.220.0070.08319.18
5.4.210.0130.04319.23
5.4.200.0070.06719.04
5.4.190.0070.07719.02
5.4.180.0170.07018.87
5.4.170.0030.04018.86
5.4.160.0100.03019.01
5.4.150.0100.06718.93
5.4.140.0030.08016.42
5.4.130.0070.03016.41
5.4.120.0100.07016.33
5.4.110.0030.06316.57
5.4.100.0030.05016.32
5.4.90.0070.07016.56
5.4.80.0030.04716.43
5.4.70.0170.06716.50
5.4.60.0100.07016.42
5.4.50.0100.06716.45
5.4.40.0070.07316.37
5.4.30.0030.04016.45
5.4.20.0000.04316.51
5.4.10.0000.08016.41
5.4.00.0000.05015.78
5.3.290.0070.07714.73
5.3.280.0070.07014.71
5.3.270.0070.07314.49
5.3.260.0000.05014.71
5.3.250.0100.07314.61
5.3.240.0000.03714.63
5.3.230.0030.05314.61
5.3.220.0000.08014.60
5.3.210.0130.03714.49
5.3.200.0030.08314.52
5.3.190.0070.07714.71
5.3.180.0130.03314.63
5.3.170.0070.07014.48
5.3.160.0070.07714.59
5.3.150.0100.03714.61
5.3.140.0100.05014.52
5.3.130.0070.06714.66
5.3.120.0070.04314.60
5.3.110.0070.04314.50
5.3.100.0000.08314.18
5.3.90.0070.06314.08
5.3.80.0100.06713.91
5.3.70.0100.07714.04
5.3.60.0070.07314.02
5.3.50.0100.03713.84
5.3.40.0030.06314.10
5.3.30.0100.07013.97
5.3.20.0070.07313.77
5.3.10.0100.06713.66
5.3.00.0030.03713.66
5.2.170.0100.06311.20
5.2.160.0030.05711.05
5.2.150.0000.03711.05
5.2.140.0000.03711.07
5.2.130.0100.05710.99
5.2.120.0030.06011.11
5.2.110.0030.06011.03
5.2.100.0030.05711.13
5.2.90.0030.04311.12
5.2.80.0100.05711.18
5.2.70.0070.05311.08
5.2.60.0100.05311.11
5.2.50.0030.05311.13
5.2.40.0000.06710.86
5.2.30.0100.02711.11
5.2.20.0070.04011.07
5.2.10.0000.04010.92
5.2.00.0130.04010.72
5.1.60.0030.04010.10
5.1.50.0070.0439.99
5.1.40.0070.0309.82
5.1.30.0030.05310.25
5.1.20.0070.05310.38
5.1.10.0000.05310.18
5.1.00.0070.04710.07
5.0.50.0030.0438.40
5.0.40.0030.0438.40
5.0.30.0030.0438.08
5.0.20.0030.0408.31
5.0.10.0030.0408.25
5.0.00.0000.0638.27
4.4.90.0030.0207.95
4.4.80.0000.0337.95
4.4.70.0000.0307.95
4.4.60.0000.0207.95
4.4.50.0070.0237.95
4.4.40.0030.0307.95
4.4.30.0070.0337.95
4.4.20.0030.0337.95
4.4.10.0000.0377.95
4.4.00.0030.0307.95
4.3.110.0030.0307.95
4.3.100.0030.0337.95
4.3.90.0000.0237.95
4.3.80.0100.0337.95
4.3.70.0030.0337.95
4.3.60.0070.0307.95
4.3.50.0000.0337.95
4.3.40.0030.0377.95
4.3.30.0000.0337.95
4.3.20.0000.0377.95
4.3.10.0000.0377.95
4.3.00.0030.0277.95

preferences:
50.16 ms | 400 KiB | 5 Q