PHP Classes

Use of PHP short_open_tag is discouraged

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in Bookmark in

      dUnzip2  >  All threads  >  Use of PHP short_open_tag is discouraged  >  (Un) Subscribe thread alerts  
Subject:Use of PHP short_open_tag is discouraged opens with "<?" instead of "<?php"
Author:Ben Johnson
Date:2010-07-29 16:58:26

  1. Use of PHP short_open_tag is discouraged   Reply   Report abuse  
Picture of Ben Johnson Ben Johnson - 2010-07-29 16:58:26

For those who see the actual PHP code when attempting to include, change the opening line in from "<?" to "<?php".

On my server, I disallow short_open_tag, so PHP files that begin with <? are not parsed, and the raw file contents are output to the browser.

The use of short-tags is discouraged in most corners of the Internet, for the reason I cited above (it can expose source code when the server is configured not to allow short-tags). Further, code should be written with maximum portability, and using the full PHP tag format (e.g., <?php) always functions as expected, regardless of the short_open_tag directive's value.

More information can be found here: