3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array = Array ( '0' => Array ( 'created_at' => 1991, 'updated_at' => 1992, 'customer_name' => 'john doe', 'line_items' => Array ( '0' => Array ( 'name' => 'Hello world poduct', 'price' => 800.00, 'id' => 123, 'quantity' => 2 ), '1' => Array ( 'name' => 'Hello world product 2', 'price' => 100.00, 'id' => 456, 'quantity' => 1 ) ) ), '1' => Array ( 'created_at' => 1992, 'updated_at' => 1993, 'customer_name' => 'Guido van Rossum', 'line_items' => Array ( '0' => Array ( 'name' => 'Hello world product', 'price' => 800.00, 'id' => 123, 'quantity' => 2 ), '1' => Array ( 'name' => 'Hello world poduct 2', 'price' => 100.00, 'id' => 456, 'quantity' => 3 ), '2' => Array ( 'name' => 'Hello world poduct 3', 'price' => 400.00, 'id' => 116, 'quantity' => 5 ) ) ) ); $result = []; foreach ($array as ['line_items' => $items]) { foreach ($items as ['quantity' => $result[]]); } var_export($result);

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.0090.01319.96
8.4.150.0010.00114.05
8.4.140.0120.00917.51
8.4.130.0080.00718.00
8.4.120.0140.00722.32
8.4.110.0130.00718.98
8.4.100.0130.00817.59
8.4.90.0120.00917.93
8.4.80.0140.00619.70
8.4.70.0040.00417.91
8.4.60.0090.01419.01
8.4.50.0110.00919.34
8.4.40.0070.01017.75
8.4.30.0130.00718.68
8.4.20.0120.00619.44
8.4.10.0060.00319.46
8.3.280.0140.00718.42
8.3.270.0130.00616.74
8.3.260.0100.01016.74
8.3.250.0080.00618.91
8.3.240.0060.00216.75
8.3.230.0140.00616.86
8.3.220.0110.00718.63
8.3.210.0100.00816.59
8.3.200.0050.00716.75
8.3.190.0050.00417.13
8.3.180.0090.00918.40
8.3.170.0120.00616.71
8.3.160.0130.00317.20
8.3.150.0110.00717.38
8.3.140.0090.00917.11
8.3.130.0030.01218.40
8.3.120.0120.00818.79
8.3.110.0000.01920.94
8.3.100.0050.00316.79
8.3.90.0330.01326.77
8.3.80.0410.01026.77
8.3.70.0680.00026.77
8.3.60.0480.00626.77
8.3.50.0390.00926.77
8.3.40.0420.00026.77
8.3.30.0250.00726.77
8.3.20.0280.00026.77
8.3.10.0330.00726.77
8.3.00.0130.01326.77
8.2.290.0080.01118.89
8.2.280.0100.00918.32
8.2.270.0070.01117.36
8.2.260.0110.00416.66
8.2.250.0030.00516.63
8.2.240.0160.00319.04
8.2.230.0050.00522.58
8.2.220.0060.00324.06
8.2.210.0210.00426.77
8.2.200.0190.00426.77
8.2.190.0120.00826.77
8.2.180.0160.00326.77
8.2.170.0180.00426.77
8.2.160.0150.00526.77
8.2.150.0160.00526.77
8.2.140.0220.00026.77
8.2.130.0180.00326.77
8.2.120.0150.00626.77
8.2.110.0230.00026.77
8.2.100.0310.00426.77
8.2.90.0350.01026.77
8.2.80.0280.00926.77
8.2.70.0320.00626.77
8.2.60.0140.00626.77
8.2.50.0260.00726.77
8.2.40.0310.00326.77
8.2.30.0230.01026.77
8.2.20.0400.00426.77
8.2.10.0490.00726.77
8.2.00.0350.00626.77
8.1.330.0100.00816.70
8.1.320.0090.00916.20
8.1.310.0090.00618.05
8.1.300.0160.00319.43
8.1.290.0370.00626.77
8.1.280.0350.00626.77
8.1.270.0390.00326.77
8.1.260.0360.00326.77
8.1.250.0340.01026.77
8.1.240.0280.01426.77
8.1.230.0420.00826.77
8.1.220.0390.00326.77
8.1.210.0200.00326.77
8.1.200.0160.00626.77
8.1.190.0140.00426.77
8.1.180.0140.00426.77
8.1.170.0230.01626.77
8.1.160.0270.01226.77
8.1.150.0310.00726.77
8.1.140.0350.00426.77
8.1.130.0230.01226.77
8.1.120.0280.00926.77
8.1.110.0420.00326.77
8.1.100.0110.01126.77
8.1.90.0170.00626.77
8.1.80.0250.00726.77
8.1.70.0250.00726.77
8.1.60.0310.00726.77
8.1.50.0350.00026.77
8.1.40.0190.00926.77
8.1.30.0260.00026.77
8.1.20.0160.00826.77
8.1.10.0180.00526.77
8.1.00.0210.00326.77

preferences:
28.54 ms | 403 KiB | 5 Q