3v4l.org

run code in 300+ PHP versions simultaneously
<?php set_error_handler(function ($errno, $errstr, $errfile, $errline) { $namespace = 'ajf\ErrorExceptions\Dynamic'; $className = 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\ANonWellFormedNumericStringEncountered $e) { echo "praise be to zend_is_numeric_string_ex: $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)
7.0.20.0400.07320.30
7.0.10.0030.04320.25
7.0.00.0070.05020.20
5.6.170.0270.06020.45
5.6.160.0030.05020.43
5.6.150.0070.06718.17
5.6.140.0030.08018.15
5.6.130.0070.07718.12
5.6.120.0070.08321.01
5.6.110.0100.05721.13
5.6.100.0100.08021.01
5.6.90.0100.06321.00
5.6.80.0100.05720.51
5.5.310.0270.04020.26
5.5.300.0100.03318.02
5.5.290.0100.07717.99
5.5.280.0100.08320.78
5.5.270.0130.05020.65
5.5.260.0030.06020.88
5.5.250.0030.08020.69
5.5.240.0130.03720.35

preferences:
145.35 ms | 1394 KiB | 7 Q