MyBB Community Forums

Full Version: php heredoc
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
i know it sounds n00b1sh but i was readiung beginner php6 and i came across this

sounds very cool ....

i was wondering why people don't use these to create templates in plugins ...( i was thinking of using it)

is is considered bad practice ..?? is it like unsafe or something
No, nothing really stopping anyone.

Just that personally, it's equivalent to double quotes, so you need to escape every "$". With single quotes, you have to escape every "'" I guess, so not really different, just the latter is inmeasurably faster and probably has less gotchas (maybe).
Nowdoc is nice, but new.
Heredoc is too easy and too readable. Nothing for professionals. Toungue