3v4l.org

run code in 300+ PHP versions simultaneously
<?php function recurse(&$arr) { if (is_array($arr)) { foreach($arr as $i) { recurse($i); } } else { $i = $i . "appended"; echo $i; } } function utf8_encode_array(&$array) { if (is_array($array)) { array_walk($array, 'utf8_encode_array'); } else { $array = utf8_encode($array); } } function utf8_encode_array_recursive(&$arr) { if (is_array($arr)) { array_walk_recursive($arr, function(&$value, $key) { $value = utf8_encode($value); }); } else { $arr = utf8_encode($arr); } } $arr = range(1, 100); $start1 = microtime(true); recurse($arr); echo "Recurse function: " . (microtime(true) - $start1) . "\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)
7.4.00.0060.00915.17
7.3.120.0110.00814.96
7.3.110.0060.01214.66
7.3.100.0000.01014.88
7.3.90.0070.00715.13
7.3.80.0100.00314.80
7.3.70.0130.00314.69
7.3.60.0100.00314.86
7.3.50.0030.00714.93
7.3.40.0040.01214.90
7.3.30.0030.00614.93
7.3.20.0000.01416.68
7.3.10.0050.00816.59
7.3.00.0020.01316.55
7.2.250.0030.01915.27
7.2.240.0060.01215.22
7.2.230.0110.00614.96
7.2.220.0030.01314.69
7.2.210.0060.00614.94
7.2.200.0060.00614.89
7.2.190.0030.01215.18
7.2.180.0110.00715.02
7.2.170.0140.00315.23
7.2.130.0030.00817.14
7.2.120.0000.01416.79
7.2.110.0040.01117.03
7.2.100.0000.01517.03
7.2.90.0030.01316.65
7.2.80.0040.01117.07
7.2.70.0000.01416.74
7.2.60.0060.00816.80
7.2.50.0090.00616.98
7.2.40.0100.00717.03
7.2.30.0030.01317.13
7.2.20.0070.00317.05
7.2.10.0080.00417.11
7.2.00.0030.01118.23
7.1.330.0030.01315.95
7.1.320.0060.00916.01
7.1.310.0070.01015.93
7.1.300.0040.01115.82
7.1.290.0060.00915.65
7.1.280.0040.01115.73
7.1.270.0030.00815.77
7.1.260.0000.00915.60
7.1.250.0000.01415.88
7.1.100.0100.00618.18
7.1.70.0120.00817.20
7.1.60.0240.00734.91
7.1.50.0150.01834.75
7.1.40.0240.01534.41
7.1.30.0300.00934.57
7.1.20.0270.01434.61
7.1.10.0160.00916.67
7.1.00.0090.00616.76
7.0.200.0080.01116.54
7.0.190.0030.01316.82
7.0.180.0060.01316.00
7.0.170.0090.01216.45
7.0.160.0030.01716.46
7.0.150.0080.01116.28
7.0.140.0050.01016.41
7.0.130.0060.01016.68
7.0.120.0030.01416.43
7.0.110.0120.00416.40
7.0.100.0070.01016.37
7.0.90.0060.00916.34
7.0.80.0040.01216.34
7.0.70.0120.01116.28
7.0.60.0070.01616.00
7.0.50.0050.01216.43
7.0.40.0030.01616.46
7.0.30.0050.01316.41
7.0.20.0110.00816.63
7.0.10.0110.00716.36
7.0.00.0000.01516.53

preferences:
34.91 ms | 400 KiB | 5 Q