3v4l.org

run code in 300+ PHP versions simultaneously
<?php $items = [ "3000mAh battery", "charges 1 smartphone", "input: 5W (5V, 1A) micro USB port", "output: Micro USB cable: 7.5W (5V, 1.5A)", "recharge time 3-4 hours", "includes Micro USB cable", // "1-Year Limited Warranty", "Lifetime test Warranty test2" ]; $result = []; foreach ($items as $item) { $res = explode(':', $item); if (count($res) > 1) { $key = $res[0]; array_shift($res); $result[$key] = implode(':', $res); continue; } if (is_numeric($item[0])) { $parts = (explode(' ', $item)); $key = array_pop($parts); $result[$key] = implode(' ', $parts); continue; } if (ctype_alpha($item[0])) { $parts = explode(' ', $item); $warranty = array_filter($parts, function ($x) { return strtolower($x) === 'warranty'; }); if (count($warranty) > 0) { $wkey = key($warranty); unset($parts[$wkey]); $result[reset($warranty)] = implode(' ', $parts); continue; } $key = array_shift($parts); $result[$key] = implode(' ', $parts); } } print_r($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.10.0090.00916.81
8.5.00.0140.00720.26
8.4.150.0020.00014.05
8.4.140.0140.00817.81
8.4.130.0120.00618.71
8.4.120.0060.00624.08
8.4.110.0110.00918.77
8.4.100.0120.00818.63
8.4.90.0080.00320.73
8.4.80.0120.01020.31
8.4.70.0150.00819.79
8.4.60.0070.00419.00
8.4.50.0080.01118.46
8.4.40.0080.01519.23
8.4.30.0030.00619.44
8.4.20.0080.00418.92
8.4.10.0160.00318.95
8.3.280.0110.01018.54
8.3.270.0100.00916.39
8.3.260.0160.00316.88
8.3.250.0100.00718.91
8.3.240.0120.00717.43
8.3.230.0120.00616.73
8.3.220.0130.00518.82
8.3.210.0030.00418.46
8.3.200.0030.00616.66
8.3.190.0080.00817.08
8.3.180.0110.00817.02
8.3.170.0110.00719.15
8.3.160.0150.00316.67
8.3.150.0060.01516.39
8.3.140.0120.00617.32
8.3.130.0000.01116.50
8.3.120.0060.00318.78
8.3.110.0080.00020.94
8.3.100.0040.00424.06
8.3.90.0090.00026.77
8.3.80.0040.00417.97
8.3.70.0110.00716.50
8.3.60.0150.00618.30
8.3.50.0130.00517.44
8.3.40.0070.01118.79
8.3.30.0040.01118.63
8.3.20.0000.00821.04
8.3.10.0080.00021.74
8.3.00.0040.00421.85
8.2.290.0090.00920.10
8.2.280.0040.00419.98
8.2.270.0080.01116.68
8.2.260.0070.01016.80
8.2.250.0040.00418.63
8.2.240.0070.01117.24
8.2.230.0090.00022.58
8.2.220.0080.00037.54
8.2.210.0030.00526.77
8.2.200.0040.00418.29
8.2.190.0140.00718.33
8.2.180.0040.01118.18
8.2.170.0070.01522.96
8.2.160.0030.01020.35
8.2.150.0000.00924.18
8.2.140.0050.00324.66
8.2.130.0080.00020.22
8.2.120.0050.00326.35
8.2.110.0060.00319.27
8.2.100.0000.01117.97
8.2.90.0040.00417.63
8.2.80.0080.00017.97
8.2.70.0040.00418.05
8.2.60.0000.00818.16
8.2.50.0000.00818.10
8.2.40.0080.00021.15
8.2.30.0000.00719.23
8.2.20.0050.00218.18
8.2.10.0040.00418.16
8.2.00.0050.00319.41
8.1.330.0090.00822.31
8.1.320.0110.00817.03
8.1.310.0040.01416.07
8.1.300.0040.00420.05
8.1.290.0000.00830.84
8.1.280.0120.00625.92
8.1.270.0050.00322.64
8.1.260.0090.00026.35
8.1.250.0040.00428.09
8.1.240.0040.00817.48
8.1.230.0080.00417.83
8.1.220.0090.00017.77
8.1.210.0040.00418.77
8.1.200.0060.00317.22
8.1.190.0080.00017.23
8.1.180.0040.00418.10
8.1.170.0030.00518.50
8.1.160.0070.00018.94
8.1.150.0050.00218.87
8.1.140.0040.00422.16
8.1.130.0040.00421.88
8.1.120.0040.00417.49
8.1.110.0020.00517.37
8.1.100.0090.00017.46
8.1.90.0040.00417.37
8.1.80.0000.00817.47
8.1.70.0000.00717.51
8.1.60.0000.00817.50
8.1.50.0070.00417.54
8.1.40.0030.00517.58
8.1.30.0080.00017.63
8.1.20.0040.00417.56
8.1.10.0000.00817.59
8.1.00.0030.00617.39
8.0.300.0030.00518.77
8.0.290.0030.00616.75
8.0.280.0000.00718.52
8.0.270.0070.00017.25
8.0.260.0030.00318.54
8.0.250.0040.00416.93
8.0.240.0040.00416.98
8.0.230.0030.00316.95
8.0.220.0030.00316.91
8.0.210.0030.00316.78
8.0.200.0030.00316.89
8.0.190.0050.00316.82
8.0.180.0030.00516.93
8.0.170.0050.00316.87
8.0.160.0040.00416.97
8.0.150.0000.00716.90
8.0.140.0030.00316.88
8.0.130.0000.00613.26
8.0.120.0000.00816.79
8.0.110.0040.00416.80
8.0.100.0030.00316.84
8.0.90.0070.00016.79
8.0.80.0080.01116.87
8.0.70.0050.00316.75
8.0.60.0000.00816.78
8.0.50.0050.00216.92
8.0.30.0070.01017.09
8.0.20.0140.01117.40
8.0.10.0000.00817.02
8.0.00.0080.00916.85
7.4.330.0000.00516.76
7.4.320.0000.00716.61
7.4.300.0030.00316.45
7.4.290.0030.00316.46
7.4.280.0030.00616.61
7.4.270.0000.00716.61
7.4.260.0000.00816.56
7.4.250.0070.00016.42
7.4.240.0000.00716.56
7.4.230.0000.00816.64
7.4.220.0040.00416.63
7.4.210.0080.00716.62
7.4.200.0050.00216.50
7.4.160.0090.00816.52
7.4.140.0120.01017.86
7.4.130.0130.00416.50
7.4.120.0080.01216.56
7.4.110.0150.00316.40
7.4.100.0150.00916.59
7.4.90.0060.01316.61
7.4.80.0060.00919.39
7.4.70.0090.01516.48
7.4.60.0050.01116.43
7.4.50.0100.00716.27
7.4.40.0090.01316.38
7.4.00.0100.00715.18
7.3.330.0050.00013.23
7.3.320.0000.00613.33
7.3.310.0000.00716.22
7.3.300.0030.00316.29
7.3.290.0030.00316.41
7.3.280.0120.00516.32
7.3.260.0100.00716.61
7.3.240.0140.00516.42
7.3.230.0150.00616.62
7.3.210.0030.01316.40
7.3.200.0140.00316.36
7.3.190.0060.01216.67
7.3.180.0030.01316.39
7.3.170.0170.00816.38
7.3.160.0080.01116.39
7.2.330.0150.00616.43
7.2.320.0070.01016.42
7.2.310.0030.01416.79
7.2.300.0070.01116.54
7.2.290.0100.00716.57
7.2.120.0450.01614.62
7.2.110.0290.00614.64
7.2.100.0530.00714.84
7.2.90.0410.00614.87
7.2.80.0350.01414.74
7.2.70.0490.01014.97
7.2.60.0480.01014.91
7.2.50.0630.00015.03
7.2.40.0420.01014.91
7.2.30.0600.00314.93
7.2.20.0360.01815.04
7.2.10.1290.01215.23
7.2.00.0520.01315.10
7.1.240.0520.01013.80
7.1.230.0310.00313.88
7.1.220.0250.00413.84
7.1.210.0500.00713.89
7.1.200.0240.01013.85
7.1.190.0440.00314.13
7.1.180.0550.00713.64
7.1.170.0370.00914.00
7.1.160.0340.00613.70
7.1.150.0550.01014.02
7.1.140.0630.00013.80
7.1.130.0510.00613.81
7.1.120.0610.00613.66
7.1.110.0560.01314.13
7.1.100.0630.00613.94
7.1.90.0710.01113.84
7.1.80.0660.01014.10
7.1.70.0680.00713.80
7.1.60.0600.01313.77
7.1.50.0670.01214.00
7.1.40.0670.01013.96
7.1.30.0600.01014.03
7.1.20.0650.00713.55
7.1.10.0660.00713.75
7.1.00.0490.01613.80
5.6.380.0070.01114.41

preferences:
34.97 ms | 403 KiB | 5 Q