3v4l.org

run code in 300+ PHP versions simultaneously
<?php $str = <<< END 2x egg 2 - carrot cabbage 1x potato END; $lines = explode("\n", $str); $ingredients = Array(); foreach($lines as $line) { $matches = Array(); if(!preg_match("/^(\d+)(\S+)$/", $line, $matches)) array_push($ingredients, Array(1, $line)); else array_push($ingredients, Array(intval($matches[1]), $matches[2])); } var_dump($ingredients);

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.0070.00718.43
8.3.50.0120.00618.32
8.3.40.0110.01118.92
8.3.30.0080.00619.04
8.3.20.0070.00020.22
8.3.10.0000.00821.90
8.3.00.0070.00318.94
8.2.180.0090.00616.50
8.2.170.0080.00622.96
8.2.160.0060.00822.17
8.2.150.0040.00424.18
8.2.140.0040.00424.66
8.2.130.0040.00426.16
8.2.120.0040.00420.08
8.2.110.0030.00622.35
8.2.100.0040.00817.88
8.2.90.0050.00319.17
8.2.80.0030.00517.97
8.2.70.0040.00417.75
8.2.60.0000.00818.05
8.2.50.0080.00018.07
8.2.40.0060.00320.20
8.2.30.0040.00418.00
8.2.20.0000.00817.72
8.2.10.0080.00018.23
8.2.00.0040.00417.89
8.1.280.0040.01125.92
8.1.270.0040.00420.78
8.1.260.0040.00426.35
8.1.250.0080.00028.09
8.1.240.0060.00323.97
8.1.230.0040.00719.10
8.1.220.0050.00317.78
8.1.210.0000.00818.77
8.1.200.0030.00617.34
8.1.190.0050.00317.35
8.1.180.0000.00918.10
8.1.170.0060.00320.50
8.1.160.0050.00222.03
8.1.150.0030.00618.99
8.1.140.0040.00417.50
8.1.130.0000.00717.83
8.1.120.0070.00017.52
8.1.110.0040.00417.52
8.1.100.0000.00817.62
8.1.90.0080.00017.54
8.1.80.0070.00017.52
8.1.70.0080.00017.59
8.1.60.0080.00017.75
8.1.50.0000.00817.63
8.1.40.0040.00417.68
8.1.30.0030.00517.75
8.1.20.0030.00517.80
8.1.10.0000.00817.65
8.1.00.0050.00317.68
8.0.300.0040.00418.77
8.0.290.0050.00217.00
8.0.280.0070.00018.53
8.0.270.0030.00317.34
8.0.260.0030.00317.19
8.0.250.0000.00717.20
8.0.240.0050.00317.21
8.0.230.0000.00717.07
8.0.220.0020.00517.01
8.0.210.0000.00817.09
8.0.200.0030.00317.04
8.0.190.0040.00417.19
8.0.180.0000.00817.04
8.0.170.0040.00417.11
8.0.160.0040.00417.11
8.0.150.0040.00417.07
8.0.140.0000.00716.98
8.0.130.0050.00013.54
8.0.120.0080.00016.96
8.0.110.0020.00517.13
8.0.100.0000.00717.15
8.0.90.0000.00716.99
8.0.80.0100.01017.11
8.0.70.0000.00817.05
8.0.60.0040.00417.18
8.0.50.0000.00817.06
8.0.30.0100.01017.24
8.0.20.0080.01417.40
8.0.10.0070.00017.25
8.0.00.0040.01316.95
7.4.330.0000.00515.11
7.4.320.0000.00716.71
7.4.300.0030.00316.71
7.4.290.0000.00816.82
7.4.280.0000.00816.82
7.4.270.0070.00016.58
7.4.260.0000.00716.68
7.4.250.0070.00016.69
7.4.240.0030.00516.77
7.4.230.0040.00316.70
7.4.220.0060.01216.74
7.4.210.0100.00816.78
7.4.200.0000.00716.92
7.4.160.0110.01116.88
7.4.150.0090.00917.40
7.4.140.0110.00817.86
7.4.130.0140.00316.75
7.4.120.0070.01316.72
7.4.110.0070.01116.61
7.4.100.0110.00616.80
7.4.90.0100.00716.73
7.4.80.0160.00616.81
7.4.70.0100.01016.75
7.4.60.0060.01216.65
7.4.50.0000.00816.74
7.4.40.0170.00816.81
7.4.30.0130.00616.76
7.4.00.0060.01015.13
7.3.330.0000.00613.21
7.3.320.0140.00013.47
7.3.310.0040.00416.36
7.3.300.0000.00716.46
7.3.290.0030.00616.39
7.3.280.0080.00916.47
7.3.270.0100.00917.40
7.3.260.0150.00816.77
7.3.250.0090.01016.75
7.3.240.0120.01216.55
7.3.230.0060.01516.82
7.3.210.0060.01216.70
7.3.200.0160.00619.39
7.3.190.0100.00716.71
7.3.180.0060.01016.93
7.3.170.0160.00616.86
7.3.160.0030.01416.81
7.2.330.0110.01016.81
7.2.320.0030.01416.70
7.2.310.0120.00916.80
7.2.300.0030.01816.99
7.2.290.0070.01016.98
7.2.60.0140.00316.70
7.2.00.0050.01419.78
7.1.200.0170.00615.30
7.1.100.0000.01218.07
7.1.70.0040.00417.16
7.1.60.0030.01419.46
7.1.50.0030.02117.11
7.1.00.0070.07322.45
7.0.200.0030.01015.31
7.0.140.0030.05022.18
7.0.60.0030.07719.94
7.0.50.0170.07717.86
7.0.40.0100.07019.92
7.0.30.0430.08020.19
7.0.20.0270.08720.20
7.0.10.0030.07020.01
7.0.00.0070.08020.02
5.6.280.0100.06720.82
5.6.210.0100.07720.73
5.6.200.0130.08018.12
5.6.190.0030.05020.58
5.6.180.0400.07320.39
5.6.170.0330.06720.38
5.6.160.0070.04020.48
5.6.150.0030.04718.22
5.6.140.0070.08318.17
5.6.130.0130.04318.15
5.6.120.0070.04721.00
5.6.110.0130.08020.98
5.6.100.0170.07721.10
5.6.90.0100.08020.99
5.6.80.0000.05320.37
5.5.350.0300.07720.41
5.5.340.0170.07317.98
5.5.330.0000.06320.29
5.5.320.0070.05020.34
5.5.310.0030.05020.30
5.5.300.0030.06017.91
5.5.290.0130.08017.98
5.5.280.0100.04720.79
5.5.270.0070.04020.72
5.5.260.0130.08020.61
5.5.250.0070.05720.54
5.5.240.0170.07020.25
5.4.450.0470.06019.13
5.4.440.0830.06319.32
5.4.430.0630.05719.52
5.4.420.0670.05719.62
5.4.410.0130.05319.11
5.4.400.0870.05318.95
5.4.390.0230.05718.65
5.4.380.0130.06718.73
5.4.370.0200.07318.50
5.4.360.0230.06018.54
5.4.350.0170.06318.68
5.4.340.0130.06318.66
5.4.320.0230.05318.72
5.4.310.0230.06018.59
5.4.300.0270.05018.56
5.4.290.0370.04018.68
5.4.280.0270.05018.68
5.4.270.0230.05718.64
5.4.260.0230.05718.73
5.4.250.0230.05318.61
5.4.240.0230.05318.77
5.4.230.0200.05018.57
5.4.220.0330.04318.71
5.4.210.0270.04718.72
5.4.200.0230.05716.66
5.4.190.0230.05018.65
5.4.180.0230.05018.57
5.4.170.0170.06018.67
5.4.160.0300.04318.72
5.4.150.0200.05718.63
5.4.140.0200.05316.21
5.4.130.0200.05316.10
5.4.120.0230.04716.20
5.4.110.0200.05016.19
5.4.100.0230.04716.20
5.4.90.0370.05716.26
5.4.80.0170.05316.29
5.4.70.0200.05316.10
5.4.60.0300.04316.10
5.4.50.0200.07016.23
5.4.40.0330.04716.16
5.4.30.0330.03716.05
5.4.20.0130.05716.01
5.4.10.0270.04316.13
5.4.00.0230.04715.71
5.3.290.0300.04714.64
5.3.280.0200.05314.62
5.3.270.0130.06314.67
5.3.260.0370.04314.68
5.3.250.0270.04714.54
5.3.240.0200.05714.53
5.3.230.0270.04714.64
5.3.220.0270.04714.58
5.3.210.0200.05714.56
5.3.200.0200.05314.51
5.3.190.0170.05714.53
5.3.180.0330.04014.54
5.3.170.0270.05314.47
5.3.160.0300.04314.56
5.3.150.0200.05014.63
5.3.140.0170.05314.46
5.3.130.0230.05314.60
5.3.120.0200.06314.54
5.3.110.0230.06014.59
5.3.100.0330.05314.11
5.3.90.0370.03714.07
5.3.80.0200.06013.97
5.3.70.0170.05713.93
5.3.60.0270.04713.93
5.3.50.0330.04713.88
5.3.40.0270.04713.86
5.3.30.0200.05013.90
5.3.20.0230.05013.66
5.3.10.0230.05313.58
5.3.00.0200.05313.60
5.2.170.0100.05011.05
5.2.160.0200.04011.09
5.2.150.0230.03711.20
5.2.140.0270.03311.28
5.2.130.0170.04311.07
5.2.120.0130.04711.05
5.2.110.0200.04011.23
5.2.100.0200.04011.09
5.2.90.0130.04711.05
5.2.80.0170.05011.06
5.2.70.0200.04311.13
5.2.60.0270.04011.09
5.2.50.0130.04711.08
5.2.40.0170.03710.97
5.2.30.0130.04010.91
5.2.20.0130.04010.97
5.2.10.0130.05710.94
5.2.00.0200.03710.75
5.1.60.0230.02710.12
5.1.50.0170.03010.01
5.1.40.0170.03310.05
5.1.30.0130.03710.43
5.1.20.0200.03010.41
5.1.10.0100.03710.09
5.1.00.0130.03310.15
5.0.50.0100.0278.69
5.0.40.0100.0238.45
5.0.30.0070.0438.25
5.0.20.0070.0308.40
5.0.10.0030.0338.31
5.0.00.0100.0408.30
4.4.90.0070.0205.91
4.4.80.0000.0335.91
4.4.70.0100.0235.93
4.4.60.0030.0235.84
4.4.50.0070.0235.92
4.4.40.0000.0375.88
4.4.30.0070.0205.94
4.4.20.0000.0275.96
4.4.10.0030.0235.93
4.4.00.0030.0335.87
4.3.110.0070.0235.82
4.3.100.0070.0205.82
4.3.90.0070.0235.79
4.3.80.0070.0375.77
4.3.70.0130.0135.83
4.3.60.0100.0235.81
4.3.50.0130.0175.83
4.3.40.0070.0335.76
4.3.30.0070.0204.58
4.3.20.0100.0174.61
4.3.10.0030.0234.55
4.3.00.0200.02014.42

preferences:
47.71 ms | 400 KiB | 5 Q