3v4l.org

run code in 300+ PHP versions simultaneously
<?php $foo = <<<PHP const LOST_CONSTANT_BEFORE = 42; class Foo { public function foo() { // throw notice about deprecated constructor } } const LOST_CONSTANT_AFTER = 42; PHP; set_error_handler(function($errno, $errstr) { throw new Exception($errstr, $errno); // convert error to exception }); try { eval($foo); } catch (Exception $e) { printf("error %d with message: %s\n", $e->getCode(), $e->getMessage()); } var_dump( class_exists('foo'), // exists! defined('LOST_CONSTANT_BEFORE'), // where is my constant defined('LOST_CONSTANT_AFTER') // where is my constant );

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.0140.00016.75
8.3.50.0170.00816.30
8.3.40.0120.00618.84
8.3.30.0000.01418.71
8.3.20.0000.00720.21
8.3.10.0040.00420.65
8.3.00.0080.00020.56
8.2.180.0150.00418.41
8.2.170.0110.00422.96
8.2.160.0060.01220.57
8.2.150.0090.00024.18
8.2.140.0040.00424.66
8.2.130.0000.00726.16
8.2.120.0050.00319.95
8.2.110.0060.00320.94
8.2.100.0080.00417.72
8.2.90.0080.00017.91
8.2.80.0040.00417.97
8.2.70.0050.00317.80
8.2.60.0040.00418.22
8.2.50.0050.00318.09
8.2.40.0080.00020.48
8.2.30.0050.00321.22
8.2.20.0040.00417.70
8.2.10.0040.00418.14
8.2.00.0000.00718.09
8.1.280.0140.00025.92
8.1.270.0000.00823.97
8.1.260.0000.01426.35
8.1.250.0040.00428.09
8.1.240.0120.00017.35
8.1.230.0080.00420.88
8.1.220.0040.00417.74
8.1.210.0000.00820.06
8.1.200.0030.00617.35
8.1.190.0000.00817.10
8.1.180.0000.00818.10
8.1.170.0030.00518.59
8.1.160.0070.00020.77
8.1.150.0040.00418.87
8.1.140.0000.00819.49
8.1.130.0040.00417.33
8.1.120.0000.00717.36
8.1.110.0060.00317.38
8.1.100.0000.00717.34
8.1.90.0040.00417.34
8.1.80.0000.00717.51
8.1.70.0000.00717.36
8.1.60.0030.00917.42
8.1.50.0080.00017.53
8.1.40.0000.00917.41
8.1.30.0100.00017.71
8.1.20.0000.00817.59
8.1.10.0000.00717.39
8.1.00.0000.00817.30
8.0.300.0000.00820.13
8.0.290.0050.00316.75
8.0.280.0030.00318.43
8.0.270.0030.00317.16
8.0.260.0030.00316.75
8.0.250.0030.00316.88
8.0.240.0000.00717.05
8.0.230.0000.00716.89
8.0.220.0000.00716.84
8.0.210.0030.00316.98
8.0.200.0000.00717.00
8.0.190.0000.00717.00
8.0.180.0070.00016.88
8.0.170.0030.00517.04
8.0.160.0000.00816.94
8.0.150.0000.00716.84
8.0.140.0070.00016.83
8.0.130.0000.00613.36
8.0.120.0050.00316.92
8.0.110.0040.00416.95
8.0.100.0000.00716.84
8.0.90.0000.00816.97
8.0.80.0070.01017.00
8.0.70.0040.00416.83
8.0.60.0050.00316.90
8.0.50.0040.00416.91
8.0.30.0160.00316.99
8.0.20.0130.00717.40
8.0.10.0000.00817.05
8.0.00.0100.00916.71
7.4.330.0000.00415.08
7.4.320.0040.00416.57
7.4.300.0060.00016.55
7.4.290.0000.01016.52
7.4.280.0030.00516.49
7.4.270.0000.00716.48
7.4.260.0000.00716.62
7.4.250.0070.00016.47
7.4.240.0040.00416.42
7.4.230.0000.00716.62
7.4.220.0140.00616.60
7.4.210.0080.00816.57
7.4.200.0070.00016.39
7.4.160.0090.00616.41
7.4.150.0060.01217.40
7.4.140.0100.00917.86
7.4.130.0060.01316.45
7.4.120.0110.00616.46
7.4.110.0130.00316.50
7.4.100.0140.00716.48
7.4.90.0070.01016.46
7.4.80.0140.00819.39
7.4.70.0060.01416.52
7.4.60.0130.00416.55
7.4.50.0040.01116.48
7.4.40.0080.00816.50
7.4.30.0060.01216.55
7.4.00.0070.01015.12
7.3.330.0060.00313.31
7.3.320.0030.00313.17
7.3.310.0070.00016.14
7.3.300.0040.00416.31
7.3.290.0110.00516.31
7.3.280.0090.00816.32
7.3.270.0120.00617.40
7.3.260.0110.00816.43
7.3.250.0090.00916.42
7.3.240.0100.00716.38
7.3.230.0060.01216.41
7.3.210.0080.01516.29
7.3.200.0130.00616.45
7.3.190.0120.00316.34
7.3.180.0060.00916.30
7.3.170.0100.00616.43
7.3.160.0160.00316.41
7.3.10.0060.00316.77
7.3.00.0060.00616.59
7.2.330.0060.01216.59
7.2.320.0090.00916.50
7.2.310.0100.00716.80
7.2.300.0030.01716.55
7.2.290.0100.00716.46
7.2.130.0030.00716.55
7.2.120.0000.01016.64
7.2.110.0070.00416.98
7.2.100.0050.00516.82
7.2.90.0040.00816.75
7.2.80.0080.00816.57
7.2.70.0080.00416.65
7.2.60.0060.00816.95
7.2.50.0090.00616.56
7.2.40.0000.01516.84
7.2.30.0030.01016.70
7.2.20.0000.01616.91
7.2.10.0140.00316.79
7.2.00.0030.00818.13
7.1.250.0040.00415.66
7.1.200.0070.00715.77
7.1.100.0080.00517.83
7.1.70.0030.00617.03
7.1.60.0100.01419.19
7.1.50.0110.01117.06
7.1.00.0130.06322.36
7.0.200.0080.00816.81
7.0.100.0030.08019.99
7.0.90.0100.07719.90
7.0.80.0100.07319.87
7.0.70.0200.07319.87
7.0.60.0200.05719.81
7.0.50.0000.09020.27
7.0.40.0070.07720.05
7.0.30.0130.06020.14
7.0.20.0070.05319.95
7.0.10.0030.08020.12
7.0.00.0100.07320.05
5.6.280.0030.07321.07
5.6.250.0200.06020.52
5.6.240.0070.08720.65
5.6.230.0100.07720.59
5.6.220.0200.07320.57
5.6.210.0130.05320.54
5.6.200.0170.08021.00
5.6.190.0070.08320.98
5.6.180.0100.08320.90
5.6.170.0070.08020.99
5.6.160.0030.08020.91
5.6.150.0030.08321.06
5.6.140.0070.08021.02
5.6.130.0070.08720.89
5.6.120.0070.07321.04
5.6.110.0130.07720.96
5.6.100.0130.08321.11
5.6.90.0100.08020.89
5.6.80.0030.08020.29
5.6.70.0070.08020.38
5.6.60.0130.07020.35
5.6.50.0100.08020.37
5.6.40.0070.06320.38
5.6.30.0130.07020.38
5.6.20.0100.07020.24
5.6.10.0070.07020.26
5.6.00.0070.07320.24
5.5.380.0100.07020.34
5.5.370.0100.08320.34
5.5.360.0170.07320.29
5.5.350.0070.08020.32
5.5.340.0070.08020.83
5.5.330.0100.07020.72
5.5.320.0100.08020.60
5.5.310.0130.06720.84
5.5.300.0170.06720.86
5.5.290.0130.07720.75
5.5.280.0100.06320.68
5.5.270.0170.08020.81
5.5.260.0100.07020.68
5.5.250.0030.08720.60
5.5.240.0030.08020.13
5.5.230.0030.08020.07
5.5.220.0070.05720.25
5.5.210.0070.04320.21
5.5.200.0070.07320.18
5.5.190.0070.07019.99
5.5.180.0070.04020.10
5.5.160.0130.05320.22
5.5.150.0100.07320.03
5.5.140.0130.07720.19
5.5.130.0030.08020.03
5.5.120.0030.08320.08
5.5.110.0100.07720.16
5.5.100.0100.04320.03
5.5.90.0070.08020.07
5.5.80.0100.06320.03
5.5.70.0130.07020.04
5.5.60.0130.07320.02
5.5.50.0170.07320.10
5.5.40.0100.07719.88
5.5.30.0070.05020.09
5.5.20.0030.04020.10
5.5.10.0070.07020.04
5.5.00.0130.07320.08

preferences:
66.3 ms | 401 KiB | 5 Q