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(); 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.0280.00316.75
8.3.50.0180.01321.97
8.3.40.0130.00918.59
8.3.30.0220.01019.04
8.3.20.0110.00320.25
8.3.10.0070.00723.66
8.3.00.0100.00320.63
8.2.180.0220.00316.63
8.2.170.0180.00619.08
8.2.160.0200.00322.96
8.2.150.0090.00324.18
8.2.140.0060.00624.66
8.2.130.0090.00326.16
8.2.120.0040.00922.16
8.2.110.0120.00419.52
8.2.100.0100.00717.91
8.2.90.0080.00319.16
8.2.80.0100.00017.97
8.2.70.0060.00618.05
8.2.60.0140.00018.05
8.2.50.0100.00018.10
8.2.40.0030.00720.55
8.2.30.0040.00818.20
8.2.20.0030.00717.70
8.2.10.0030.00719.53
8.2.00.0070.00317.85
8.1.280.0200.00325.92
8.1.270.0110.00423.96
8.1.260.0100.00326.35
8.1.250.0100.00328.09
8.1.240.0110.00421.30
8.1.230.0170.00017.77
8.1.220.0080.00417.77
8.1.210.0100.00318.77
8.1.200.0070.00317.47
8.1.190.0000.01017.35
8.1.180.0110.00018.10
8.1.170.0030.00618.80
8.1.160.0060.00322.32
8.1.150.0000.01018.80
8.1.140.0030.00717.62
8.1.130.0030.00717.96
8.1.120.0000.01017.48
8.1.110.0110.00017.61
8.1.100.0000.01117.56
8.1.90.0040.00817.63
8.1.80.0050.00517.59
8.1.70.0070.00317.47
8.1.60.0030.01017.71
8.1.50.0070.00317.59
8.1.40.0030.00717.68
8.1.30.0100.00017.66
8.1.20.0060.00617.79
8.1.10.0070.00317.59
8.1.00.0070.00317.49
8.0.300.0070.00318.77
8.0.290.0040.00716.88
8.0.280.0060.00318.45
8.0.270.0000.01017.39
8.0.260.0050.00516.93
8.0.250.0050.00517.00
8.0.240.0070.00717.10
8.0.230.0060.00317.00
8.0.220.0000.00917.02
8.0.210.0000.00917.04
8.0.200.0070.00317.05
8.0.190.0070.00317.12
8.0.180.0040.00716.96
8.0.170.0040.00716.94
8.0.160.0040.00717.02
8.0.150.0000.01116.86
8.0.140.0040.00816.84
8.0.130.0040.00413.32
8.0.120.0030.00716.88
8.0.110.0030.00816.94
8.0.100.0000.01016.95
8.0.90.0030.00616.91
8.0.80.0030.02616.98
8.0.70.0060.00317.08
8.0.60.0060.00317.05
8.0.50.0030.00617.00
8.0.30.0260.01517.36
8.0.20.0280.01617.40
8.0.10.0080.00317.05
8.0.00.0260.01616.92
7.4.330.0000.00715.07
7.4.320.0110.00016.58
7.4.300.0030.00716.52
7.4.290.0000.00916.66
7.4.280.0070.00316.62
7.4.270.0030.01016.55
7.4.260.0050.00516.74
7.4.250.0040.00716.56
7.4.240.0020.00816.69
7.4.230.0030.00616.74
7.4.220.0130.01716.66
7.4.210.0180.01516.66
7.4.200.0090.00016.43
7.4.190.0090.00016.79
7.4.160.0250.01116.62
7.4.150.0360.00417.40
7.4.140.0220.01517.86
7.4.130.0200.02016.61
7.4.120.0290.00916.55
7.4.110.0240.01416.52
7.4.100.0230.01716.66
7.4.90.0250.01116.75
7.4.80.0210.02416.66
7.4.70.0180.01516.73
7.4.60.0230.00916.71
7.4.50.0040.00416.67
7.4.40.0040.01522.77
7.4.30.0180.02116.78
7.3.330.0040.00413.37
7.3.320.0040.00413.26
7.3.310.0060.00316.47
7.3.300.0030.00616.50
7.3.290.0190.01616.43
7.3.280.0170.01416.45
7.3.270.0200.01817.40
7.3.260.0150.02216.47
7.3.250.0160.02216.61
7.3.240.0240.01516.69
7.3.230.0260.01116.44
7.3.210.0270.00916.43
7.3.200.0290.01619.39
7.3.190.0300.02016.79
7.3.180.0160.01616.30
7.3.170.0150.01816.49
7.3.160.0170.01416.46
7.2.330.0160.03116.67
7.2.320.0620.04116.57
7.2.310.0220.01016.82
7.2.300.0160.01616.84
7.2.290.0310.01216.55
7.2.100.0340.00814.89
7.2.90.0770.00614.85
7.2.80.0750.00614.79
7.2.70.0830.01014.64
7.2.60.0610.00915.14
7.2.50.0600.01714.79
7.2.40.0840.01615.13
7.1.220.0310.00913.93
7.1.210.0590.01013.85
7.1.200.0570.01413.82
7.1.190.0660.00913.82
7.1.180.0630.01314.02
7.1.170.0220.01013.78
7.1.160.1040.01313.94
7.0.310.0610.01013.61
7.0.300.0690.00913.61
7.0.290.0650.01813.61
5.6.380.0180.00614.00
5.6.370.0220.00814.34
5.6.360.0210.00714.30

preferences:
46.18 ms | 401 KiB | 5 Q