PHP “short tags”: a bad practice11 November 2009 at 3:42 PM | Posted in PHP | 1 Comment
Tags: clean code, PHP, php standars
The use of php “short tags”( example: <? echo “Hola Mundo!” ?>) is a bad and common practice that many PHP developers still use. The shortags format is only aviable using the function short_tags() in PHP3 or activating the short_open_tag in php.ini configuration file(it comes activated by default). I dont recommend to use it when you develop applications to redistribute or use in external servers because it can cause conflicts for user if short tags are not enabled. In the official PHP manual and the Zend Framework manual recommends not use “short tags” and it going to be deleted in version 6 of PHP. Remember that clearness is very important to a professional coder: use ever <?php echo “Hola Mundo!” ?>.