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"; } try { $empty = []; $void = $empty["soul"]; } catch (ajf\ErrorExceptions\Dynamic\UndefinedOffset $e) { echo "not even the colon can defeat me: $e"; }

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.0060.01216.63
8.3.60.0090.00916.75
8.3.50.0110.00721.25
8.3.40.0110.00418.84
8.3.30.0090.01218.57
8.3.20.0000.00720.25
8.3.10.0050.00323.61
8.3.00.0050.00321.81
8.2.180.0080.01118.66
8.2.170.0150.00022.96
8.2.160.0140.00019.29
8.2.150.0020.00524.18
8.2.140.0040.00424.66
8.2.130.0080.00020.84
8.2.120.0000.00726.35
8.2.110.0030.00722.20
8.2.100.0080.00317.91
8.2.90.0040.00420.46
8.2.80.0050.00317.97
8.2.70.0040.00418.03
8.2.60.0040.00418.03
8.2.50.0050.00418.10
8.2.40.0030.00620.29
8.2.30.0000.00719.27
8.2.20.0070.00017.77
8.2.10.0040.00418.09
8.2.00.0000.00817.96
8.1.280.0040.01125.92
8.1.270.0090.00922.24
8.1.260.0040.00428.09
8.1.250.0070.00028.09
8.1.240.0090.00022.46
8.1.230.0060.00620.88
8.1.220.0040.00417.77
8.1.210.0090.00018.97
8.1.200.0030.00617.35
8.1.190.0040.00417.35
8.1.180.0000.00818.10
8.1.170.0000.00818.46
8.1.160.0030.00320.69
8.1.150.0000.00719.00
8.1.140.0040.00419.63
8.1.130.0040.00417.65
8.1.120.0070.00017.48
8.1.110.0000.00717.46
8.1.100.0000.00717.38
8.1.90.0000.00717.48
8.1.80.0000.00817.37
8.1.70.0030.00317.46
8.1.60.0040.00417.64
8.1.50.0000.00817.57
8.1.40.0030.00617.48
8.1.30.0000.00817.73
8.1.20.0000.00817.57
8.1.10.0050.00317.57
8.1.00.0000.00817.41
8.0.300.0090.00019.89
8.0.290.0000.00916.75
8.0.280.0030.00318.27
8.0.270.0000.00817.09
8.0.260.0000.00617.23
8.0.250.0030.00316.95
8.0.240.0040.00416.95
8.0.230.0050.00317.02
8.0.220.0050.00316.91
8.0.210.0040.00316.78
8.0.200.0040.00417.00
8.0.190.0000.00717.05
8.0.180.0030.00616.99
8.0.170.0050.00317.02
8.0.160.0040.00416.93
8.0.150.0040.00416.91
8.0.140.0040.00416.94
8.0.130.0050.00013.35
8.0.120.0080.00016.94
8.0.110.0030.00516.79
8.0.100.0040.00416.95
8.0.90.0000.00717.00
8.0.80.0080.00716.91
8.0.70.0040.00417.02
8.0.60.0000.00816.83
8.0.50.0030.00616.83
8.0.30.0140.00517.01
8.0.20.0080.01017.40
8.0.10.0040.00416.95
8.0.00.0100.00916.72
7.4.330.0050.00016.76
7.4.320.0060.00016.68
7.4.300.0040.00416.74
7.4.290.0070.00016.79
7.4.280.0000.00716.64
7.4.270.0070.00016.76
7.4.260.0000.00716.86
7.4.250.0000.00716.70
7.4.240.0070.00016.73
7.4.230.0000.00716.93
7.4.220.0140.01116.78
7.4.210.0080.01016.68
7.4.200.0040.00416.64
7.4.160.0040.01816.52
7.4.150.0070.01017.40
7.4.140.0140.01117.86
7.4.130.0150.00216.72
7.4.120.0080.00916.73
7.4.110.0120.00616.77
7.4.100.0150.00916.79
7.4.90.0090.01316.77
7.4.80.0080.00819.39
7.4.70.0060.01116.54
7.4.60.0130.00316.66
7.4.50.0030.01416.78
7.4.40.0100.00716.75
7.4.30.0000.02016.92
7.4.00.0030.01115.23
7.3.330.0030.00513.89
7.3.320.0000.00613.90
7.3.310.0000.00717.05
7.3.300.0070.00016.84
7.3.290.0040.00416.87
7.3.280.0090.00716.84
7.3.270.0090.00917.40
7.3.260.0070.01116.86
7.3.250.0120.00616.84
7.3.240.0050.01216.99
7.3.230.0170.00716.80
7.3.210.0100.00716.93
7.3.200.0080.01219.39
7.3.190.0090.00917.03
7.3.180.0060.00917.11
7.3.170.0150.00316.70
7.3.160.0130.00316.86
7.3.120.0030.01715.21
7.3.110.0070.01115.46
7.3.100.0120.00315.41
7.3.90.0130.00315.13
7.3.80.0150.00015.47
7.3.70.0060.00315.52
7.3.60.0090.00615.38
7.3.50.0070.00715.24
7.3.40.0120.00615.43
7.3.30.0090.00315.35
7.3.20.0030.00617.10
7.3.10.0070.00716.86
7.3.00.0030.00817.13
7.2.330.0130.00517.07
7.2.320.0100.01117.27
7.2.310.0060.01216.95
7.2.300.0090.00917.11
7.2.290.0100.00717.15
7.2.250.0060.01315.60
7.2.240.0040.01515.60
7.2.230.0110.00415.30
7.2.220.0030.00615.80
7.2.210.0030.01215.70
7.2.200.0060.00615.82
7.2.190.0030.01215.56
7.2.180.0130.00315.38
7.2.170.0070.01015.50
7.2.60.0030.01017.64
7.2.00.0120.00620.25
7.1.330.0040.01216.17
7.1.320.0030.00616.21
7.1.310.0100.00016.34
7.1.300.0000.01516.25
7.1.290.0100.00716.18
7.1.280.0070.00316.25
7.1.270.0000.01216.32
7.1.260.0000.01216.13
7.1.200.0060.00916.18
7.1.100.0040.01118.43
7.1.70.0000.00917.77
7.1.60.0040.02119.40
7.1.50.0110.01117.44
7.1.00.0000.08022.58
7.0.200.0240.01015.36
7.0.60.0170.07722.13
7.0.50.0070.04718.27
7.0.40.0070.08720.67
7.0.30.0330.07320.27
7.0.20.0270.07720.56
7.0.10.0030.04320.52
7.0.00.0100.04720.56
5.6.280.0030.06721.17
5.6.210.0130.07721.09
5.6.200.0100.07718.50
5.6.190.0100.07720.73
5.6.180.0100.05320.89
5.6.170.0170.04720.79
5.6.160.0130.03720.73
5.6.150.0000.04318.34
5.6.140.0130.06018.42
5.6.130.0070.04718.44
5.6.120.0030.08721.33
5.6.110.0100.08321.34
5.6.100.0100.06721.33
5.6.90.0030.07321.32
5.6.80.0100.07720.73
5.5.350.0100.07720.66
5.5.340.0100.07718.24
5.5.330.0070.08720.38
5.5.320.0570.06720.52
5.5.310.0300.07020.49
5.5.300.0030.04018.14
5.5.290.0030.06018.21
5.5.280.0130.07321.22
5.5.270.0070.06021.08
5.5.260.0130.05721.00
5.5.250.0000.07720.90
5.5.240.0030.03720.50

preferences:
48.49 ms | 401 KiB | 5 Q