monkeybidz Posted October 6, 2007 Share Posted October 6, 2007 Will certain versions of PHP read this differently or not read at all? $sample[mine] and $sample['mine'] Link to comment https://forums.phpfreaks.com/topic/72075-php-versions-question/ Share on other sites More sharing options...
hostfreak Posted October 6, 2007 Share Posted October 6, 2007 No, not that I am aware of, but it is always best to use quotes (whether it be single or double), like in your second example. Link to comment https://forums.phpfreaks.com/topic/72075-php-versions-question/#findComment-363184 Share on other sites More sharing options...
monkeybidz Posted October 6, 2007 Author Share Posted October 6, 2007 How about line 1 of a php page, will this matter? <? vs. <?php You will even note in this forum code i posted the color difference. I feel it is read differently. Link to comment https://forums.phpfreaks.com/topic/72075-php-versions-question/#findComment-363191 Share on other sites More sharing options...
monkeybidz Posted October 6, 2007 Author Share Posted October 6, 2007 Any takers? Link to comment https://forums.phpfreaks.com/topic/72075-php-versions-question/#findComment-363203 Share on other sites More sharing options...
~n[EO]n~ Posted October 6, 2007 Share Posted October 6, 2007 This i pasted from the php.ini setting ; Allow the <? tag. Otherwise, only <?php and <script> tags are recognized. ; NOTE: Using short tags should be avoided when developing applications or ; libraries that are meant for redistribution, or deployment on PHP ; servers which are not under your control, because short tags may not ; be supported on the target server. For portable, redistributable code, ; be sure not to use short tags. short_open_tag = on If it is set on <? and <?php will work, but <? is not recommended read the quote above. Link to comment https://forums.phpfreaks.com/topic/72075-php-versions-question/#findComment-363205 Share on other sites More sharing options...
trq Posted October 6, 2007 Share Posted October 6, 2007 The difference between <? and <?php is a configuration option (short_open_tag), best to use the long one as it can confuse the paser seeing as xml also using <? as its opening tag. The difference between $arr[var] and $arr['var'] is the first one is invalid syntax, no matter what version your using it will produce a notice. Once again, notices can be turned off within the php.ini but its best to use the correct syntax in the first place. Link to comment https://forums.phpfreaks.com/topic/72075-php-versions-question/#findComment-363206 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.