3v4l.org

run code in 300+ PHP versions simultaneously
<?php // Array representing a possible record set returned from a database $records = array( array( 'id' => "bbb", 'first_name' => 'John', 'last_name' => 'Doe', ), array( 'id' => "aaa", 'first_name' => 'Sally', 'last_name' => array( 'id' => "zzz", 'first_name' => 'Sully', 'last_name' => 'Smith', ), ), array( 'id' => "yyy", 'first_name' => 'Jane', 'last_name' => 'Jones', ), array( 'id' => "xxx", 'first_name' => 'Peter', 'last_name' => 'Doe', ) ); /* function test_print($val, $key, &$third) { // var_export($val); // var_export($key); // var_export($third); // $third++; if($key == 'first_name'){ $third[] = $val; } else { print_r($key); } } $third = []; array_walk_recursive($records, 'test_print', $third); print_r($third);*/ foreach (new RecursiveIteratorIterator(new RecursiveArrayIterator($records), RecursiveIteratorIterator::CATCH_GET_CHILD) as $key => $value) { echo 'My node ' . $key . ' with value ' . $value . PHP_EOL; }

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.0040.01118.56
8.3.50.0110.00417.93
8.3.40.0070.00718.68
8.3.30.0040.01118.71
8.3.20.0080.00019.20
8.3.10.0030.00621.86
8.3.00.0000.00720.68
8.2.180.0120.00918.38
8.2.170.0000.01522.96
8.2.160.0170.00021.04
8.2.150.0000.00724.18
8.2.140.0060.00324.66
8.2.130.0080.00018.09
8.2.120.0050.00326.35
8.2.110.0050.00521.04
8.2.100.0040.00819.51
8.2.90.0030.00617.75
8.2.80.0050.00517.97
8.2.70.0060.00318.04
8.2.60.0040.00418.16
8.2.50.0080.00018.10
8.2.40.0080.00019.47
8.2.30.0000.00819.36
8.2.20.0000.00717.97
8.2.10.0040.00419.72
8.2.00.0000.00817.60
8.1.280.0060.00825.92
8.1.270.0030.00618.88
8.1.260.0080.00026.35
8.1.250.0040.00428.09
8.1.240.0060.00322.10
8.1.230.0040.00819.53
8.1.220.0050.00317.76
8.1.210.0080.00018.77
8.1.200.0100.00017.36
8.1.190.0030.00617.23
8.1.180.0080.00018.10
8.1.170.0000.00718.54
8.1.160.0070.00018.86
8.1.150.0000.00818.83
8.1.140.0070.00022.13
8.1.130.0030.00320.01
8.1.120.0050.00317.47
8.1.110.0040.00417.31
8.1.100.0040.00417.43
8.1.90.0120.00017.48
8.1.80.0000.00717.46
8.1.70.0030.00317.46
8.1.60.0050.00317.60
8.1.50.0040.00717.53
8.1.40.0060.00317.41
8.1.30.0040.00417.66
8.1.20.0040.00417.62
8.1.10.0050.00217.43
8.1.00.0030.00517.47
8.0.300.0030.00518.77
8.0.290.0000.00716.88
8.0.280.0000.00718.38
8.0.270.0000.00717.25
8.0.260.0030.00318.44
8.0.250.0030.00617.02
8.0.240.0030.00316.91
8.0.230.0030.00316.90
8.0.220.0050.00316.97
8.0.210.0020.00516.82
8.0.200.0000.00716.99
8.0.190.0070.00016.91
8.0.180.0000.00817.01
8.0.170.0030.00616.93
8.0.160.0070.00017.04
8.0.150.0000.00716.95
8.0.140.0030.00516.87
8.0.130.0060.00013.32
8.0.120.0000.00816.81
8.0.110.0080.00016.93
8.0.100.0050.00216.86
8.0.90.0050.00317.02
8.0.80.0090.00816.94
8.0.70.0040.00416.85
8.0.60.0040.00416.80
8.0.50.0040.00416.93
8.0.30.0080.00817.07
8.0.20.0120.00617.40
8.0.10.0040.00416.89
8.0.00.0090.01016.68
7.4.330.0020.00215.55
7.4.320.0000.00616.64
7.4.300.0060.00016.49
7.4.290.0040.00416.50
7.4.280.0000.00816.40
7.4.270.0000.00716.53
7.4.260.0000.00716.37
7.4.250.0000.00716.41
7.4.240.0000.00716.51
7.4.230.0030.00316.64
7.4.220.0080.00016.25
7.4.210.0100.00916.65
7.4.200.0030.00316.61
7.4.160.0110.00716.51
7.4.140.0140.00917.86
7.4.130.0070.01116.49
7.4.120.0140.00616.49
7.4.110.0100.00716.49
7.4.100.0100.01316.55
7.4.90.0090.01316.45
7.4.80.0030.01619.39
7.4.70.0060.01016.68
7.4.60.0070.01016.51
7.4.50.0060.00916.71
7.4.40.0090.01316.39
7.3.330.0020.00213.09
7.3.320.0060.00013.17
7.3.310.0000.00916.16
7.3.300.0040.00416.17
7.3.290.0030.00316.38
7.3.280.0060.01116.32
7.3.260.0110.00816.46
7.3.240.0090.00916.47
7.3.230.0130.01016.55
7.3.210.0150.00516.47
7.3.200.0090.01116.35
7.3.190.0150.00616.40
7.3.180.0120.01016.42
7.3.170.0100.01316.37
7.3.160.0090.00616.55
7.2.330.0130.00616.82
7.2.320.0160.00516.87
7.2.310.0150.00316.50
7.2.300.0100.01316.38
7.2.290.0070.01016.74

preferences:
77.35 ms | 401 KiB | 5 Q