3v4l.org

run code in 300+ PHP versions simultaneously
<?php function callApi($offset, $limit) { static $array = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12]; echo "called with $offset, $limit\n"; return json_encode([ 'results' => array_slice($array, $offset, $limit), 'next' => array_key_last($array) >= $offset + $limit ]); } $offset = 0; $limit = 5; $result = []; do { $response = json_decode(callApi($offset, $limit), true); array_push($result, ...$response['results']); $offset += $limit; } while (!empty($response['next'])); var_export($result);

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.5.30.0060.01119.57
8.5.20.0100.00920.27
8.5.10.0100.00816.71
8.5.00.0110.01019.84
8.4.180.0050.00425.65
8.4.170.0110.01122.07
8.4.160.0160.00623.88
8.4.150.0050.00716.94
8.4.140.0150.00817.73
8.4.130.0060.00519.05
8.4.120.0120.00824.20
8.4.110.0120.00922.46
8.4.100.0100.01218.49
8.4.90.0120.00918.70
8.4.80.0040.00520.46
8.4.70.0130.00517.91
8.4.60.0060.00318.72
8.4.50.0090.01118.66
8.4.40.0060.00317.82
8.4.30.0070.01118.93
8.4.20.0130.01019.55
8.4.10.0100.01019.38
8.3.300.0100.01020.52
8.3.290.0120.00820.28
8.3.280.0110.01118.41
8.3.270.0110.00816.72
8.3.260.0120.00816.50
8.3.250.0100.00819.03
8.3.240.0100.00716.98
8.3.230.0080.01016.50
8.3.220.0060.00220.71
8.3.210.0050.00516.66
8.3.200.0020.00716.75
8.3.190.0120.00719.13
8.3.180.0080.01017.26
8.3.170.0060.00919.02
8.3.160.0100.01016.96
8.3.150.0130.00617.08
8.3.140.0030.00516.59
8.3.130.0060.00316.43
8.3.120.0040.00420.75
8.3.110.0120.00620.94
8.3.100.0060.00316.62
8.3.90.0030.00526.77
8.3.80.0040.00418.43
8.3.70.0040.01418.31
8.3.60.0070.00718.24
8.3.50.0110.00416.44
8.3.40.0100.01321.61
8.3.30.0070.01418.96
8.3.20.0120.00921.94
8.3.10.0100.01022.02
8.3.00.0130.00919.09
8.2.300.0130.00918.69
8.2.290.0080.01020.46
8.2.280.0050.01118.79
8.2.270.0040.00417.35
8.2.260.0060.00318.20
8.2.250.0080.00016.51
8.2.240.0040.00417.04
8.2.230.0040.00422.58
8.2.220.0030.00624.06
8.2.210.0100.00026.77
8.2.200.0030.00616.50
8.2.190.0060.00916.63
8.2.180.0100.01016.63
8.2.170.0210.00019.14
8.2.160.0100.01020.15
8.2.150.0120.00619.28
8.2.140.0110.00721.90
8.2.130.0180.00022.16
8.2.120.0090.00920.95
8.2.110.0110.00720.93
8.2.100.0150.00621.07
8.2.90.0070.01120.36
8.2.80.0150.00619.45
8.2.70.0070.01518.71
8.2.60.0090.00918.85
8.2.50.0140.00419.12
8.2.40.0100.01018.71
8.2.30.0110.00718.71
8.2.20.0180.00018.70
8.2.10.0110.00718.66
8.2.00.0120.00618.68
8.1.340.0120.00817.78
8.1.330.0140.00422.14
8.1.320.0150.00516.08
8.1.310.0000.00818.31
8.1.300.0080.00018.59
8.1.290.0040.00430.84
8.1.280.0070.01125.92
8.1.270.0100.00722.04
8.1.260.0070.01122.01
8.1.250.0070.01022.16
8.1.240.0030.01618.62
8.1.230.0110.00718.70
8.1.220.0140.00719.00
8.1.210.0070.01118.56
8.1.200.0120.00618.78
8.1.190.0110.01118.79
8.1.180.0160.00618.55
8.1.170.0110.00718.73
8.1.160.0090.00918.45
8.1.150.0140.00418.72
8.1.140.0030.01418.79
8.1.130.0110.01118.64
8.1.120.0130.01018.63
8.1.110.0100.01018.41
8.1.100.0110.00719.73
8.1.90.0090.00618.55
8.1.80.0140.00419.82
8.1.70.0120.00318.79
8.1.60.0140.00718.75
8.1.50.0060.01218.67
8.1.40.0040.01418.68
8.1.30.0090.00619.00
8.1.20.0110.00419.88
8.1.10.0150.00318.79
8.1.00.0140.00418.66

preferences:
79.14 ms | 1006 KiB | 5 Q