3v4l.org

run code in 300+ PHP versions simultaneously
<?php $strings = [ "1,2,3,4", "1,2,3", "1,2" ]; $minElements = 3; $defElements = array_fill(0, $minElements, null); foreach ($strings as $string) { [$a, $b, $c] = array_replace($defElements, explode(',', $string, $minElements)); 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.4.140.0140.00617.71
8.4.130.0170.00317.64
8.4.120.0110.00920.64
8.4.110.0060.00318.70
8.4.100.0120.00917.88
8.4.90.0110.00917.66
8.4.80.0140.00617.85
8.4.70.0030.00518.01
8.4.60.0130.00718.92
8.4.50.0140.00718.76
8.4.40.0130.00720.51
8.4.30.0100.00920.53
8.4.20.0100.01019.72
8.4.10.0060.01319.61
8.3.270.0100.00916.44
8.3.260.0110.00816.36
8.3.250.0070.00218.83
8.3.240.0120.00716.54
8.3.230.0140.00516.80
8.3.220.0140.00516.48
8.3.210.0100.00716.67
8.3.200.0050.00416.73
8.3.190.0150.00516.96
8.3.180.0110.00918.78
8.3.170.0090.00918.91
8.3.160.0090.00916.70
8.3.150.0160.00018.83
8.3.140.0150.00016.33
8.3.130.0030.00618.31
8.3.120.0060.00320.59
8.3.110.0030.00620.94
8.3.100.0030.00624.06
8.3.90.0070.01126.77
8.3.80.0060.00318.43
8.3.70.0170.00316.75
8.3.60.0100.00718.31
8.3.50.0050.00723.67
8.3.40.0120.00618.73
8.3.30.0030.01018.79
8.3.20.0070.00021.73
8.3.10.0040.00420.18
8.3.00.0080.00020.57
8.2.290.0110.00918.89
8.2.280.0060.00418.37
8.2.270.0140.00418.30
8.2.260.0000.00720.52
8.2.250.0000.01416.41
8.2.240.0100.01018.81
8.2.230.0080.00022.58
8.2.220.0070.00437.54
8.2.210.0100.00726.77
8.2.200.0060.00616.50
8.2.190.0070.00716.75
8.2.180.0070.01018.54
8.2.170.0110.00719.13
8.2.160.0100.00322.96
8.2.150.0050.00325.66
8.2.140.0090.00024.66
8.2.130.0000.00826.16
8.2.120.0040.00419.89
8.2.110.0000.00919.38
8.2.100.0080.00418.03
8.2.90.0040.00418.16
8.2.80.0080.00019.11
8.2.70.0080.00017.75
8.2.60.0040.00418.03
8.2.50.0060.00318.07
8.2.40.0000.00818.29
8.2.30.0050.00318.03
8.2.20.0000.00718.02
8.2.10.0040.00419.36
8.2.00.0040.00419.33
8.1.330.0130.00616.61
8.1.320.0130.00616.25
8.1.310.0120.00618.39
8.1.300.0090.00620.30
8.1.290.0100.00030.84
8.1.280.0110.00425.92
8.1.270.0060.00320.78
8.1.260.0030.00626.35
8.1.250.0040.00428.09
8.1.240.0090.00022.14
8.1.230.0080.00320.90
8.1.220.0040.00417.78
8.1.210.0080.00018.84
8.1.200.0080.00017.35
8.1.190.0040.00817.23
8.1.180.0000.00818.10
8.1.170.0100.00418.68
8.1.160.0030.00618.91
8.1.150.0000.00718.97
8.1.140.0070.00022.03
8.1.130.0070.00020.16
8.1.120.0070.00317.50
8.1.110.0040.00417.45
8.1.100.0020.00517.37
8.1.90.0060.00317.35
8.1.80.0000.00717.38
8.1.70.0030.00317.46
8.1.60.0040.00717.64
8.1.50.0030.00517.58
8.1.40.0050.00317.39
8.1.30.0000.00817.67
8.1.20.0030.00617.66
8.1.10.0000.00717.59
8.1.00.0000.00817.57
8.0.300.0040.00420.07
8.0.290.0040.00416.75
8.0.280.0000.00718.53
8.0.270.0040.00417.94
8.0.260.0040.00420.03
8.0.250.0060.00016.98
8.0.240.0070.00016.98
8.0.230.0030.00316.93
8.0.220.0040.00416.92
8.0.210.0000.00716.80
8.0.200.0000.00616.99
8.0.190.0040.00416.89
8.0.180.0040.00416.91
8.0.170.0040.00416.94
8.0.160.0040.00416.93
8.0.150.0040.00416.85
8.0.140.0030.00316.93
8.0.130.0030.00313.27
8.0.120.0040.00416.87
8.0.110.0040.00416.89
8.0.100.0040.00416.71
8.0.90.0030.00616.87
8.0.80.0030.01216.89
8.0.70.0070.00016.88
8.0.60.0080.00016.87
8.0.50.0050.00216.98
8.0.30.0070.01317.00
8.0.20.0170.00916.82
8.0.10.0080.00017.01
8.0.00.0040.01416.74
7.4.330.0060.00015.55
7.4.320.0000.00816.43
7.4.300.0060.00016.48
7.4.290.0070.00016.55
7.4.280.0040.00416.61
7.4.270.0000.00716.63
7.4.260.0000.00613.25
7.4.250.0070.00016.48
7.4.240.0040.00416.47
7.4.230.0030.00316.60
7.4.220.0020.00516.47
7.4.210.0130.00716.68
7.4.200.0040.00416.50
7.4.130.0160.00816.40
7.4.120.0160.00316.75
7.4.110.0120.00616.39
7.4.100.0100.00716.57
7.4.90.0130.00916.43
7.4.80.0110.00619.39
7.4.70.0000.01616.30
7.4.60.0090.00616.34
7.4.50.0040.01416.41
7.4.40.0100.00716.52
7.4.00.0090.00614.61
7.3.330.0050.00216.17
7.3.320.0050.00013.27
7.3.310.0030.00316.32
7.3.300.0000.00716.37
7.3.290.0090.00616.36
7.3.280.0100.01016.33
7.3.260.0080.00916.61
7.3.230.0110.00616.56
7.3.210.0150.00416.59
7.3.200.0000.01716.34
7.3.190.0030.01416.46
7.3.180.0030.01316.52
7.3.170.0130.01016.50
7.3.160.0120.00616.37
7.3.120.0080.00514.60
7.3.110.0100.00314.86
7.3.100.0070.00714.74
7.3.90.0130.00314.88
7.3.80.0080.00814.76
7.3.70.0080.00914.68
7.3.60.0100.00514.57
7.3.50.0060.00614.78
7.3.40.0060.01214.82
7.3.30.0040.01214.39
7.3.20.0080.00916.76
7.3.10.0100.01016.59
7.3.00.0060.00816.62
7.2.330.0040.01316.81
7.2.320.0030.01316.49
7.2.310.0060.01016.71
7.2.300.0090.01216.78
7.2.290.0070.01016.70
7.2.250.0080.00614.92
7.2.240.0060.01614.50
7.2.230.0110.00415.13
7.2.220.0100.00515.17
7.2.210.0100.00715.15
7.2.200.0060.00915.02
7.2.190.0130.00714.98
7.2.180.0110.01115.16
7.2.170.0110.00615.20
7.1.330.0030.01013.72
7.1.320.0150.00013.95
7.1.310.0030.01213.77
7.1.300.0070.00713.96
7.1.290.0180.00515.75
7.1.280.0190.00613.98
7.1.270.0130.00313.80
7.1.260.0050.00815.61

preferences:
31.22 ms | 403 KiB | 5 Q