04.04.06
PHP short_open_tag?
Reading a some material on php+best practices, and saw again the “don’t use short open tags, use long open tags”…. mantra. Eg.
// Do this <?php echo $print_this; ?> // Not this <?=$print_this; ?>
Why why why? Yeah, xml support so that xml embedded in your php doesn’t start some confusion, but PHP is a scripting language for goodness sake, it’s short and it’s nice. Is this just like += ++ etc.? Cryptic for all of a few seconds then away you go. If I need the xml support then I’ll avoid short tags. Done. When I need it, i’ll be clear. So am I now down the path of “bad-practice”?
Well, just to cause a stir, I like short tags.
They’re concise, read well when using php like a “templating language” (another rant there) and I don’t need the all my php files to be xml safe (just print the ‘<?xml’ as a quoted string).
argh.