3v4l.org

run code in 500+ PHP versions simultaneously
<?php $arrayA = [ ["sentence" => "Hello world", "nextSpeaker" => 0], ["sentence" => "Hello world again", "nextSpeaker" => 1], ["sentence" => "Hello world twice!", "nextSpeaker" => 1], ]; $arrayB = [ ["sentence" => "Bye world", "nextSpeaker" => 1], ["sentence" => "Bye world again", "nextSpeaker" => 0], ["sentence" => "Bye world twice", "nextSpeaker" => 0], ]; $arrays = [$arrayA, $arrayB]; $pullFrom = 0; $result = []; while ($arrays[0] && $arrays[1]) { $result[] = $row = array_shift($arrays[$pullFrom]); $pullFrom = $row['nextSpeaker'] ? 1 - $pullFrom : $pullFrom; } var_export(array_merge($result, ...$arrays));

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.70.0040.00416.68
8.5.60.0110.00716.92
8.5.50.0100.00716.64
8.5.30.0040.00417.41
8.5.20.0130.00819.69
8.5.10.0070.00920.16
8.5.00.0110.00921.86
8.4.210.0060.00421.44
8.4.180.0160.00619.68
8.4.170.0120.01024.02
8.4.160.0100.01323.00
8.4.150.0060.00616.89
8.4.140.0140.00817.85
8.4.130.0130.00817.72
8.4.120.0150.00524.14
8.4.110.0090.00822.45
8.4.100.0040.00518.76
8.4.90.0120.00818.92
8.4.80.0110.00617.77
8.4.70.0070.00517.89
8.4.60.0140.00618.81
8.4.50.0070.00219.29
8.4.40.0130.00717.53
8.4.30.0040.00420.67
8.4.20.0030.01717.87
8.4.10.0030.00722.06
8.3.300.0100.01118.57
8.3.290.0100.01020.84
8.3.280.0130.00818.64
8.3.270.0110.00816.88
8.3.260.0050.00316.56
8.3.250.0040.00418.95
8.3.240.0110.00816.93
8.3.230.0130.00616.61
8.3.220.0060.00917.11
8.3.210.0040.00518.58
8.3.200.0020.00716.85
8.3.190.0080.00816.48
8.3.180.0150.00616.83
8.3.170.0070.01116.77
8.3.160.0030.01616.55
8.3.150.0080.01217.07
8.3.140.0060.01216.42
8.3.130.0000.00818.28
8.3.120.0050.00520.65
8.3.110.0000.00820.94
8.3.100.0060.00318.42
8.3.90.0000.00826.77
8.3.80.0030.00916.50
8.3.70.0040.01116.58
8.3.60.0070.00716.38
8.3.50.0090.00620.10
8.3.40.0070.01020.28
8.3.30.0120.00418.74
8.3.20.0030.00624.18
8.3.10.0040.00424.66
8.3.00.0050.00326.16
8.2.300.0140.01018.01
8.2.290.0110.00720.32
8.2.280.0110.01018.39
8.2.270.0100.01016.70
8.2.260.0040.00418.80
8.2.250.0070.00718.63
8.2.240.0070.01118.91
8.2.230.0040.00422.58
8.2.220.0040.00424.06
8.2.210.0080.00026.77
8.2.200.0000.01018.41
8.2.190.0110.01116.58
8.2.180.0070.00725.92
8.2.170.0150.00018.99
8.2.160.0090.00622.96
8.2.150.0080.00025.66
8.2.140.0050.00224.66
8.2.130.0050.00326.16
8.2.120.0080.00021.18
8.2.110.0110.00721.97
8.2.100.0100.00317.75
8.2.90.0050.00317.75
8.2.80.0000.00818.91
8.2.70.0000.00817.63
8.2.60.0000.00817.63
8.2.50.0060.00318.05
8.2.40.0060.00318.34
8.2.30.0080.00018.15
8.2.20.0040.00419.28
8.2.10.0040.00418.20
8.2.00.0030.00519.33
8.1.340.0100.01017.74
8.1.330.0100.00822.07
8.1.320.0100.00918.09
8.1.310.0090.00616.89
8.1.300.0000.00917.97
8.1.290.0060.00330.84
8.1.280.0070.00725.92
8.1.270.0070.00024.66
8.1.260.0070.01126.35
8.1.250.0040.00428.09
8.1.240.0000.00919.01
8.1.230.0060.00617.95
8.1.220.0030.00618.74
8.1.210.0060.00318.77
8.1.200.0000.00817.35
8.1.190.0040.00417.25
8.1.180.0060.00318.10
8.1.170.0040.00417.62
8.1.160.0000.00819.07
8.1.150.0000.00718.59
8.1.140.0040.00417.52
8.1.130.0070.00018.91
8.1.120.0000.00717.48
8.1.110.0070.00017.46
8.1.100.0070.00017.38
8.1.90.0100.00317.36
8.1.80.0000.01517.43
8.1.70.0160.00017.46
8.1.60.0080.01017.51
8.1.50.0140.00417.40
8.1.40.0130.00517.56
8.1.30.0140.00517.61
8.1.20.0170.00017.66
8.1.10.0070.01117.57
8.1.00.0140.00517.56
8.0.300.0040.00418.85
8.0.290.0040.00417.16
8.0.280.0000.00718.32
8.0.270.0070.00316.82
8.0.260.0030.00318.41
8.0.250.0030.00316.89
8.0.240.0000.00716.96
8.0.230.0070.00316.98
8.0.220.0160.00016.83
8.0.210.0120.00316.93
8.0.200.0110.00416.97
8.0.190.0110.00316.95
8.0.180.0070.00716.76
8.0.170.0070.00716.89
8.0.160.0060.00916.86
8.0.150.0100.00516.64
8.0.140.0000.01416.71
8.0.130.0040.01216.88
8.0.120.0080.00816.73
8.0.110.0120.00316.93
8.0.100.0130.00316.79
8.0.90.0100.00616.72
8.0.80.0110.00417.01
8.0.70.0080.00416.90
8.0.60.0110.00416.72
8.0.50.0110.00416.84
8.0.30.0110.00416.86
8.0.20.0190.00016.86
8.0.10.0040.00916.89
7.4.330.0050.00015.55
7.4.320.0000.00716.45
7.4.300.0110.00016.57
7.4.290.0100.00516.38
7.4.280.0140.00016.46
7.4.270.0080.00816.52
7.4.260.0110.00416.50
7.4.250.0120.00016.65
7.4.240.0100.00516.52
7.4.230.0130.00016.48
7.4.220.0090.00616.45
7.4.210.0130.00316.43
7.4.200.0150.00016.50
7.4.190.0150.00016.48
7.4.180.0090.00516.50
7.4.160.0150.00016.61
7.4.150.0110.00416.51
7.4.140.0100.00316.45
7.4.130.0130.00216.48
7.4.120.0070.00816.55
7.4.110.0110.00416.38
7.4.100.0040.01216.53
7.4.90.0140.00016.36
7.4.80.0080.00816.36
7.4.70.0150.00016.57
7.4.60.0110.00416.46
7.4.50.0000.01416.41
7.4.40.0150.00016.25
7.4.30.0090.00516.42
7.4.20.0120.00316.31
7.4.10.0090.00516.59
7.4.00.0140.00016.50

preferences:
91.76 ms | 1358 KiB | 5 Q