3v4l.org

run code in 300+ PHP versions simultaneously
<?php declare(strict_types=1); $array = [ '2' => 'yay, integer inferring', '3' => 'wish you were a string', 'actualstring' => 'yes I am!', ]; foreach ($array as $key => $value) { var_dump($key); var_dump($value); echo "---\n"; }
Output for 8.2.0 - 8.2.29, 8.3.0 - 8.3.28, 8.4.1 - 8.4.14, 8.5.0
int(2) string(22) "yay, integer inferring" --- int(3) string(22) "wish you were a string" --- string(12) "actualstring" string(9) "yes I am!" ---
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:
69.56 ms | 407 KiB | 5 Q