3v4l.org

run code in 300+ PHP versions simultaneously
<?php $y[0] = 'Good'; $y[1] = ' morning!'; echo "${y[0]}$[y[1]}"; echo ${y[0]},${y[1]};
Output for 8.2.0 - 8.2.18, 8.3.0 - 8.3.6
Deprecated: Using ${var} in strings is deprecated, use {$var} instead in /in/CkmK1 on line 5 Good$[y[1]} Fatal error: Uncaught Error: Undefined constant "y" in /in/CkmK1:6 Stack trace: #0 {main} thrown in /in/CkmK1 on line 6
Process exited with code 255.
Output for 8.0.0 - 8.0.30, 8.1.0 - 8.1.28
Good$[y[1]} Fatal error: Uncaught Error: Undefined constant "y" in /in/CkmK1:6 Stack trace: #0 {main} thrown in /in/CkmK1 on line 6
Process exited with code 255.
Output for 7.2.0 - 7.2.33, 7.3.0 - 7.3.31, 7.4.0 - 7.4.33
Good$[y[1]} Warning: Use of undefined constant y - assumed 'y' (this will throw an Error in a future version of PHP) in /in/CkmK1 on line 6 Notice: Array to string conversion in /in/CkmK1 on line 6 Array Warning: Use of undefined constant y - assumed 'y' (this will throw an Error in a future version of PHP) in /in/CkmK1 on line 6 Notice: Uninitialized string offset: 1 in /in/CkmK1 on line 6 Notice: Undefined variable: in /in/CkmK1 on line 6
Output for 7.3.32 - 7.3.33
Good$[y[1]} Warning: Use of undefined constant y - assumed 'y' (this will throw an Error in a future version of PHP) in /in/CkmK1 on line 6 Array Warning: Use of undefined constant y - assumed 'y' (this will throw an Error in a future version of PHP) in /in/CkmK1 on line 6
Output for 5.6.8 - 5.6.28, 7.0.0 - 7.0.20, 7.1.0 - 7.1.33
Good$[y[1]} Notice: Use of undefined constant y - assumed 'y' in /in/CkmK1 on line 6 Notice: Array to string conversion in /in/CkmK1 on line 6 Array Notice: Use of undefined constant y - assumed 'y' in /in/CkmK1 on line 6 Notice: Uninitialized string offset: 1 in /in/CkmK1 on line 6 Notice: Undefined variable: in /in/CkmK1 on line 6
Output for 5.5.24 - 5.5.35
Parse error: syntax error, unexpected '[' in /in/CkmK1 on line 6
Process exited with code 255.

preferences:
160.99 ms | 401 KiB | 212 Q