PHP short tags are ok
PHP short tags are enabled by default in PHP although they are officially discouraged because of a potential collision with xml. XML blocks start with <?xml The other arguments against short-tags is portability. Some web hosts won't have short-tags enabled by default. This is pretty easy to remedy - either by editing the php.ini file or adding a htaccess file. Now some PHP purists will say that anyone who uses short tags is error prone or antiquated. This is simply unfounded as short tags are not deprecated and as long as you are aware of the shortcomings; won't cause you any more errors.. PHP6 is going to be a major shake up to PHP - a lot of things are going to go like safe-mode / register globals etc. But it would appear that short-tags will be staying. Probably due to the sheer amount of code and rebel coders that rely on them. Now for super-standards-compliant perfecto projects it may be sensible to use the full PHP tags. But for standard every day use, short tags are ok - so don't let the nay-sayers put you off. 01/05/2009 permalink | Posted in web development | 0 Comments » Leave a reply |
About meAdam Jimenez is a freelance web developer who has been professionally developing websites since 2000.Find me
Projects
Archive |