Jump to content

question regarding backward compatibility in PHP 5.2


jawaidpk

Recommended Posts

well I have PHP 5.2.0 installed, & I have a huge project to work on but the problem is that the project was developed by using earlier version of PHP where "<?  ?>" these tags are allowed but PHP 5.2.0 dont allow "<?  ?>" tag instead it allows "<?php  ?>" tags. There are so many files in that project that it is almost impossible to change each & every "<?" tag to "<?php" tag. So I wanna know whether it is possible to use "<?" tag in PHP5.2.0. If yes then how it is possible?? 

Yes its possible (but not recommended). Within the php.ini, enable short open tags.

 

Id'e recommend changing the tags, easy enough with some bash/sed. Something like...

 

for file in $(ls projectdir) ; do
  sed -i -e 's/\<\?/\<\?php/g' $file
done

 

Not tested.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.