Re: PHP 6.0 Wishlist

From: Date: Sat, 27 Aug 2005 22:02:08 +0000
Subject: Re: PHP 6.0 Wishlist
References: 1 2 3  Groups: php.internals 
Request: Send a blank email to internals+get-18493@lists.php.net to get a copy of this message
It would be nice if PHP could not get tripped up by "<?xml" tags when short_tags is on.
Already included, you may have seen this feature used before, <?php :-) I gather he meant making the scanner intelligent enough to see that the <? is followed by 'xml' and just ignoring the fact that short open tags is on. I wouldn't expect to see it happen (or want it to), but if he wants it, here's a sloppy implementation:
Index: Zend/zend_language_scanner.l =================================================================== RCS file: /repository/ZendEngine2/zend_language_scanner.l,v retrieving revision 1.131 diff -u -r1.131 zend_language_scanner.l
--- Zend/zend_language_scanner.l        3 Aug 2005 13:30:54 -0000 1.131
+++ Zend/zend_language_scanner.l        27 Aug 2005 21:55:36 -0000
@@ -1379,6 +1379,12 @@
       }
} +<INITIAL>"<?xml"([ \t]|{NEWLINE}) {
+       zendlval->value.str.val = (char *) estrndup(yytext, yyleng);
+       zendlval->value.str.len = yyleng;
+       zendlval->type = IS_STRING;
+       return T_INLINE_HTML;
+} <INITIAL>"<%="|"<?=" {
       if ((yytext[1]=='%' && CG(asp_tags)) || (yytext[1]=='?' && CG(short_tags))) {


« previous php.internals (#18493) next »