Jump to content

[SOLVED] heredoc


Ninjakreborn

Recommended Posts

What are the standard opinions on the heredoc statement.  I never really liked the way they looked, but by investigating them further, you can throw $variables out in random places and it automatically detects the interpolation, also you don't have to escape double quotes.  In your opinion is heredoc, single quotes, or double quote's better.

Link to comment
https://forums.phpfreaks.com/topic/37369-solved-heredoc/
Share on other sites

It took me a while to get to this point, but I like to break things down into small components that pop data in place using the <?=$var?> syntax.  I also allow for simple and extremely limited logic / program control within components, but the idea is 99% of the time that is handled elsewhere and the component merely slaps data into place.  As another general rule, I try and keep component files small; generally I can see the entire code contained in a component file without scrolling the text editor.

Link to comment
https://forums.phpfreaks.com/topic/37369-solved-heredoc/#findComment-178666
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.