What version of PHP introduced the <?php tag?
I'm creating a test server for a new client that has and older version of PHP that only uses the 开发者_开发百科<?
tags but the latest version of PHP is expecting <?php
tags.
I'm looking for the version I need to install so that I can run the old code without changing any of it.
You just need to enable short_open_tag to use that short version of the standard PHP tags <?php
.
But I wouldn’t do that but just replace the short tags <?
with the standard PHP tags <?php
for portability.
To the best of my knowledge, <?php
has always been available. <?
aka short tags are only available when the directive is allowed in php.ini
the short tag can be used in any version of PHP. You just need to allow it in the php.ini: http://php.net/manual/en/ini.core.php
Out of curiosity I downloaded some of the older versions of PHP from the museum, and all of the examples in version 'php-2.0' only used <?
to open the tags. So I'm going to assume version 1.0 and 2.0 only used <?
and <?php
was introduced in either a later version of 2 or 3.0.
I really wouldn't suggest using any of the old versions of PHP though, mess around with the php.ini and you should be able to get the script working on 4.0.
精彩评论