Is using php short tags in views of yii extensions ok?
I mean <?= and <? instead of <?php echo and <?php
I don’t wont to use ugly long php tags in views & using of alternative templates in extensions is bad idea too. But i know that some people think that php short tags is bad practice too.
Zaccaria, short php tags was always accepted on all hosts which was used by me ever .
The question is about good/bad practice to publish yii extensions with short tags. I like short tags very much and I think about perspective to rewrite all my code that i want to publish. And this perspective demotimates me little bit
I was using short tags for a long time, but now I prefer <?php … ?>, because I see many people use it and almost every one in Yii projects. I think more people will be happy to see non-short tags in your extensions
That doesn’t mean that they are always accepted… this is an option in the php.ini file… so it depends from the administrators of the server where you are hosting if it will be enabled… That’s why it’s safer to go with the long tags, that works anytime…
using short tags is a big no no. It has been off by default in php since 5.3 or so. In fact, I think they were even tabled as being deprecated for a while.