3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array = [ [ 'name' => 'a', 'url' => 'b', ], [ 'name' => 'c', 'url' => 'd', 'children' => [ [ 'name' => 'e', 'url' => 'f' ] ] ] ]; function recurseAll($node) { echo "\n---\n"; if (is_iterable($node)) { var_export($node); foreach ($node as $childNode) { recurseAll($childNode); } } else { echo $node; } } array_walk($array, 'recurseAll');
Output for 7.1.26 - 7.1.33, 7.2.17 - 7.2.33, 7.3.0 - 7.3.33, 7.4.0 - 7.4.33, 8.0.0 - 8.0.30, 8.1.0 - 8.1.33, 8.2.0 - 8.2.29, 8.3.0 - 8.3.27, 8.4.1 - 8.4.16, 8.5.0 - 8.5.1
--- array ( 'name' => 'a', 'url' => 'b', ) --- a --- b --- array ( 'name' => 'c', 'url' => 'd', 'children' => array ( 0 => array ( 'name' => 'e', 'url' => 'f', ), ), ) --- c --- d --- array ( 0 => array ( 'name' => 'e', 'url' => 'f', ), ) --- array ( 'name' => 'e', 'url' => 'f', ) --- e --- f
Output for 8.3.28
/bin/php-8.3.28: /usr/lib/libm.so.6: version `GLIBC_2.38' not found (required by /bin/php-8.3.28) /bin/php-8.3.28: /usr/lib/libm.so.6: version `GLIBC_2.35' not found (required by /bin/php-8.3.28) /bin/php-8.3.28: /usr/lib/libc.so.6: version `GLIBC_2.34' not found (required by /bin/php-8.3.28) /bin/php-8.3.28: /usr/lib/libc.so.6: version `GLIBC_2.38' not found (required by /bin/php-8.3.28)
Process exited with code 1.

preferences:
180.9 ms | 407 KiB | 5 Q