3v4l.org

run code in 300+ PHP versions simultaneously
<?php $arr = [ "string text 123", "string text 100", "string text 555", ]; var_dump(array_reduce($arr, function(array $carry, string $value): array { $prefix = substr($value, 0, 12); $carry[$prefix][] = $value; return $carry; }, []));

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.0110.01118.43
8.3.50.0110.00416.29
8.3.40.0030.01218.79
8.3.30.0160.00018.71
8.3.20.0050.00318.57
8.3.10.0060.00323.53
8.3.00.0000.00721.85
8.2.180.0140.00718.29
8.2.170.0090.00622.96
8.2.160.0170.00319.32
8.2.150.0050.00324.18
8.2.140.0080.00024.66
8.2.130.0000.00721.18
8.2.120.0060.00326.35
8.2.110.0090.00020.49
8.2.100.0120.00017.97
8.2.90.0040.00418.03
8.2.80.0000.00817.97
8.2.70.0030.00617.93
8.2.60.0030.00618.09
8.2.50.0080.00018.10
8.2.40.0050.00319.50
8.2.30.0040.00420.54
8.2.20.0040.00418.06
8.2.10.0040.00418.18
8.2.00.0050.00319.48
8.1.280.0060.00925.92
8.1.270.0070.00723.99
8.1.260.0080.00026.35
8.1.250.0040.00428.09
8.1.240.0000.00921.03
8.1.230.0080.00321.03
8.1.220.0080.00017.88
8.1.210.0040.00418.86
8.1.200.0080.00017.35
8.1.190.0050.00317.36
8.1.180.0040.00418.10
8.1.170.0060.00318.50
8.1.160.0040.00418.81
8.1.150.0080.00018.76
8.1.140.0040.00418.87
8.1.130.0030.00320.28
8.1.120.0050.00517.43
8.1.110.0000.00717.46
8.1.100.0040.00417.36
8.1.90.0000.00717.45
8.1.80.0040.00417.47
8.1.70.0040.00417.39
8.1.60.0040.00717.61
8.1.50.0050.00517.54
8.1.40.0030.01017.52
8.1.30.0040.00417.74
8.1.20.0000.00717.52
8.1.10.0000.00817.52
8.1.00.0000.00817.33
8.0.300.0000.00819.86
8.0.290.0030.00616.63
8.0.280.0050.00218.25
8.0.270.0070.00017.21
8.0.260.0030.00320.10
8.0.250.0000.00716.89
8.0.240.0000.00716.79
8.0.230.0000.00716.89
8.0.220.0070.00016.74
8.0.210.0030.00316.78
8.0.200.0000.00716.82
8.0.190.0050.00216.95
8.0.180.0040.00416.92
8.0.170.0040.00416.86
8.0.160.0050.00316.91
8.0.150.0040.00416.83
8.0.140.0070.00316.80
8.0.130.0030.00313.36
8.0.120.0050.00216.76
8.0.110.0080.00016.76
8.0.100.0000.00816.91
8.0.90.0070.00016.91
8.0.80.0080.01116.94
8.0.70.0040.00417.00
8.0.60.0040.00416.85
8.0.50.0030.00416.95
8.0.30.0090.00717.19
8.0.20.0130.00817.40
8.0.10.0070.00017.07
8.0.00.0090.01216.74
7.4.330.0000.00515.55
7.4.320.0030.00316.42
7.4.300.0000.00616.61
7.4.290.0060.00016.41
7.4.280.0000.00716.50
7.4.270.0030.00316.52
7.4.260.0030.00316.48
7.4.250.0040.00416.60
7.4.240.0000.00816.52
7.4.230.0020.00516.25
7.4.220.0030.00516.45
7.4.210.0100.00716.62
7.4.200.0000.00716.53
7.4.160.0090.00816.44
7.4.140.0100.01517.86
7.4.130.0030.01416.48
7.4.120.0130.01016.47
7.4.110.0060.00916.45
7.4.100.0140.00716.60
7.4.90.0110.00716.55
7.4.80.0120.00419.39
7.4.70.0030.01716.38
7.4.60.0070.01016.30
7.4.50.0040.01016.43
7.4.40.0160.00816.50
7.4.00.0030.01514.75
7.3.330.0020.00213.34
7.3.320.0000.00513.44
7.3.310.0040.00416.44
7.3.300.0000.00716.23
7.3.290.0000.00716.40
7.3.280.0050.01016.36
7.3.260.0110.01016.49
7.3.240.0080.01216.50
7.3.230.0060.01016.36
7.3.210.0090.00916.52
7.3.200.0110.01116.41
7.3.190.0150.00616.58
7.3.180.0190.00316.66
7.3.170.0080.00816.41
7.3.160.0080.01116.39
7.2.330.0140.00316.65
7.2.320.0000.01616.64
7.2.310.0060.01016.41
7.2.300.0150.00316.61
7.2.290.0100.01316.72
7.2.90.1530.01314.78
7.2.80.1340.00614.61
7.2.70.0550.00315.04
7.2.60.0410.01114.82
7.2.50.1360.00614.81
7.2.40.0340.00314.69
7.2.30.0710.00314.99
7.2.20.0810.01414.91
7.2.10.0370.00314.84
7.2.00.1840.00314.98
7.1.210.1100.00013.88
7.1.200.0120.00913.98
7.1.190.1860.01013.75
7.1.180.1610.01013.89
7.1.170.0170.00314.03
7.1.160.0270.00413.85
7.1.150.0110.00813.91
7.1.140.0300.00613.85
7.1.130.0130.01313.72
7.1.120.2400.00313.58
7.1.110.2360.01013.90
7.1.100.1770.01013.80
7.1.90.0330.00713.98
7.1.80.0160.00813.84
7.1.70.0380.00313.79
7.1.60.2230.00031.63
7.1.50.1980.01631.93
7.1.40.2390.00731.59
7.1.30.2220.01631.71
7.1.20.1300.00731.76
7.1.10.0660.00313.71
7.1.00.0120.00814.05

preferences:
78.93 ms | 400 KiB | 5 Q