Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:26562 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 55268 invoked by uid 1010); 14 Nov 2006 11:50:12 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 55253 invoked from network); 14 Nov 2006 11:50:12 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 14 Nov 2006 11:50:12 -0000 Authentication-Results: pb1.pair.com header.from=php_lists@realplain.com; sender-id=unknown Authentication-Results: pb1.pair.com smtp.mail=php_lists@realplain.com; spf=permerror; sender-id=unknown Received-SPF: error (pb1.pair.com: domain realplain.com from 209.142.136.132 cause and error) X-PHP-List-Original-Sender: php_lists@realplain.com X-Host-Fingerprint: 209.142.136.132 msa2-mx.centurytel.net Linux 2.4/2.6 Received: from [209.142.136.132] ([209.142.136.132:41859] helo=msa2-mx.centurytel.net) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 1B/25-19250-27DA9554 for ; Tue, 14 Nov 2006 06:50:12 -0500 Received: from pc1 (d4-78.rt-bras.wnvl.centurytel.net [69.179.131.78]) by msa2-mx.centurytel.net (8.13.6/8.13.6) with SMTP id kAEBo7aQ014015 for ; Tue, 14 Nov 2006 05:50:07 -0600 Message-ID: <016901c707e3$08aaa440$0201a8c0@pc1> To: Date: Tue, 14 Nov 2006 05:50:08 -0600 MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="----=_NextPart_000_0166_01C707B0.BDB0D630" X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2800.1807 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1807 Subject: Binary strings from 6 in 5.2? From: php_lists@realplain.com ("Matt Wilmas") ------=_NextPart_000_0166_01C707B0.BDB0D630 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Hi all, This is regarding Derick's addition of the (binary) cast in 5.2, and its discussion. I agree with the others who think it's a good addition so future code for PHP 6 won't fail with a parse error on a small thing that could be handled transparently. But the point of this message is to ask about the "b" binary-string "prefix thing" from 6: Isn't that a closely-related syntax addition which should also be included? If so, the attached patch hopefully covers it. :-) Matt ------=_NextPart_000_0166_01C707B0.BDB0D630 Content-Type: text/plain; name="5_2_binary.txt" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="5_2_binary.txt" Index: zend_language_scanner.l=0A= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=0A= RCS file: /repository/ZendEngine2/zend_language_scanner.l,v=0A= retrieving revision 1.131.2.11.2.1=0A= diff -u -r1.131.2.11.2.1 zend_language_scanner.l=0A= --- zend_language_scanner.l 10 Nov 2006 12:02:51 -0000 1.131.2.11.2.1=0A= +++ zend_language_scanner.l 14 Nov 2006 11:30:00 -0000=0A= @@ -1564,10 +1564,15 @@=0A= }=0A= =0A= =0A= -(["]([^$"\\]|("\\".))*["]) {=0A= +("b"?["]([^$"\\]|("\\".))*["]) {=0A= register char *s, *t;=0A= char *end;=0A= =0A= + if (*yytext =3D=3D 'b') {=0A= + yytext++;=0A= + yyleng--;=0A= + }=0A= +=0A= zendlval->value.str.val =3D estrndup(yytext+1, yyleng-2);=0A= zendlval->value.str.len =3D yyleng-2;=0A= zendlval->type =3D IS_STRING;=0A= @@ -1654,10 +1659,15 @@=0A= }=0A= =0A= =0A= -([']([^'\\]|("\\".))*[']) {=0A= +("b"?[']([^'\\]|("\\".))*[']) {=0A= register char *s, *t;=0A= char *end;=0A= =0A= + if (*yytext =3D=3D 'b') {=0A= + yytext++;=0A= + yyleng--;=0A= + }=0A= +=0A= zendlval->value.str.val =3D estrndup(yytext+1, yyleng-2);=0A= zendlval->value.str.len =3D yyleng-2;=0A= zendlval->type =3D IS_STRING;=0A= @@ -1702,14 +1712,20 @@=0A= }=0A= =0A= =0A= -["] {=0A= +"b"?["] {=0A= BEGIN(ST_DOUBLE_QUOTES);=0A= return '\"';=0A= }=0A= =0A= =0A= -"<<<"{TABS_AND_SPACES}{LABEL}{NEWLINE} {=0A= +"b"?"<<<"{TABS_AND_SPACES}{LABEL}{NEWLINE} {=0A= char *s;=0A= +=0A= + if (*yytext =3D=3D 'b') {=0A= + yytext++;=0A= + yyleng--;=0A= + }=0A= +=0A= CG(zend_lineno)++;=0A= CG(heredoc_len) =3D yyleng-3-1-(yytext[yyleng-2]=3D=3D'\r'?1:0);=0A= s =3D yytext+3;=0A= @@ -1729,7 +1745,7 @@=0A= }=0A= =0A= =0A= -['] {=0A= +"b"?['] {=0A= BEGIN(ST_SINGLE_QUOTE);=0A= return '\'';=0A= }=0A= ------=_NextPart_000_0166_01C707B0.BDB0D630--