Why did writing a PHP file over an SSH heredoc corrupt it or blank my variables? #33
Answered
by
Kevinchamplin
Kevinchamplin
asked this question in
Q&A
-
|
Why did writing a PHP file over an SSH heredoc corrupt it or blank my variables? |
Beta Was this translation helpful? Give feedback.
Answered by
Kevinchamplin
Jun 13, 2026
Replies: 1 comment
-
|
An unquoted heredoc lets your LOCAL shell expand $vars, backticks and backslashes before sending, so PHP variables get blanked or mangled and the file becomes subtly broken — and Laravel auto-discovery then silently skips the unparseable class with no boot error. Quote the delimiter (<<'EOF'), or transfer the file with scp/rsync instead of piping code, and always run php -l afterward. |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
Kevinchamplin
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
An unquoted heredoc lets your LOCAL shell expand $vars, backticks and backslashes before sending, so PHP variables get blanked or mangled and the file becomes subtly broken — and Laravel auto-discovery then silently skips the unparseable class with no boot error. Quote the delimiter (<<'EOF'), or transfer the file with scp/rsync instead of piping code, and always run php -l afterward.