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); 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.0190.00318.27
8.3.50.0220.00521.20
8.3.40.0130.01318.73
8.3.30.0300.00020.17
8.3.20.0170.01320.30
8.3.10.0110.00322.00
8.3.00.0060.00622.43
8.2.180.0190.00616.63
8.2.170.0210.01522.96
8.2.160.0190.01322.12
8.2.150.0060.00624.18
8.2.140.0100.00324.66
8.2.130.0100.00326.16
8.2.120.0030.01020.69
8.2.110.0110.00320.54
8.2.100.0140.00317.91
8.2.90.0100.00019.22
8.2.80.0100.00317.97
8.2.70.0030.00717.50
8.2.60.0030.00617.80
8.2.50.0060.00318.07
8.2.40.0030.00619.76
8.2.30.0080.00319.46
8.2.20.0050.00517.82
8.2.10.0100.00017.72
8.2.00.0060.00317.80
8.1.280.0160.00925.92
8.1.270.0100.00323.99
8.1.260.0150.00026.35
8.1.250.0080.00428.09
8.1.240.0110.00422.22
8.1.230.0160.00317.45
8.1.220.0040.00817.77
8.1.210.0110.00018.77
8.1.200.0000.01217.22
8.1.190.0060.00617.39
8.1.180.0000.01119.01
8.1.170.0070.00318.46
8.1.160.0070.00320.60
8.1.150.0030.00718.67
8.1.140.0070.00317.61
8.1.130.0030.00617.85
8.1.120.0040.00817.55
8.1.110.0030.00617.42
8.1.100.0030.00717.39
8.1.90.0060.00617.48
8.1.80.0100.00017.54
8.1.70.0030.00717.41
8.1.60.0080.00417.50
8.1.50.0030.00717.68
8.1.40.0040.00717.54
8.1.30.0030.00617.55
8.1.20.0060.00617.53
8.1.10.0070.00317.66
8.1.00.0120.00317.43
8.0.300.0040.00418.77
8.0.290.0030.00716.63
8.0.280.0070.00418.41
8.0.270.0050.00517.29
8.0.260.0030.00616.84
8.0.250.0030.00616.91
8.0.240.0070.00316.88
8.0.230.0030.00616.88
8.0.220.0030.00616.94
8.0.210.0080.00416.98
8.0.200.0100.00016.95
8.0.190.0030.00616.68
8.0.180.0060.00616.90
8.0.170.0030.00816.79
8.0.160.0060.00316.79
8.0.150.0070.00416.95
8.0.140.0050.00516.78
8.0.130.0080.00013.33
8.0.120.0050.00516.71
8.0.110.0030.00616.73
8.0.100.0100.00016.82
8.0.90.0060.00316.79
8.0.80.0240.00316.96
8.0.70.0030.00616.78
8.0.60.0000.01216.60
8.0.50.0090.00016.64
8.0.30.0240.01817.11
8.0.20.0220.01717.40
8.0.10.0050.00516.93
8.0.00.0240.02116.58
7.4.330.0040.00415.13
7.4.320.0000.00916.45
7.4.300.0100.00016.54
7.4.290.0060.00316.55
7.4.280.0030.00616.56
7.4.270.0030.00716.59
7.4.260.0020.00513.33
7.4.250.0060.00616.50
7.4.240.0080.00216.63
7.4.230.0040.00416.41
7.4.220.0150.01216.56
7.4.210.0060.01916.60
7.4.200.0090.00016.59
7.4.190.0060.00316.61
7.4.160.0180.01816.52
7.4.150.0320.00417.40
7.4.140.0250.01417.86
7.4.130.0220.01716.60
7.4.120.0220.02016.46
7.4.110.0270.00916.50
7.4.100.0330.02716.54
7.4.90.0140.02416.44
7.4.80.0250.02819.39
7.4.70.0250.00616.44
7.4.60.0160.01616.64
7.4.50.0150.00016.30
7.4.40.0180.00322.77
7.4.30.0200.02016.48
7.3.330.0030.00313.24
7.3.320.0090.00013.33
7.3.310.0040.00716.44
7.3.300.0090.00016.18
7.3.290.0150.01116.33
7.3.280.0140.01516.25
7.3.270.0230.01917.40
7.3.260.0230.02016.66
7.3.250.0200.02116.21
7.3.240.0210.02516.42
7.3.230.0310.01116.65
7.3.210.0140.02516.57
7.3.200.0160.01619.39
7.3.190.0190.01516.21
7.3.180.0210.01216.67
7.3.170.0220.01916.27
7.3.160.0160.01616.36
7.2.330.0290.01116.71
7.2.320.0240.01016.61
7.2.310.0230.01416.84
7.2.300.0180.01516.72
7.2.290.0230.01716.73
7.2.100.1180.00314.60
7.2.90.0370.00814.50
7.2.80.0360.00414.89
7.2.70.0390.00414.89
7.2.60.1020.00315.04
7.2.50.0890.01314.83
7.2.40.1180.00615.04
7.1.220.0770.02113.63
7.1.210.1060.00313.79
7.1.200.0260.01314.04
7.1.190.0280.00314.05
7.1.180.1030.00613.87
7.1.170.1020.01013.90
7.1.160.1060.01313.80
7.0.310.0230.01013.65
7.0.300.0980.01613.61
7.0.290.1030.01013.61
5.6.380.0130.01614.47
5.6.370.0090.01814.28
5.6.360.0140.01014.27

preferences:
36.23 ms | 400 KiB | 5 Q