3v4l.org

run code in 300+ PHP versions simultaneously
<?php $select = [ 'foo', 'bar', [ 'size' => 128, 'type' => 'png' ], 'baz', 'qux' ]; function convert($in) { if (!isset($in[0])) { return $in; } $out = []; for ($i = 0, $m = count($in); $i < $m; $i++) { $current = $in[$i]; $next = $in[$i + 1] ?? null; if (!is_string($current)) { throw new \Exception('Malformed field list.'); } if (is_array($next)) { $out[$current] = $next; $i++; } else { $out[$current] = true; } } return $out; } var_dump(convert($select));

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.60.0180.00416.63
8.3.50.0070.00717.92
8.3.40.0130.00318.76
8.3.30.0110.00418.89
8.3.20.0000.00820.38
8.3.10.0080.00022.09
8.3.00.0040.00423.66
8.2.180.0110.00718.17
8.2.170.0090.00622.96
8.2.160.0000.01419.49
8.2.150.0000.00824.18
8.2.140.0050.00324.66
8.2.130.0080.00026.16
8.2.120.0040.00419.95
8.2.110.0040.00420.32
8.2.100.0120.00017.89
8.2.90.0050.00519.35
8.2.80.0000.00817.97
8.2.70.0000.00817.63
8.2.60.0080.00017.93
8.2.50.0000.00818.16
8.2.40.0070.00020.55
8.2.30.0040.00419.32
8.2.20.0040.00418.20
8.2.10.0040.00418.01
8.2.00.0030.00518.18
8.1.280.0070.01425.92
8.1.270.0040.00423.91
8.1.260.0030.00526.35
8.1.250.0050.00328.09
8.1.240.0030.00623.95
8.1.230.0070.00320.42
8.1.220.0060.00317.74
8.1.210.0060.00318.77
8.1.200.0060.00317.35
8.1.190.0040.00417.35
8.1.180.0040.00418.10
8.1.170.0040.00418.50
8.1.160.0040.00418.80
8.1.150.0080.00020.07
8.1.140.0050.00219.59
8.1.130.0030.00318.90
8.1.120.0000.00817.52
8.1.110.0000.00717.40
8.1.100.0040.00417.43
8.1.90.0050.00217.37
8.1.80.0040.00417.46
8.1.70.0000.00717.36
8.1.60.0080.00017.61
8.1.50.0040.00417.43
8.1.40.0000.00917.53
8.1.30.0050.00217.54
8.1.20.0030.00617.70
8.1.10.0070.00017.54
8.1.00.0000.00817.40
8.0.300.0060.00318.77
8.0.290.0040.00416.63
8.0.280.0040.00418.38
8.0.270.0000.00717.18
8.0.260.0030.00318.81
8.0.250.0040.00316.90
8.0.240.0100.00016.86
8.0.230.0030.00316.90
8.0.220.0000.00716.93
8.0.210.0000.00716.79
8.0.200.0060.00016.98
8.0.190.0080.00016.82
8.0.180.0060.00316.93
8.0.170.0000.00816.86
8.0.160.0070.00016.95
8.0.150.0030.00316.70
8.0.140.0040.00416.81
8.0.130.0000.00713.32
8.0.120.0040.00416.98
8.0.110.0000.00716.89
8.0.100.0040.00416.92
8.0.90.0000.00716.84
8.0.80.0100.01316.82
8.0.70.0070.00016.82
8.0.60.0000.00816.72
8.0.50.0070.00016.70
8.0.30.0110.00717.03
8.0.20.0110.01217.40
8.0.10.0040.00416.88
8.0.00.0090.00916.59
7.4.330.0000.00515.55
7.4.320.0000.00616.61
7.4.300.0030.00316.41
7.4.290.0100.00016.42
7.4.280.0060.00316.63
7.4.270.0000.00716.52
7.4.260.0000.00716.57
7.4.250.0030.00716.48
7.4.240.0050.00316.51
7.4.230.0030.00316.68
7.4.220.0030.01516.54
7.4.210.0100.01016.39
7.4.200.0040.00416.51
7.4.160.0110.00716.44
7.4.150.0140.00317.40
7.4.140.0100.01117.86
7.4.130.0120.00616.66
7.4.120.0100.00716.48
7.4.110.0070.01116.41
7.4.100.0090.00816.65
7.4.90.0140.00716.53
7.4.80.0120.00619.39
7.4.70.0070.01016.70
7.4.60.0130.00716.58
7.4.50.0120.00316.46
7.4.40.0100.01316.43
7.4.30.0040.01316.64
7.4.00.0120.00415.18
7.3.330.0050.00013.39
7.3.320.0060.00013.25
7.3.310.0040.00316.38
7.3.300.0030.00316.33
7.3.290.0110.00416.39
7.3.280.0090.00816.36
7.3.270.0090.00917.40
7.3.260.0050.01216.47
7.3.250.0130.00516.40
7.3.240.0050.01116.47
7.3.230.0150.00316.61
7.3.210.0030.01416.50
7.3.200.0030.01316.52
7.3.190.0080.00816.66
7.3.180.0150.00616.51
7.3.170.0100.01116.37
7.3.160.0120.00416.40
7.2.330.0090.00916.71
7.2.320.0120.01216.71
7.2.310.0140.00416.52
7.2.300.0110.01116.72
7.2.290.0080.00816.73
7.2.60.0070.00716.66
7.1.200.0050.00715.58
7.1.90.0120.00618.30
7.1.80.0060.00617.96
7.1.70.0070.01117.34
7.1.60.0160.00935.20
7.1.50.0190.00634.93
7.1.40.0160.01034.37
7.1.30.0100.01734.51
7.1.20.0120.01834.46
7.1.10.0000.01516.67
7.1.00.0030.01216.79
7.0.230.0000.01317.91
7.0.220.0030.01017.82
7.0.210.0070.01016.57
7.0.200.0000.01316.80
7.0.190.0090.00316.91
7.0.180.0060.01016.20
7.0.170.0040.01316.19
7.0.160.0070.00716.18
7.0.150.0000.01416.20
7.0.140.0030.01016.27
7.0.130.0030.01016.57
7.0.120.0050.00816.29
7.0.110.0040.01316.29
7.0.100.0050.00816.23
7.0.90.0070.00716.34
7.0.80.0030.01116.55
7.0.70.0060.00616.21
7.0.60.0060.00716.06
7.0.50.0060.00616.31
7.0.40.0040.00816.47
7.0.30.0060.00616.40
7.0.20.0030.01016.31
7.0.10.0080.00416.62
7.0.00.0030.00916.31

preferences:
60.73 ms | 400 KiB | 5 Q