Heredoc warnings

Heredoc warnings

Example

$somevariable = <<< EOF[b:3280da4e63] [/b:3280da4e63]
// some code here
EOF;[b:3280da4e63] [/b:3280da4e63]

This is just a note and reminder that if you have any kind of spaces after the EOF at the top you will get strange parse errors that make no sense such as an existing function that PHP thinks is undefined.

The bottom EOF; must also not have any whitespace in front of it or behind it or you will get the same strange errors.

Remember this first when looking at strange parse errors if you are using heredoc because it will waste hours of your time!

[b:3280da4e63]One more thing[/b:3280da4e63]
Even heredoc that is commented out can still affect your PHP



Tags:

heredoc, warningsheredoc, warningsexample, somevariable, eof, reminder, spaces, parse, errors, existing, php, undefined, whitespace, commented,

Latest Articles

  • QEMU-KVM soundhw deprecated how to enable sound in QEMU 4.x series
  • Virtualbox Error Cannot register the hard disk because a hard disk with UUID already exists solution
  • kernel: [549267.368859] mate-terminal[7871]: segfault at 2000000101 ip 00007f5d0a9548f0 sp 00007fff7012c610 error 4 in libgobject-2.0.so.0.4800.2[7f5d0a920000+52000]
  • apcupsd how to setup and monitor APC UPS units
  • How To Password Reset, Recover, Bypass, Remove and Unlock on Windows 10,8,7,Vista,XP,NT,2000,2003,2008,2012,2016,2019 Administrative Login Programs
  • Nvidia Ubuntu Linux Screentearing Video with solution driver
  • ?? Question Marks for time, permissions and size of a file?
  • mdadm how to stop a check
  • access denied by acl file qemu-kvm: bridge helper failed
  • Linux NIC connecting at 100M instead of 1000M gigabit speeds? It could be overheating
  • "This kernel requires the following features not present on the CPU: cmov Unable to boot - please use a kernel appropriate for your CPU.
  • http://vault.centos.org/5.9/os/i386/repodata/filelists.xml.gz: [Errno -1] Metadata file does not match checksum solution
  • Linux Ubuntu Wifi Disabled Only Works When Laptop Plugged Into Wall AC Power
  • CentOS 6 impossible to compile a newer libguestfs
  • chroot
  • How To Get Started on Ubuntu with gpt-2 OpenAI Text Prediction
  • Remove cloud-init in your VM
  • QEMU-KVM KVM Command Line Practical Guide
  • Linux How To Change NIC Name to eth0 instead of enps33 or enp0s25
  • virt-resize: error: libguestfs error: could not create appliance through libvirt.