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.4.140.0100.01417.91
8.4.130.0060.00517.96
8.4.120.0080.01122.26
8.4.110.0140.00918.86
8.4.100.0130.00618.02
8.4.90.0110.00620.84
8.4.80.0080.00218.86
8.4.70.0120.00821.00
8.4.60.0140.00618.97
8.4.50.0110.00917.81
8.4.40.0030.01220.49
8.4.30.0070.01419.09
8.4.20.0030.01624.18
8.4.10.0090.00421.12
8.3.270.0100.01216.66
8.3.260.0130.00716.67
8.3.250.0110.00418.81
8.3.240.0130.00616.87
8.3.230.0090.00917.14
8.3.220.0090.00918.76
8.3.210.0070.00118.53
8.3.200.0120.00716.84
8.3.190.0060.00319.00
8.3.180.0090.01016.76
8.3.170.0090.00919.18
8.3.160.0030.01618.78
8.3.150.0000.00817.13
8.3.140.0090.00916.92
8.3.130.0030.00616.61
8.3.120.0000.00920.84
8.3.110.0060.00320.94
8.3.100.0130.00716.74
8.3.90.0070.01426.77
8.3.80.0060.00316.70
8.3.70.0090.00616.63
8.3.60.0080.01118.68
8.3.50.0120.00523.79
8.3.40.0110.00722.14
8.3.30.0110.00318.79
8.3.20.0000.00724.18
8.3.10.0040.00424.66
8.3.00.0040.00426.16
8.2.290.0120.00816.77
8.2.280.0060.01118.69
8.2.270.0110.00717.07
8.2.260.0110.00418.89
8.2.250.0000.00918.72
8.2.240.0060.00317.29
8.2.230.0060.00322.58
8.2.220.0000.00824.06
8.2.210.0120.00826.77
8.2.200.0040.00816.88
8.2.190.0090.00616.63
8.2.180.0120.00325.92
8.2.170.0130.00719.21
8.2.160.0040.01122.96
8.2.150.0040.00425.66
8.2.140.0070.00324.66
8.2.130.0030.00626.16
8.2.120.0080.00020.07
8.2.110.0030.00622.24
8.2.100.0060.00618.16
8.2.90.0040.00418.16
8.2.80.0000.00919.08
8.2.70.0120.00148.54
8.2.60.0100.00448.74
8.2.50.0060.00748.69
8.2.40.0080.00448.84
8.2.30.0080.00648.77
8.2.20.0110.00248.76
8.2.10.0110.00149.39
8.2.00.0030.00849.36
8.1.330.0110.00916.12
8.1.320.0120.00717.88
8.1.310.0060.00316.72
8.1.300.0040.00418.63
8.1.290.0030.00630.84
8.1.280.0140.00725.92
8.1.270.0040.00423.99
8.1.260.0080.00026.35
8.1.250.0080.00028.09
8.1.240.0040.00421.94
8.1.230.0040.00720.80
8.1.220.0050.00317.91
8.1.210.0040.00418.77
8.1.200.0100.00348.40
8.1.190.0090.00448.40
8.1.180.0050.00748.71
8.1.170.0060.00649.04
8.1.160.0080.00449.19
8.1.150.0070.00749.15
8.1.140.0060.00649.11
8.1.130.0070.00549.75
8.1.120.0070.00548.48
8.1.110.0100.00248.41
8.1.100.0080.00438.13
8.1.90.0060.00538.13
8.1.80.0070.00538.18
8.1.70.0090.00238.16
8.1.60.0070.00438.21
8.1.50.0080.00438.18
8.1.40.0040.00738.17
8.1.30.0080.00538.24
8.1.20.0070.00538.29
8.1.10.0040.00838.23
8.1.00.0070.00438.16
8.0.300.0080.00020.05
8.0.290.0070.00648.10
8.0.280.0070.00449.77
8.0.270.0060.00648.76
8.0.260.0090.00448.93
8.0.250.0050.00648.17
8.0.240.0050.00848.21
8.0.230.0090.00337.79
8.0.220.0050.00637.75
8.0.210.0040.00637.75
8.0.200.0060.00537.85
8.0.190.0040.00737.82
8.0.180.0050.00637.81
8.0.170.0080.00337.78
8.0.160.0100.00137.77
8.0.150.0050.00637.68
8.0.140.0090.00137.73
8.0.130.0080.00536.48
8.0.120.0070.00637.71
8.0.110.0090.00437.55
8.0.100.0060.00737.78
8.0.90.0060.00637.75
8.0.80.0110.00532.49
8.0.70.0060.00837.70
8.0.60.0070.00637.77
8.0.50.0070.00737.65
8.0.30.0150.00237.74
8.0.20.0100.00632.71
8.0.10.0040.00837.83
8.0.00.0090.00737.89
7.4.330.0080.00047.44
7.4.320.0070.00648.02
7.4.300.0040.00637.68
7.4.290.0070.00537.60
7.4.280.0070.00637.60
7.4.270.0090.00437.47
7.4.260.0090.00436.42
7.4.250.0090.00437.59
7.4.240.0080.00637.58
7.4.230.0080.00537.52
7.4.220.0060.00532.38
7.4.210.0070.00829.20
7.4.200.0080.00437.59
7.4.190.0120.00347.81
7.4.180.0080.00747.77
7.4.160.0090.00647.95
7.4.150.0080.00747.87
7.4.140.0130.00247.70
7.4.130.0120.00632.25
7.4.120.0100.00829.13
7.4.110.0120.00829.12
7.4.100.0180.01029.22
7.4.90.0140.00529.11
7.4.80.0140.00929.13
7.4.70.0150.00729.09
7.4.60.0130.00829.08
7.4.50.0120.00729.06
7.4.40.0150.00529.05
7.4.30.0120.01429.03
7.4.20.0150.00829.07
7.4.10.0150.00629.17
7.4.00.0100.00729.04
7.3.330.0080.00537.38
7.3.320.0040.00836.34
7.3.310.0100.00437.40
7.3.300.0100.00237.44
7.3.290.0080.00437.43
7.3.280.0120.00537.38
7.3.270.0120.00247.89
7.3.260.0090.00837.50
7.3.250.0090.00647.85
7.3.240.0110.00832.13
7.3.230.0180.00428.99
7.3.220.0170.00528.99
7.3.210.0170.00329.11
7.3.200.0150.00729.13
7.3.190.0120.00929.03
7.3.180.0160.00628.98
7.3.170.0130.00829.03
7.3.160.0110.01129.03
7.3.150.0180.00629.01
7.3.140.0140.00629.11
7.3.130.0140.00729.08
7.3.120.0140.00729.14
7.3.110.0140.00729.00
7.3.100.0110.00929.02
7.3.90.0130.00629.10
7.3.80.0140.00529.07
7.3.70.0130.00729.00
7.3.60.0120.00829.09
7.3.50.0140.00629.04
7.3.40.0140.00829.16
7.3.30.0120.00829.10
7.3.20.0160.00829.13
7.3.10.0490.00529.06
7.3.00.0160.00729.08
7.2.340.0150.00532.38
7.2.330.0140.00729.18
7.2.320.0130.00829.24
7.2.310.0110.01029.17
7.2.300.0110.00929.15
7.2.290.0160.00929.23
7.2.280.0150.01029.21
7.2.270.0180.00929.27
7.2.260.0130.00729.31
7.2.250.0190.00629.23
7.2.240.0120.00929.30
7.2.230.0120.01029.26
7.2.220.0150.00529.18
7.2.210.0130.00729.13
7.2.200.0150.00729.26
7.2.190.0150.00629.23
7.2.180.0160.00629.27
7.2.170.0090.01129.23
7.2.160.0160.00729.14
7.2.150.0180.00629.23
7.2.140.0150.00629.26
7.2.130.0660.00729.28
7.2.120.0140.00929.29
7.2.110.0120.00929.29
7.2.100.0130.00829.28
7.2.90.0150.00629.30
7.2.80.0120.00829.25
7.2.70.0110.01229.17
7.2.60.0140.00929.25
7.2.50.0160.00529.23
7.2.40.0150.00629.24
7.2.30.0170.00429.29
7.2.20.0140.00829.27
7.2.10.0210.00729.24
7.2.00.0200.00729.16

preferences:
36.8 ms | 403 KiB | 5 Q