3v4l.org

run code in 300+ PHP versions simultaneously
<?php $MAP = [ ['x', 'x', 'x', 'x'], ['x', 's', 'p', 'x'], ['x', 'p', 'p', 'x'], ['x', 'p', 'p', 'x'], ['x', 'p', 'p', 'x'], ['x', 'p', 'p', 'x'], ['x', 'x', 'x', 'x'], ]; function whatever_i_cba_naming_shit_at_this_time_of_night($data) { foreach ($data as $parentKey => $parent) { foreach ($parent as $childKey => $child) { yield [$parentKey, $childKey, $child]; } } } foreach (whatever_i_cba_naming_shit_at_this_time_of_night($MAP) as list($parentKey, $childKey, $child)) { echo "$parentKey/$childKey => $child\n"; }
Output for 5.5.24 - 5.5.35, 5.6.8 - 5.6.28, 7.0.0 - 7.0.20, 7.1.0 - 7.1.33, 7.2.0 - 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.28, 8.4.1 - 8.4.14, 8.5.0 - 8.5.1
0/0 => x 0/1 => x 0/2 => x 0/3 => x 1/0 => x 1/1 => s 1/2 => p 1/3 => x 2/0 => x 2/1 => p 2/2 => p 2/3 => x 3/0 => x 3/1 => p 3/2 => p 3/3 => x 4/0 => x 4/1 => p 4/2 => p 4/3 => x 5/0 => x 5/1 => p 5/2 => p 5/3 => x 6/0 => x 6/1 => x 6/2 => x 6/3 => x
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:
188.93 ms | 407 KiB | 5 Q