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 = "$prefix: $item1"; } function test_print($item2, $key) { echo "$key. $item2<br />\n"; } echo "Before ...:\n"; array_walk($fruits, 'test_print'); // array_walk($fruits, 'test_alter', 'fruit'); echo "... and after:\n"; array_walk($fruits,function($value, $key){$key = $value; $value=false;}); var_dump($fruits);

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.40.0060.00918.59
8.3.30.0150.00018.79
8.3.20.0000.00821.73
8.3.10.0040.00423.54
8.3.00.0040.00419.43
8.2.170.0120.00322.96
8.2.160.0070.00720.11
8.2.150.0040.00424.18
8.2.140.0050.00324.66
8.2.130.0050.00220.35
8.2.120.0070.00026.35
8.2.110.0080.00020.35
8.2.100.0040.00817.69
8.2.90.0000.00818.95
8.2.80.0000.00817.97
8.2.70.0080.00017.36
8.2.60.0050.00217.93
8.2.50.0000.00818.10
8.2.40.0040.00420.22
8.2.30.0090.00021.11
8.2.20.0000.00717.93
8.2.10.0040.00418.25
8.2.00.0040.00418.05
8.1.270.0080.00020.66
8.1.260.0060.00326.35
8.1.250.0030.00528.09
8.1.240.0000.00922.00
8.1.230.0160.00518.82
8.1.220.0040.00417.74
8.1.210.0060.00318.77
8.1.200.0060.00317.36
8.1.190.0040.00417.22
8.1.180.0040.00418.10
8.1.170.0080.00018.64
8.1.160.0050.00318.89
8.1.150.0000.00818.92
8.1.140.0000.00819.59
8.1.130.0030.00320.72
8.1.120.0040.00417.39
8.1.110.0040.00417.47
8.1.100.0000.00817.39
8.1.90.0020.00517.39
8.1.80.0050.00317.44
8.1.70.0030.00317.35
8.1.60.0070.00017.46
8.1.50.0040.00417.54
8.1.40.0000.00817.47
8.1.30.0040.00417.69
8.1.20.0060.00317.56
8.1.10.0000.00817.50
8.1.00.0100.00017.31
8.0.300.0000.00719.84
8.0.290.0000.00816.75
8.0.280.0070.00018.36
8.0.270.0030.00317.26
8.0.260.0030.00318.89
8.0.250.0060.00316.98
8.0.240.0030.00316.98
8.0.230.0030.00316.98
8.0.220.0050.00216.80
8.0.210.0000.00816.78
8.0.200.0030.00316.85
8.0.190.0090.00016.96
8.0.180.0030.00316.96
8.0.170.0030.00316.88
8.0.160.0030.00616.79
8.0.150.0050.00316.88
8.0.140.0030.00716.79
8.0.130.0000.00513.34
8.0.120.0040.00416.80
8.0.110.0000.00716.71
8.0.100.0000.00717.01
8.0.90.0040.00416.68
8.0.80.0070.01116.88
8.0.70.0000.00816.79
8.0.60.0040.00416.89
8.0.50.0000.00716.94
8.0.30.0150.00217.13
8.0.20.0090.01217.40
8.0.10.0050.00216.92
8.0.00.0090.00916.63
7.4.330.0050.00015.55
7.4.320.0070.00016.65
7.4.300.0000.00616.61
7.4.290.0060.00416.64
7.4.280.0080.00016.60
7.4.270.0070.00016.52
7.4.260.0030.00316.45
7.4.250.0000.00716.54
7.4.240.0080.00016.60
7.4.230.0030.00316.41
7.4.220.0000.02216.49
7.4.210.0000.01416.61
7.4.200.0000.00816.70
7.4.160.0060.01016.37
7.4.150.0040.01417.40
7.4.140.0100.01017.86
7.4.130.0120.00916.37
7.4.120.0100.01016.42
7.4.110.0040.01616.43
7.4.100.0090.01216.63
7.4.90.0000.01716.54
7.4.80.0060.01119.39
7.4.70.0060.01116.42
7.4.60.0030.01216.55
7.4.50.0030.01116.56
7.4.40.0150.00316.38
7.4.30.0040.01316.63
7.4.00.0110.00814.77
7.3.330.0020.00213.32
7.3.320.0040.00413.33
7.3.310.0030.00316.36
7.3.300.0000.00716.34
7.3.290.0070.00916.39
7.3.280.0080.01016.36
7.3.270.0060.01117.40
7.3.260.0120.01016.41
7.3.250.0120.00716.41
7.3.240.0110.00616.35
7.3.230.0060.01116.30
7.3.210.0120.00516.61
7.3.200.0070.01016.39
7.3.190.0100.01216.33
7.3.180.0060.01016.34
7.3.170.0120.00616.32
7.3.160.0130.00716.26
7.3.120.0030.01714.99
7.3.110.0100.01014.95
7.3.100.0110.00415.07
7.3.90.0040.00714.88
7.3.80.0060.00914.86
7.3.70.0000.01615.01
7.3.60.0100.00714.98
7.3.50.0130.00314.63
7.3.40.0080.00814.73
7.3.30.0070.00714.93
7.3.20.0030.01216.64
7.3.10.0110.00316.79
7.3.00.0030.01016.75
7.2.330.0040.01316.66
7.2.320.0110.00616.58
7.2.310.0080.00716.55
7.2.300.0130.00416.67
7.2.290.0070.01016.54
7.2.250.0070.01114.79
7.2.240.0060.00615.10
7.2.230.0060.00314.69
7.2.220.0030.01014.84
7.2.210.0040.01215.04
7.2.200.0070.01015.00
7.2.190.0040.01114.60
7.2.180.0060.01214.69
7.2.170.0100.00314.79
7.2.60.0110.00416.93
7.2.50.0000.01316.87
7.1.330.0120.00315.86
7.1.320.0030.00915.70
7.1.310.0040.00815.93
7.1.300.0060.00315.82
7.1.290.0120.00015.61
7.1.280.0000.01515.59
7.1.270.0060.00615.71
7.1.260.0030.00915.99
7.1.200.0060.00915.48
7.1.70.0030.00517.31
7.1.60.1370.02333.32
7.1.50.1130.02032.61
7.1.40.1070.02732.57
7.1.30.0300.01732.70
7.1.20.1030.01332.90
7.1.10.0370.00714.54
7.1.00.0700.01714.84
7.0.200.1300.00714.69
7.0.190.1130.01714.93
7.0.180.0600.01314.47
7.0.170.0130.00714.32
7.0.160.0630.00714.45
7.0.150.0130.00714.49
7.0.140.0100.01314.25
7.0.130.0770.01014.93
7.0.120.0700.01014.67
7.0.110.0870.01714.41
7.0.100.0870.02314.54
7.0.90.0570.01014.41
7.0.80.0800.01714.46
7.0.70.0630.01014.47
7.0.60.0600.00314.33
7.0.50.1100.01014.48
7.0.40.0300.00714.86
7.0.30.0030.01014.68
7.0.20.0970.00714.59
7.0.10.1030.01014.71
7.0.00.0930.02014.70

preferences:
47.21 ms | 400 KiB | 5 Q