From: [EMAIL PROTECTED] Operating system: ALL PHP version: 4.2.0 PHP Bug Type: Feature/Change Request Bug description: '<?=', and '<%=' are equivalent to echo, but '<?php=' is not
Seeing as how '<?=' and '<%=' are both equivalent to '<?php echo', I kind of figure that '<?php=' should also be equivalent, but it is not. Having run into this before, I asked about it and somebody told me it was in the works to get taken care of for 4.2.0. I checked and it doesn't seem to be fixed, so I decided to do a bit of hunting to see if it was within my capabilites. I *think* I've found the changes which need to be made, but I'm not absolutely certain. Having searched through all of the source code for all occurrances of '<%=' and '<?=', I discovered that they only exist (outside of comments) in one source file. That said, I *believe* that the following changes to php-4.2.0\Zend\zend_language_scanner.l would cause '<?php=' to become equivalent to '<?php echo' just as the other, shorter tags allow. I don't know how to make an actual patch file, or where to submit it so here goes. First is the two-line change to zend_language_scanner.l that would seem to enable the shorthand. Second is the one-line change to zend_language_scanner.c (just in case the two have to be maintained seperately). This should be easily back-portable to previous code trees. file: php-4.2.0\Zend\zend_language_scanner.l; replace: lines 941-942; - - - - - START - - - - - <INITIAL>"<%="|"<?="|"<?php=" { if ((yytext[1]=='%' && CG(asp_tags)) || (yytext[1]=='?' && CG(short_tags)) || (yytext[1]=='?' && yytext[2]=='p' && yytext[3]=='h' && yytext[4]=='p')) { - - - - - STOP - - - - - file: php-4.2.0\Zend\zend_language_scanner.c; replace: line 4086; - - - - - START - - - - - if ((yytext[1]=='%' && CG(asp_tags)) || (yytext[1]=='?' && CG(short_tags)) || (yytext[1]=='?' && yytext[2]=='p' && yytext[3]=='h' && yytext[4]=='p')) { - - - - - STOP - - - - - -- Edit bug report at http://bugs.php.net/?id=16763&edit=1 -- Fixed in CVS: http://bugs.php.net/fix.php?id=16763&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=16763&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=16763&r=needtrace Try newer version: http://bugs.php.net/fix.php?id=16763&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=16763&r=support Expected behavior: http://bugs.php.net/fix.php?id=16763&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=16763&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=16763&r=submittedtwice