3v4l.org

run code in 300+ PHP versions simultaneously
<?php $yourname = 'Trav'; $a = array_fill(0,10, $yourname); array_walk($a, function ($a2, $key) {echo $a2[key]; });
Output for 8.0.0 - 8.0.30, 8.1.0 - 8.1.29, 8.2.0 - 8.2.21, 8.3.0 - 8.3.9
Fatal error: Uncaught Error: Undefined constant "key" in /in/26l9o:5 Stack trace: #0 [internal function]: {closure}('Trav', 0) #1 /in/26l9o(5): array_walk(Array, Object(Closure)) #2 {main} thrown in /in/26l9o on line 5
Process exited with code 255.
Output for 7.2.1, 7.3.24 - 7.3.33, 7.4.12 - 7.4.33
Warning: Use of undefined constant key - assumed 'key' (this will throw an Error in a future version of PHP) in /in/26l9o on line 5 Warning: Illegal string offset 'key' in /in/26l9o on line 5 T Warning: Use of undefined constant key - assumed 'key' (this will throw an Error in a future version of PHP) in /in/26l9o on line 5 Warning: Illegal string offset 'key' in /in/26l9o on line 5 T Warning: Use of undefined constant key - assumed 'key' (this will throw an Error in a future version of PHP) in /in/26l9o on line 5 Warning: Illegal string offset 'key' in /in/26l9o on line 5 T Warning: Use of undefined constant key - assumed 'key' (this will throw an Error in a future version of PHP) in /in/26l9o on line 5 Warning: Illegal string offset 'key' in /in/26l9o on line 5 T Warning: Use of undefined constant key - assumed 'key' (this will throw an Error in a future version of PHP) in /in/26l9o on line 5 Warning: Illegal string offset 'key' in /in/26l9o on line 5 T Warning: Use of undefined constant key - assumed 'key' (this will throw an Error in a future version of PHP) in /in/26l9o on line 5 Warning: Illegal string offset 'key' in /in/26l9o on line 5 T Warning: Use of undefined constant key - assumed 'key' (this will throw an Error in a future version of PHP) in /in/26l9o on line 5 Warning: Illegal string offset 'key' in /in/26l9o on line 5 T Warning: Use of undefined constant key - assumed 'key' (this will throw an Error in a future version of PHP) in /in/26l9o on line 5 Warning: Illegal string offset 'key' in /in/26l9o on line 5 T Warning: Use of undefined constant key - assumed 'key' (this will throw an Error in a future version of PHP) in /in/26l9o on line 5 Warning: Illegal string offset 'key' in /in/26l9o on line 5 T Warning: Use of undefined constant key - assumed 'key' (this will throw an Error in a future version of PHP) in /in/26l9o on line 5 Warning: Illegal string offset 'key' in /in/26l9o on line 5 T

preferences:
148.23 ms | 406 KiB | 126 Q