3v4l.org

run code in 300+ PHP versions simultaneously
<?php $fruits = array("d" => "lemon", "a" => "orange", "b" => "banana", "c" => "apple"); function test_alter(&$item1, $key, $prefix) { $item1 = "$item1 : $prefix"; } function test_print($item2, $key) { echo "$key. $item2\n"; } echo "Before ...:\n"; array_walk($fruits, 'test_print'); // array_walk($fruits, 'test_alter', 'fruit'); echo "... and after:\n"; array_walk(&fruits,'test_alter','fruit'); array_walk($fruits, 'test_print'); ?>

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.0200.07320.06
7.0.10.0070.07720.15
7.0.00.0030.04720.18
5.6.170.0400.06720.54
5.6.160.0100.08320.57
5.6.150.0170.06718.17
5.6.140.0030.08718.28
5.6.130.0030.05318.18
5.6.120.0070.04021.13
5.6.110.0100.08020.98
5.6.100.0130.07021.04
5.6.90.0070.04720.97
5.6.80.0030.03720.41
5.5.310.0300.07020.20
5.5.300.0130.08017.92
5.5.290.0070.05718.10
5.5.280.0030.04020.77
5.5.270.0100.06320.80
5.5.260.0130.07720.88
5.5.250.0070.08020.78
5.5.240.0170.08020.23

preferences:
142.16 ms | 1394 KiB | 7 Q