3v4l.org

run code in 300+ PHP versions simultaneously
<?php // performance hit processing non-fatal errors w/ custom error handler (e_notice, e_warning) // affects versions 7.4.7 & 7.4.8 // array of seq. ints $start = 3; $number_of_values = 5000; $seq_array = range($start, $start+$number_of_values-1); // set error handler function error_handler_fn($errno, $errstr, $errfile, $errline) { $dummy = '0'; // print_r(implode(", ", Array($errno, $errstr, $errfile, $errline))."\n"); } set_error_handler("error_handler_fn"); // array to index $array = Array(1,2,3); // run loop $t1 = microtime(true); foreach ($seq_array as $val) { $nothing = $array[$val]; // E_NOTICE (8) - try to index array at undefined index (performance issue) // $nothing2 = count(); // E_WARNING (2) - try to count nothing (similar performance issue) } $t2 = microtime(true); $outmsg = "\n\nRun time: " . round(($t2-$t1)*1000.,2) . " milliseconds (" . phpversion() . ")"; print_r($outmsg); ?>

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.80.0100.20116.67
7.4.70.0100.21216.99
7.4.60.0040.01616.51
7.4.50.0140.00816.91
7.4.40.0060.01316.74
7.4.30.0090.01216.71
7.4.20.0070.01816.86
7.4.10.0110.01116.48
7.4.00.0100.01016.51
7.3.200.0130.01016.40
7.3.190.0100.01016.58
7.3.180.0170.00816.89
7.3.170.0070.01416.61
7.3.160.0140.00616.68
7.3.150.0170.00316.43
7.3.140.0060.01416.69
7.3.130.0130.00616.57
7.3.120.0170.00316.67
7.3.110.0090.01416.64
7.3.100.0100.01016.71
7.3.90.0130.00716.59
7.3.80.0110.00816.89
7.3.70.0080.01116.71
7.3.60.0030.01616.32
7.3.50.0190.00416.76
7.3.40.0060.01916.52
7.3.30.0100.01016.32
7.3.20.0200.00716.55
7.3.10.0130.00916.35
7.3.00.0090.01216.50
7.2.320.0090.01216.75
7.2.310.0140.01117.09
7.2.300.0140.00716.82
7.2.290.0070.01516.80
7.2.280.0060.02216.90
7.2.270.0080.01616.95
7.2.260.0060.01916.84
7.2.250.0130.00716.68
7.2.240.0080.01516.96
7.2.230.0120.00917.03
7.2.220.0210.00016.75
7.2.210.0130.00716.71
7.2.200.0170.00416.84
7.2.190.0060.01516.76
7.2.180.0170.01016.74
7.2.170.0100.01016.67
7.2.160.0080.01216.58
7.2.150.0140.01116.87
7.2.140.0130.01016.74
7.2.130.0110.01516.61
7.2.120.0070.01816.68
7.2.110.0110.01716.60
7.2.100.0180.01116.72
7.2.90.0950.02216.53
7.2.80.0150.00916.73
7.2.70.0130.01016.95
7.2.60.0070.01716.70
7.2.50.0130.01616.65
7.2.40.0190.01316.89
7.2.30.0110.02116.80
7.2.20.0110.01516.74
7.2.10.0200.00516.77
7.2.00.0200.00416.66

preferences:
36.39 ms | 401 KiB | 5 Q