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\UndefinedIndex $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.0110.01118.31
8.3.60.0140.00416.88
8.3.50.0050.01321.11
8.3.40.0140.00018.87
8.3.30.0140.00718.75
8.3.20.0040.00420.16
8.3.10.0070.00021.89
8.3.00.0000.00823.64
8.2.190.0110.00718.16
8.2.180.0070.00716.88
8.2.170.0000.01422.96
8.2.160.0030.01020.52
8.2.150.0040.00425.66
8.2.140.0070.00024.66
8.2.130.0040.00420.96
8.2.120.0040.00426.35
8.2.110.0070.00321.07
8.2.100.0070.00418.03
8.2.90.0030.00618.99
8.2.80.0040.00417.97
8.2.70.0000.00917.50
8.2.60.0040.00418.05
8.2.50.0080.00018.09
8.2.40.0030.00622.22
8.2.30.0020.00519.52
8.2.20.0070.00017.85
8.2.10.0000.00818.13
8.2.00.0000.00818.12
8.1.280.0070.01125.92
8.1.270.0100.01022.09
8.1.260.0070.00028.09
8.1.250.0040.00428.09
8.1.240.0030.00617.66
8.1.230.0120.00017.70
8.1.220.0000.00817.78
8.1.210.0050.00318.77
8.1.200.0000.01017.35
8.1.190.0000.00917.25
8.1.180.0040.00418.10
8.1.170.0000.00818.58
8.1.160.0040.00420.88
8.1.150.0000.00719.02
8.1.140.0040.00419.59
8.1.130.0000.00817.82
8.1.120.0000.00817.50
8.1.110.0000.00717.46
8.1.100.0040.00417.35
8.1.90.0030.00517.36
8.1.80.0050.00317.40
8.1.70.0000.00717.31
8.1.60.0000.00817.57
8.1.50.0060.00317.56
8.1.40.0050.00317.59
8.1.30.0030.00517.61
8.1.20.0030.00617.63
8.1.10.0000.00817.57
8.1.00.0040.00417.44
8.0.300.0030.00518.77
8.0.290.0040.00416.63
8.0.280.0070.00018.50
8.0.270.0050.00317.17
8.0.260.0000.00817.18
8.0.250.0030.00316.98
8.0.240.0040.00416.86
8.0.230.0000.00716.87
8.0.220.0070.00016.91
8.0.210.0080.00016.93
8.0.200.0030.00317.00
8.0.190.0070.00017.01
8.0.180.0000.00717.05
8.0.170.0090.00017.02
8.0.160.0000.00817.00
8.0.150.0030.00316.96
8.0.140.0000.00716.83
8.0.130.0030.00313.47
8.0.120.0000.00816.76
8.0.110.0000.00716.99
8.0.100.0040.00416.75
8.0.90.0000.00717.02
8.0.80.0100.00717.01
8.0.70.0030.00516.77
8.0.60.0000.00816.80
8.0.50.0050.00317.00
8.0.30.0120.00717.00
8.0.20.0150.00417.40
8.0.10.0020.00517.00
8.0.00.0120.00916.75
7.4.330.0020.00216.73
7.4.320.0000.00716.73
7.4.300.0040.00416.82
7.4.290.0040.00416.78
7.4.280.0090.00016.72
7.4.270.0000.00716.72
7.4.260.0030.00316.80
7.4.250.0050.00216.77
7.4.240.0050.00216.74
7.4.230.0000.00716.58
7.4.220.0080.01116.86
7.4.210.0110.00816.79
7.4.200.0050.00316.82
7.4.160.0100.00616.86
7.4.150.0080.01117.40
7.4.140.0120.00817.86
7.4.130.0100.01216.67
7.4.120.0070.01016.85
7.4.110.0030.01516.80
7.4.100.0120.01216.61
7.4.90.0060.01616.79
7.4.80.0150.00319.39
7.4.70.0070.01016.82
7.4.60.0160.00016.78
7.4.50.0060.00916.73
7.4.40.0130.01216.73
7.4.30.0030.01616.73
7.4.00.0040.00915.17
7.3.330.0030.00313.81
7.3.320.0000.00513.73
7.3.310.0030.00316.98
7.3.300.0030.00316.76
7.3.290.0070.00016.84
7.3.280.0130.00316.72
7.3.270.0110.00517.40
7.3.260.0110.00717.01
7.3.250.0100.00916.93
7.3.240.0100.00816.88
7.3.230.0180.00617.09
7.3.210.0070.01017.05
7.3.200.0150.00619.39
7.3.190.0070.01416.79
7.3.180.0100.00716.69
7.3.170.0070.01416.99
7.3.160.0000.01616.77
7.2.330.0140.00417.02
7.2.320.0140.01016.96
7.2.310.0130.00617.24
7.2.300.0110.00617.24
7.2.290.0150.00217.28
7.2.60.0000.01417.49
7.2.00.0210.00319.89
7.1.200.0100.00316.50
7.1.100.0040.00818.63
7.1.70.0060.00317.82
7.1.60.0070.01419.40
7.1.50.0060.01317.63
7.1.00.0070.07022.76
7.0.200.0180.00715.38
7.0.60.0170.03722.01
7.0.50.0130.04018.18
7.0.40.0030.04320.47
7.0.30.0270.08020.37
7.0.20.0270.07020.52
7.0.10.0070.04020.35
7.0.00.0130.04320.43
5.6.280.0070.07021.33
5.6.210.0100.04720.75
5.6.200.0130.07718.46
5.6.190.0070.07721.02
5.6.180.0270.07720.73
5.6.170.0300.07720.76
5.6.160.0170.08020.77
5.6.150.0070.05718.43
5.6.140.0100.03718.43
5.6.130.0070.07018.47
5.6.120.0070.07321.45
5.6.110.0000.08721.39
5.6.100.0070.08721.29
5.6.90.0130.06721.28
5.6.80.0100.08020.68
5.5.350.0030.05320.66
5.5.340.0100.07018.28
5.5.330.0230.05320.63
5.5.320.0700.05020.52
5.5.310.0300.07320.43
5.5.300.0000.06718.26
5.5.290.0070.08018.30
5.5.280.0070.05721.05
5.5.270.0000.04721.11
5.5.260.0100.06021.11
5.5.250.0130.07720.86
5.5.240.0170.03720.58

preferences:
41.62 ms | 401 KiB | 5 Q