3v4l.org

run code in 300+ PHP versions simultaneously
<?php $input = array ( 'bike' => array ( 'id' => 29, 'type' => 'a', 'time' => '9', ), 'car' => array ( 0 => array ( 'id' => 189, 'type' => 'b', 'time' => '18', ), 1 => array ( 'id' => 190, 'type' => 'c', 'time' => '14', ), ), 'plane' => array ( 'id' => 313, 'type' => 'd', 'time' => '20', ), ); $output = []; array_walk_recursive($input, function($value, $key) use (&$output) { if ($key == "id") { $output[] = $value; } }, $output); var_export($output);
Output for 8.1.0 - 8.1.33, 8.2.0 - 8.2.29, 8.3.0 - 8.3.27, 8.4.1 - 8.4.14, 8.5.0
array ( 0 => 29, 1 => 189, 2 => 190, 3 => 313, )
Output for 8.4.15
/bin/php-8.4.15: /usr/lib/libm.so.6: version `GLIBC_2.38' not found (required by /bin/php-8.4.15) /bin/php-8.4.15: /usr/lib/libm.so.6: version `GLIBC_2.35' not found (required by /bin/php-8.4.15) /bin/php-8.4.15: /usr/lib/libc.so.6: version `GLIBC_2.34' not found (required by /bin/php-8.4.15) /bin/php-8.4.15: /usr/lib/libc.so.6: version `GLIBC_2.38' not found (required by /bin/php-8.4.15)
Process exited with code 1.

preferences:
95.83 ms | 407 KiB | 5 Q