jawaidpk Posted February 6, 2007 Share Posted February 6, 2007 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?? Link to comment https://forums.phpfreaks.com/topic/37286-question-regarding-backward-compatibility-in-php-52/ Share on other sites More sharing options...
hvle Posted February 6, 2007 Share Posted February 6, 2007 no, this won't be a problem, but make sure on your php.ini has short_open_tag = on Link to comment https://forums.phpfreaks.com/topic/37286-question-regarding-backward-compatibility-in-php-52/#findComment-178177 Share on other sites More sharing options...
trq Posted February 6, 2007 Share Posted February 6, 2007 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. Link to comment https://forums.phpfreaks.com/topic/37286-question-regarding-backward-compatibility-in-php-52/#findComment-178179 Share on other sites More sharing options...
trq Posted February 6, 2007 Share Posted February 6, 2007 This one is tested and working. for file in $(ls -R projectdir/*.php) ; do sed -i -e 's/<?$/<?php/g' $file done Link to comment https://forums.phpfreaks.com/topic/37286-question-regarding-backward-compatibility-in-php-52/#findComment-178180 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.