3v4l.org

run code in 300+ PHP versions simultaneously
<?php $string = 'asdf'; $array['test'] = 'I wonder if heredoc works with arrays'; $heredoc = <<<HEREDOC $array["test"] HEREDOC; echo $heredoc;
Output for 8.0.0 - 8.0.11
Parse error: syntax error, unexpected double-quote mark, expecting "-" or identifier or variable or number in /in/INZrJ on line 7
Process exited with code 255.
Output for 7.3.0 - 7.3.31, 7.4.0 - 7.4.24
Parse error: syntax error, unexpected '"', expecting '-' or identifier (T_STRING) or variable (T_VARIABLE) or number (T_NUM_STRING) in /in/INZrJ on line 7
Process exited with code 255.

preferences:
198.1 ms | 1387 KiB | 74 Q