3v4l.org

run code in 300+ PHP versions simultaneously
<?php $arr = array( "action: Added; amount: 1; code: RNA1; name: Mens Organic T-shirt; colour: White; size: XL", "action: Subtracted; amount: 7; code: RNC1; name: Kids Basic T-shirt; colour: Denim Blue; size: 3-4y", "action: Added; amount: 20; code: RNV1; name: Gift Voucher; style: Mens; value: £20"); foreach ($arr as $string) { //Build array preg_match_all("/ [ ]?([^:]+): ([^;]+)[ ;]? /x", $string, $p); $array = array_combine($p[1], $p[2]); //Print it or do something else with it print_r($array); }

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.130.0040.01216.80
8.3.120.0090.00020.54
8.3.110.0060.00620.94
8.3.100.0030.01624.06
8.3.90.0140.00426.77
8.3.80.0060.00318.56
8.3.70.0070.01016.58
8.3.60.0140.00716.75
8.3.50.0120.00823.65
8.3.40.0130.00621.09
8.3.30.0070.01418.70
8.3.20.0040.00424.18
8.3.10.0030.00524.66
8.3.00.0080.00026.16
8.2.250.0060.00316.96
8.2.240.0060.00317.20
8.2.230.0130.00022.58
8.2.220.0030.00637.54
8.2.210.0040.00426.77
8.2.200.0140.00016.75
8.2.190.0060.00916.75
8.2.180.0180.00325.92
8.2.170.0040.01219.22
8.2.160.0170.00322.96
8.2.150.0070.00725.66
8.2.140.0080.00024.66
8.2.130.0040.00426.16
8.2.120.0050.00321.25
8.2.110.0030.00622.41
8.2.100.0080.00318.16
8.2.90.0000.00917.97
8.2.80.0040.00717.97
8.2.70.0030.00617.75
8.2.60.0000.00918.16
8.2.50.0050.00318.07
8.2.40.0050.00318.35
8.2.30.0030.00618.24
8.2.20.0070.00018.20
8.2.10.0040.00419.37
8.2.00.0040.00419.43
8.1.300.0060.00318.60
8.1.290.0030.00730.84
8.1.280.0110.00725.92
8.1.270.0040.00423.99
8.1.260.0120.00326.35
8.1.250.0040.00428.09
8.1.240.0040.00423.70
8.1.230.0080.00420.99
8.1.220.0060.00317.74
8.1.210.0050.00318.98
8.1.200.0030.00617.47
8.1.190.0000.00817.35
8.1.180.0030.00519.30
8.1.170.0060.00318.62
8.1.160.0000.00718.96
8.1.150.0000.00718.96
8.1.140.0030.00618.98
8.1.130.0030.00317.66
8.1.120.0050.00317.61
8.1.110.0000.00917.50
8.1.100.0080.00017.67
8.1.90.0060.00317.54
8.1.80.0050.00617.53
8.1.70.0080.00017.58
8.1.60.0080.00017.72
8.1.50.0030.00617.50
8.1.40.0040.00417.56
8.1.30.0070.00317.77
8.1.20.0040.00417.84
8.1.10.0000.00817.64
8.1.00.0040.00417.68
8.0.300.0050.00220.08
8.0.290.0060.00316.75
8.0.280.0070.00018.45
8.0.270.0040.00218.16
8.0.260.0000.00716.88
8.0.250.0000.00717.10
8.0.240.0000.00917.06
8.0.230.0000.00717.13
8.0.220.0040.00416.97
8.0.210.0030.00317.02
8.0.200.0060.00317.00
8.0.190.0040.00417.10
8.0.180.0000.00816.96
8.0.170.0000.00816.98
8.0.160.0000.00717.00
8.0.150.0000.00717.07
8.0.140.0000.00716.82
8.0.130.0000.00613.46
8.0.120.0040.00417.04
8.0.110.0030.00516.90
8.0.100.0000.00816.95
8.0.90.0040.00416.98
8.0.80.0090.00917.01
8.0.70.0050.00317.12
8.0.60.0000.00817.14
8.0.50.0040.00417.13
8.0.30.0040.02017.34
8.0.20.0120.00817.29
8.0.10.0000.00717.23
8.0.00.0130.00916.85
7.4.330.0000.00515.55
7.4.320.0000.00616.84
7.4.300.0000.00816.78
7.4.290.0020.00516.78
7.4.280.0040.00416.85
7.4.270.0000.00716.85
7.4.260.0000.00613.57
7.4.250.0030.00316.74
7.4.240.0030.00616.77
7.4.230.0030.00316.98
7.4.220.0080.00016.96
7.4.210.0070.01016.86
7.4.200.0030.00416.62
7.4.130.0080.00916.76
7.4.120.0060.01216.98
7.4.110.0120.00616.87
7.4.100.0110.00716.67
7.4.90.0030.01416.65
7.4.80.0150.00516.70
7.4.70.0030.01516.92
7.4.60.0090.00916.45
7.4.50.0120.00616.66
7.4.40.0120.00816.61
7.4.30.0100.01016.68
7.4.20.0100.01516.52
7.4.10.0130.00616.75
7.4.00.0100.00916.69
7.3.330.0000.00816.56
7.3.320.0040.00413.34
7.3.310.0000.00716.31
7.3.300.0070.00016.46
7.3.290.0000.00716.42
7.3.280.0030.01216.40
7.3.260.0110.01216.44
7.3.230.0140.00316.66
7.3.220.0120.00616.55
7.3.210.0100.00716.55
7.3.200.0130.00316.58
7.3.190.0070.01116.68
7.3.180.0100.00716.47
7.3.170.0100.01016.79
7.3.160.0040.01816.71
7.3.150.0030.01516.40
7.3.140.0160.00416.61
7.3.130.0120.00616.67
7.3.120.0060.01216.38
7.3.110.0110.00716.65
7.3.100.0060.01616.47
7.3.90.0120.00616.57
7.3.80.0120.00916.54
7.3.70.0110.00816.64
7.3.60.0100.01016.50
7.3.50.0090.01416.72
7.3.40.0090.00916.56
7.3.30.0070.01016.48
7.3.20.0170.00516.66
7.3.10.0060.01316.55
7.3.00.0110.00716.56
7.2.330.0110.00716.80
7.2.320.0100.01016.92
7.2.310.0160.00316.85
7.2.300.0150.00416.77
7.2.290.0160.00316.77
7.2.280.0130.01016.58
7.2.270.0130.00716.70
7.2.260.0130.00516.84
7.2.250.0120.00616.87
7.2.240.0130.00716.59
7.2.230.0100.00816.67
7.2.220.0060.01516.84
7.2.210.0110.00716.66
7.2.200.0180.00016.71
7.2.190.0150.00716.90
7.2.180.0110.01116.73
7.2.170.0090.00916.73
7.2.160.0090.01516.82
7.2.150.0090.01116.73
7.2.140.0110.00616.77
7.2.130.0060.01316.71
7.2.120.0060.01216.91
7.2.110.0180.00316.84
7.2.100.0060.01316.80
7.2.90.0030.01616.75
7.2.80.0090.01116.69
7.2.70.0100.01016.99
7.2.60.0100.01016.93
7.2.50.0100.01416.78
7.2.40.0060.01416.64
7.2.30.0080.01216.82
7.2.20.0120.00916.79
7.2.10.0060.01616.80
7.2.00.0060.01316.70

preferences:
26.76 ms | 403 KiB | 5 Q