3v4l.org

run code in 200+ PHP versions simultaneously
<?php class Out extends Exception { private $value; function __construct($value) { $this->value = $value; } function getValue() { return $this->value; } } function out($value = NULL) { throw new Out($value); } function mul($x, $y) { try { return ($x ?? out('x is NULL')) * ($y ?? out('y is NULL')); } catch (Out $out) { return $out->getValue(); } } var_export(mul(3, 4)); print "\n"; var_export(mul(3, NULL)); print "\n"; var_export(mul(NULL, 4)); print "\n";
based on TjuuO

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.4.00.0030.01015.11
7.3.100.0050.00914.77
7.3.90.0080.00614.45
7.3.80.0070.01114.39
7.3.70.0070.00714.50
7.3.60.0070.01014.73
7.3.50.0130.00014.95
7.3.40.0100.00314.32
7.3.30.0060.00814.46
7.3.20.0040.01014.84
7.3.10.0120.00914.61
7.3.00.0090.01214.66
7.2.230.0070.00714.79
7.2.220.0110.00415.14
7.2.210.0030.01614.88
7.2.200.0170.00014.91
7.2.190.0030.01314.84
7.2.180.0030.01114.70
7.2.170.0120.00614.76
7.2.160.0040.01114.93
7.2.150.0120.00915.30
7.2.140.0150.00615.05
7.2.130.0060.00915.29
7.2.120.0070.01314.91
7.2.110.0030.01414.94
7.2.100.0110.00715.11
7.2.90.0100.01014.96
7.2.80.0060.00915.13
7.2.70.0420.00915.15
7.2.60.0030.01315.09
7.2.50.0080.00915.24
7.2.40.0100.00515.27
7.2.30.0090.01215.26
7.2.20.0180.00315.18
7.2.10.0120.00915.20
7.2.00.0150.00615.13
7.1.320.0060.00613.78
7.1.310.0000.01813.93
7.1.300.0070.00713.87
7.1.290.0060.00913.89
7.1.280.0280.00313.75
7.1.270.0030.01013.79
7.1.260.0060.01313.96
7.1.250.0130.00014.00