3v4l.org

run code in 300+ PHP versions simultaneously
<?php $strings = [ "1,2,3,4", "1,2,3", "1,2" ]; $minElements = 3; $defaultVal = null; foreach ($strings as $string) { [$a, $b, $c] = array_pad(explode(',', $string, $minElements), $minElements, $defaultVal); var_export($a); echo ' _ '; var_export($b); echo ' _ '; var_export($c); echo "\n-----------------\n"; }

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.00.0120.01019.80
8.4.150.0000.00114.05
8.4.140.0100.01117.57
8.4.130.0120.00917.75
8.4.120.0120.00822.45
8.4.110.0130.00718.77
8.4.100.0110.01018.67
8.4.90.0120.00818.90
8.4.80.0090.00917.65
8.4.70.0060.01017.75
8.4.60.0090.00820.44
8.4.50.0070.00818.01
8.4.40.0190.00017.47
8.4.30.0100.01018.84
8.4.20.0130.01319.59
8.4.10.0100.00619.22
8.3.280.0090.01118.35
8.3.270.0150.00516.23
8.3.260.0110.00516.40
8.3.250.0130.00618.94
8.3.240.0120.00616.50
8.3.230.0100.01016.27
8.3.220.0100.00818.96
8.3.210.0130.00516.73
8.3.200.0050.00417.20
8.3.190.0110.00917.41
8.3.180.0060.00216.70
8.3.170.0160.00316.48
8.3.160.0040.00416.63
8.3.150.0140.00417.13
8.3.140.0160.00318.91
8.3.130.0060.00318.48
8.3.120.0140.00518.84
8.3.110.0000.01320.94
8.3.100.0080.00016.62
8.3.90.0360.01826.77
8.3.80.0380.01026.77
8.3.70.0200.00326.77
8.3.60.0130.01026.77
8.3.50.0260.01326.77
8.3.40.0330.01026.77
8.3.30.0300.00726.77
8.3.20.0320.00626.77
8.3.10.0280.01126.77
8.3.00.0330.00626.77
8.2.290.0110.00720.46
8.2.280.0050.00318.54
8.2.270.0040.01218.97
8.2.260.0070.01116.41
8.2.250.0050.00318.37
8.2.240.0000.01519.14
8.2.230.0030.00622.58
8.2.220.0110.00424.06
8.2.210.0380.00026.77
8.2.200.0300.01026.77
8.2.190.0330.00926.77
8.2.180.0310.00926.77
8.2.170.0330.01526.77
8.2.160.0310.00726.77
8.2.150.0330.01326.77
8.2.140.0520.00426.77
8.2.130.0400.00426.77
8.2.120.0340.00926.77
8.2.110.0330.01126.77
8.2.100.0340.00726.77
8.2.90.0420.00026.77
8.2.80.0270.01526.77
8.2.70.0300.01226.77
8.2.60.0330.00826.77
8.2.50.0340.00326.77
8.2.40.0330.01126.77
8.2.30.0360.00626.77
8.2.20.0370.00626.77
8.2.10.0360.00726.77
8.2.00.0320.01426.77
8.1.330.0100.01021.95
8.1.320.0120.00618.02
8.1.310.0040.00418.40
8.1.300.0080.00017.82
8.1.290.0380.00426.77
8.1.280.0350.00726.77
8.1.270.0320.01126.77
8.1.260.0360.00726.77
8.1.250.0390.00426.77
8.1.240.0350.00726.77
8.1.230.0290.01326.77
8.1.220.0310.01026.77
8.1.210.0320.00826.77
8.1.200.0340.00326.77
8.1.190.0230.00826.77
8.1.180.0360.00326.77
8.1.170.0330.00626.77
8.1.160.0400.00326.77
8.1.150.0300.00926.77
8.1.140.0260.01126.77
8.1.130.0310.00626.77
8.1.120.0350.00326.77
8.1.110.0230.01426.77
8.1.100.0290.00826.77
8.1.90.0350.00326.77
8.1.80.0340.00426.77
8.1.70.0260.00426.77
8.1.60.0410.00326.77
8.1.50.0370.00326.77
8.1.40.0350.00626.77
8.1.30.0350.00626.77
8.1.20.0340.01126.77
8.1.10.0420.01526.77
8.1.00.0390.00426.77

preferences:
36.91 ms | 403 KiB | 5 Q