3v4l.org

run code in 300+ 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";

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.60.0100.01018.40
8.3.50.0030.01218.05
8.3.40.0090.00618.74
8.3.30.0120.00318.83
8.3.20.0040.00423.48
8.3.10.0000.00823.52
8.3.00.0090.00620.50
8.2.180.0120.00618.29
8.2.170.0040.01122.96
8.2.160.0140.00020.53
8.2.150.0050.00324.18
8.2.140.0000.00824.66
8.2.130.0080.00026.16
8.2.120.0000.00720.77
8.2.110.0060.00319.30
8.2.100.0110.00017.91
8.2.90.0060.00319.39
8.2.80.0080.00018.22
8.2.70.0000.00817.78
8.2.60.0050.00318.03
8.2.50.0060.00318.10
8.2.40.0040.00419.34
8.2.30.0000.00819.13
8.2.20.0000.00718.31
8.2.10.0000.00719.15
8.2.00.0040.00419.30
8.1.280.0050.01425.92
8.1.270.0040.00422.02
8.1.260.0040.00426.35
8.1.250.0000.00828.09
8.1.240.0030.00722.47
8.1.230.0050.00520.88
8.1.220.0000.00817.78
8.1.210.0060.00318.77
8.1.200.0040.00417.48
8.1.190.0040.00417.22
8.1.180.0050.00318.10
8.1.170.0040.00420.84
8.1.160.0000.00819.01
8.1.150.0040.00418.88
8.1.140.0040.00420.75
8.1.130.0030.00317.50
8.1.120.0070.00017.51
8.1.110.0080.00017.37
8.1.100.0000.00817.45
8.1.90.0070.00017.45
8.1.80.0000.00717.49
8.1.70.0030.00317.32
8.1.60.0050.00517.48
8.1.50.0000.00817.44
8.1.40.0030.00717.44
8.1.30.0040.00417.62
8.1.20.0040.00417.65
8.1.10.0040.00417.46
8.1.00.0040.00417.47
8.0.300.0060.00319.85
8.0.290.0070.00016.75
8.0.280.0070.00018.45
8.0.270.0070.00017.17
8.0.260.0000.00716.79
8.0.250.0030.00316.92
8.0.240.0030.00316.86
8.0.230.0030.00316.91
8.0.220.0040.00416.83
8.0.210.0030.00316.91
8.0.200.0030.00516.99
8.0.190.0040.00716.87
8.0.180.0000.00816.92
8.0.170.0080.00016.94
8.0.160.0000.00716.92
8.0.150.0030.00416.91
8.0.140.0070.00016.91
8.0.130.0000.00513.34
8.0.120.0030.00516.86
8.0.110.0000.00716.95
8.0.100.0040.00416.86
8.0.90.0000.00717.03
8.0.80.0000.01516.91
8.0.70.0040.00417.00
8.0.60.0020.00516.86
8.0.50.0060.00317.01
8.0.30.0250.00417.13
8.0.20.0160.00317.14
8.0.10.0050.00216.96
8.0.00.0160.00316.70
7.4.330.0000.00615.55
7.4.320.0000.00716.61
7.4.300.0000.00716.55
7.4.290.0000.00716.57
7.4.280.0080.00016.48
7.4.270.0000.00716.60
7.4.260.0030.00313.25
7.4.250.0070.00016.37
7.4.240.0020.00516.56
7.4.230.0000.00716.56
7.4.220.0020.00516.70
7.4.210.0090.00716.56
7.4.200.0000.00716.25
7.4.130.0080.00816.51
7.4.120.0110.00516.57
7.4.110.0130.00416.61
7.4.100.0090.00616.29
7.4.90.0070.01016.63
7.4.80.0170.00019.39
7.4.70.0090.00616.66
7.4.60.0170.00016.60
7.4.50.0040.00716.51
7.4.40.0030.01816.58
7.4.00.0030.01015.11
7.3.330.0000.00716.21
7.3.320.0030.00313.36
7.3.310.0030.00316.27
7.3.300.0030.00316.38
7.3.290.0000.00716.33
7.3.280.0000.01416.27
7.3.260.0100.00916.50
7.3.240.0080.01316.48
7.3.230.0170.00016.52
7.3.210.0070.00916.51
7.3.200.0100.01016.45
7.3.190.0080.00816.52
7.3.180.0060.01216.43
7.3.170.0070.01416.39
7.3.160.0030.01716.37
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.330.0110.00716.48
7.2.320.0030.01516.84
7.2.310.0040.01416.72
7.2.300.0130.01016.58
7.2.290.0060.00916.72
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

preferences:
71.04 ms | 400 KiB | 5 Q