3v4l.org

run code in 300+ PHP versions simultaneously
<?php $s = '{"1": "apple", "2": "banana", "3": "orange"}'; $jsonData = json_decode($s, true); $i = 1; $pairs = []; for($i = 1; $i < count($jsonData); ++$i) { $pair = [$jsonData[$i], $jsonData[$i + 1]]; $pairs[] = $pair; } print_r($pairs);

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.4.120.0120.00817.52
8.4.110.0110.01019.48
8.4.100.0130.00817.61
8.4.90.0090.01020.46
8.4.80.0120.00518.82
8.4.70.0090.00818.91
8.4.60.0050.00418.91
8.4.50.0120.00817.68
8.4.40.0160.00317.45
8.4.30.0100.01020.28
8.4.20.0030.00617.62
8.4.10.0040.00419.34
8.3.250.0090.01016.55
8.3.240.0130.00616.68
8.3.230.0150.00416.42
8.3.220.0070.01118.95
8.3.210.0120.00618.29
8.3.200.0050.00416.59
8.3.190.0090.00916.76
8.3.180.0050.00418.34
8.3.170.0040.00416.73
8.3.160.0090.00917.45
8.3.150.0160.00317.25
8.3.140.0040.00816.75
8.3.130.0080.00016.32
8.3.120.0060.00320.54
8.3.110.0060.00320.94
8.3.100.0060.00324.06
8.3.90.0040.00426.77
8.3.80.0060.00319.36
8.3.70.0090.00916.75
8.3.60.0150.00016.50
8.3.50.0160.00323.60
8.3.40.0100.01022.02
8.3.30.0090.01218.73
8.3.20.0050.00224.18
8.3.10.0050.00224.66
8.3.00.0050.00326.16
8.2.290.0060.01016.63
8.2.280.0100.01018.45
8.2.270.0140.00416.65
8.2.260.0040.00418.24
8.2.250.0040.00416.52
8.2.240.0040.01117.15
8.2.230.0080.00022.58
8.2.220.0100.00037.54
8.2.210.0030.00526.77
8.2.200.0070.00318.88
8.2.190.0100.00718.32
8.2.180.0070.01425.92
8.2.170.0090.00918.76
8.2.160.0070.00722.96
8.2.150.0080.00025.66
8.2.140.0060.00324.66
8.2.130.0000.00726.16
8.2.120.0000.00821.04
8.2.110.0030.00620.56
8.2.100.0080.00317.72
8.2.90.0040.00420.52
8.2.80.0040.00420.58
8.2.70.0000.00817.50
8.2.60.0070.00417.93
8.2.50.0030.00619.35
8.2.40.0000.00918.25
8.2.30.0040.00418.19
8.2.20.0040.00418.12
8.2.10.0030.00519.38
8.2.00.0000.00719.26
8.1.330.0130.00616.17
8.1.320.0100.00817.81
8.1.310.0000.00816.87
8.1.300.0060.00316.13
8.1.290.0000.00930.84
8.1.280.0000.01625.92
8.1.270.0040.00423.99
8.1.260.0000.00826.35
8.1.250.0070.00028.09
8.1.240.0110.00022.20
8.1.230.0070.00420.88
8.1.220.0080.00017.79
8.1.210.0000.00818.89
8.1.200.0030.00617.34
8.1.190.0030.00617.25
8.1.180.0000.00818.10
8.1.170.0080.00018.54
8.1.160.0040.00418.80
8.1.150.0040.00418.83
8.1.140.0080.00018.96
8.1.130.0000.00720.26
8.1.120.0000.00817.47
8.1.110.0000.00817.36
8.1.100.0030.00617.42
8.1.90.0000.00817.45
8.1.80.0000.00917.52
8.1.70.0080.00017.36
8.1.60.0040.00417.58
8.1.50.0040.00417.52
8.1.40.0040.00417.55
8.1.30.0060.00317.54
8.1.20.0000.00817.57
8.1.10.0000.00817.54
8.1.00.0060.00317.39
8.0.300.0050.00320.00
8.0.290.0000.00816.75
8.0.280.0030.00318.36
8.0.270.0000.00717.88
8.0.260.0060.00020.23
8.0.250.0030.00316.87
8.0.240.0040.00416.85
8.0.230.0000.00716.97
8.0.220.0030.00316.83
8.0.210.0030.00516.95
8.0.200.0030.00316.97
8.0.190.0000.00716.94
8.0.180.0050.00316.91
8.0.170.0050.00316.89
8.0.160.0040.00416.91
8.0.150.0050.00316.86
8.0.140.0000.00816.84
8.0.130.0030.00313.31
8.0.120.0070.00016.74
8.0.110.0040.00416.86
8.0.100.0040.00416.86
8.0.90.0040.00416.75
8.0.80.0090.00516.85
8.0.70.0000.00716.88
8.0.60.0020.00516.82
8.0.50.0040.00316.79
8.0.30.0000.01917.03
8.0.20.0090.00916.95
8.0.10.0030.00517.02
8.0.00.0190.00316.85
7.4.330.0030.00315.55
7.4.320.0060.00016.59
7.4.300.0000.00616.43
7.4.290.0080.00016.49
7.4.280.0050.00316.42
7.4.270.0030.00316.47
7.4.260.0030.00313.18
7.4.250.0040.00416.34
7.4.240.0030.00316.41
7.4.230.0030.00316.59
7.4.220.0020.00516.51
7.4.210.0090.00716.64
7.4.200.0000.00716.63
7.4.130.0140.00616.55
7.4.120.0100.01316.58
7.4.110.0070.01316.38
7.4.100.0120.01216.58
7.4.90.0130.01016.42
7.4.80.0060.01916.52
7.4.70.0080.01616.67
7.4.60.0250.00016.32
7.4.50.0030.01716.27
7.4.40.0130.01016.57
7.4.30.0050.01616.64
7.4.20.0060.01316.20
7.4.10.0170.00716.58
7.4.00.0130.01316.21
7.3.330.0060.00316.18
7.3.320.0000.00613.01
7.3.310.0040.00416.22
7.3.300.0000.00616.13
7.3.290.0100.00616.26
7.3.260.0070.01016.21
7.3.240.0060.01516.34
7.3.230.0200.00416.45
7.3.220.0120.01616.51
7.3.210.0170.00716.20
7.3.200.0090.01216.43
7.3.190.0070.01816.31
7.3.180.0170.00716.49
7.3.170.0120.01216.31
7.3.160.0160.00616.48
7.3.150.0070.01816.42
7.3.140.0130.01016.45
7.3.130.0110.01116.47
7.3.120.0070.01116.52
7.3.110.0160.00816.40
7.3.100.0140.00916.52
7.3.90.0130.00616.63
7.3.80.0150.00416.49
7.3.70.0090.00916.52
7.3.60.0070.01116.34
7.3.50.0140.01116.33
7.3.40.0110.01416.33
7.3.30.0100.01316.41
7.3.20.0110.01316.43
7.3.10.0140.01316.37
7.3.00.0120.00816.30
7.2.340.0140.01416.52
7.2.330.0200.00616.64
7.2.320.0160.01016.22
7.2.310.0210.00316.70
7.2.300.0100.01016.66
7.2.290.0000.02016.69
7.2.280.0050.01916.65
7.2.270.0060.01516.75
7.2.260.0100.01516.51
7.2.250.0120.00816.79
7.2.240.0100.01016.72
7.2.230.0150.01116.54
7.2.220.0090.01216.71
7.2.210.0060.01516.56
7.2.200.0140.00716.50
7.2.190.0140.01316.73
7.2.180.0240.00016.37
7.2.170.0210.00316.66
7.2.160.0100.01316.67
7.2.150.0170.00716.73
7.2.140.0060.01716.61
7.2.130.0180.00916.63
7.2.120.0200.01616.71
7.2.110.0130.01316.60
7.2.100.0190.00816.49
7.2.90.0100.01316.51
7.2.80.0150.00616.70
7.2.70.0030.02016.61
7.2.60.0120.00916.59
7.2.50.0110.01116.65
7.2.40.0160.00916.68
7.2.30.0100.01016.72
7.2.20.0140.00716.62
7.2.10.0090.01216.51
7.2.00.0090.01216.70

preferences:
27.95 ms | 403 KiB | 5 Q