3v4l.org

run code in 300+ PHP versions simultaneously
<?php set_error_handler(function ($errno, $errstr, $errfile, $errline) { $namespace = 'ajf\ErrorExceptions\Dynamic'; $className = preg_replace('/[^a-zA-Z0-9]/', '', preg_replace('/\:.*$/', '', implode('', explode(' ', ucwords($errstr))))); $fullClassName = $namespace . '\\' . $className; if (!class_exists($fullClassName)) { eval("namespace $namespace { class $className extends \ErrorException {} }"); } throw new $fullClassName($errstr, 0, $errno, $errfile, $errline); }); try { $foo = 1/0; } catch (ajf\ErrorExceptions\Dynamic\DivisionByZero $e) { echo "ba-da-bing, ba-da-boom: I caught a $e!\n"; } try { $repent = sin("123abc"); } catch (ajf\ErrorExceptions\Dynamic\ANonWellFormedNumericValueEncountered $e) { echo "praise be to zend_is_numeric_string_ex: $e\n"; } try { $empty = []; $void = $empty["soul"]; } catch (ajf\ErrorExceptions\Dynamic\UndefinedIndex $e) { echo "not even the colon can defeat me: $e\n"; } try { class FooBar { public function FooBar () {} } } catch (ajf\ErrorExceptions\Dynamic\MethodsWithTheSameNameAsTheirClassWillNotBeConstructorsInAFutureVersionOfPHPFooBarHasADeprecatedConstructor $e) { echo "elePHP4nt: $e\n"; }

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.70.0130.00618.31
8.3.60.0070.00718.55
8.3.50.0080.01022.06
8.3.40.0040.01118.84
8.3.30.0120.00318.85
8.3.20.0070.00020.22
8.3.10.0070.00021.69
8.3.00.0080.00023.73
8.2.190.0120.00618.51
8.2.180.0100.00716.88
8.2.170.0090.00622.96
8.2.160.0100.00720.47
8.2.150.0000.00924.18
8.2.140.0050.00324.66
8.2.130.0080.00021.00
8.2.120.0070.00026.35
8.2.110.0050.00520.53
8.2.100.0090.00317.93
8.2.90.0040.00419.08
8.2.80.0040.00417.97
8.2.70.0030.00617.50
8.2.60.0040.00417.93
8.2.50.0040.00418.09
8.2.40.0050.00522.27
8.2.30.0000.00719.38
8.2.20.0070.00017.69
8.2.10.0000.00818.07
8.2.00.0000.00818.03
8.1.280.0140.00325.92
8.1.270.0110.00722.01
8.1.260.0070.00028.09
8.1.250.0040.00428.09
8.1.240.0090.00023.79
8.1.230.0000.01117.76
8.1.220.0040.00417.74
8.1.210.0060.00318.77
8.1.200.0060.00317.36
8.1.190.0030.00517.23
8.1.180.0080.00018.10
8.1.170.0040.00418.59
8.1.160.0000.00820.80
8.1.150.0000.00719.09
8.1.140.0080.00019.61
8.1.130.0100.00017.73
8.1.120.0000.00717.56
8.1.110.0040.00417.38
8.1.100.0000.00817.38
8.1.90.0000.00717.39
8.1.80.0040.00417.52
8.1.70.0030.00517.39
8.1.60.0000.00817.57
8.1.50.0080.00017.44
8.1.40.0040.00417.61
8.1.30.0060.00317.52
8.1.20.0040.00417.61
8.1.10.0040.00417.60
8.1.00.0080.00017.54
8.0.300.0040.00418.84
8.0.290.0040.00416.75
8.0.280.0050.00218.36
8.0.270.0040.00417.27
8.0.260.0000.00717.22
8.0.250.0000.00617.00
8.0.240.0000.00717.03
8.0.230.0000.00716.94
8.0.220.0000.00716.93
8.0.210.0040.00416.93
8.0.200.0070.00016.91
8.0.190.0080.00017.08
8.0.180.0000.00817.05
8.0.170.0000.00816.97
8.0.160.0000.00717.00
8.0.150.0000.00716.93
8.0.140.0080.00016.85
8.0.130.0000.00613.34
8.0.120.0040.00416.98
8.0.110.0040.00416.88
8.0.100.0000.00716.96
8.0.90.0040.00417.05
8.0.80.0060.00916.96
8.0.70.0040.00417.05
8.0.60.0030.00517.09
8.0.50.0070.00016.85
8.0.30.0090.01017.14
8.0.20.0090.00917.40
8.0.10.0040.00417.22
8.0.00.0100.01016.95
7.4.330.0050.00016.71
7.4.320.0000.00616.87
7.4.300.0000.00716.88
7.4.290.0050.00216.71
7.4.280.0050.00316.76
7.4.270.0030.00316.86
7.4.260.0040.00416.84
7.4.250.0000.00816.72
7.4.240.0030.00316.85
7.4.230.0000.00816.88
7.4.220.0140.00716.65
7.4.210.0130.00216.72
7.4.200.0000.00716.61
7.4.160.0110.01116.68
7.4.150.0120.00917.40
7.4.140.0120.00917.86
7.4.130.0150.00516.68
7.4.120.0090.01016.81
7.4.110.0130.00516.84
7.4.100.0120.00616.75
7.4.90.0030.02116.74
7.4.80.0100.00719.39
7.4.70.0090.00916.71
7.4.60.0100.00716.91
7.4.50.0060.00916.77
7.4.40.0130.00916.90
7.4.30.0060.01216.70
7.4.00.0090.00615.40
7.3.330.0030.00313.84
7.3.320.0000.00514.00
7.3.310.0000.00716.86
7.3.300.0070.00016.91
7.3.290.0030.00316.86
7.3.280.0080.01116.80
7.3.270.0140.00517.40
7.3.260.0120.00616.83
7.3.250.0070.01216.87
7.3.240.0110.00916.99
7.3.230.0140.00616.97
7.3.210.0000.01716.88
7.3.200.0070.01419.39
7.3.190.0060.01216.85
7.3.180.0060.01116.93
7.3.170.0100.00716.95
7.3.160.0070.01016.91
7.2.330.0030.01517.09
7.2.320.0100.01617.04
7.2.310.0100.00717.03
7.2.300.0100.00717.03
7.2.290.0100.00717.13
7.2.60.0000.01317.52
7.2.00.0100.01020.05
7.1.200.0220.00316.07
7.1.100.0080.00518.66
7.1.70.0030.00517.69
7.1.60.0030.02119.40
7.1.50.0040.01417.46
7.1.00.0030.07722.86
7.0.200.0350.01015.42
7.0.60.0230.07722.00
7.0.50.0130.03318.17
7.0.40.0000.04720.23
7.0.30.0330.07320.52
7.0.20.0230.04020.49
7.0.10.0070.04020.37
7.0.00.0070.09020.41
5.6.280.0030.03321.34
5.6.210.0200.07320.79
5.6.200.0070.05718.54
5.6.190.0130.04720.67
5.6.180.0170.04020.58
5.6.170.0330.06020.71
5.6.160.0070.08320.77
5.6.150.0130.07318.54
5.6.140.0100.05718.53
5.6.130.0070.08018.34
5.6.120.0070.08321.30
5.6.110.0100.06021.44
5.6.100.0100.08021.39
5.6.90.0070.05321.29
5.6.80.0170.06020.84
5.5.350.0000.04020.69
5.5.340.0070.05018.21
5.5.330.0070.05320.63
5.5.320.0200.07320.61
5.5.310.0170.04020.55
5.5.300.0100.07718.19
5.5.290.0030.04718.23
5.5.280.0130.08321.05
5.5.270.0030.08321.05
5.5.260.0200.07321.05
5.5.250.0070.08320.87
5.5.240.0130.03020.69

preferences:
62.19 ms | 401 KiB | 5 Q