Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:15375 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 59837 invoked by uid 1010); 11 Mar 2005 19:36:29 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 59785 invoked from network); 11 Mar 2005 19:36:28 -0000 Received: from unknown (HELO pb1.pair.com) (127.0.0.1) by localhost with SMTP; 11 Mar 2005 19:36:28 -0000 X-Host-Fingerprint: 70.85.46.36 unknown Received: from ([70.85.46.36:45687] helo=prohost.org) by pb1.pair.com (ecelerity HEAD r(5124)) with SMTP id 2A/47-31540-C33F1324 for ; Fri, 11 Mar 2005 14:36:28 -0500 Received: (qmail 19822 invoked from network); 11 Mar 2005 19:36:17 -0000 Received: from cpe00095beeab35-cm000f9f7d6664.cpe.net.cable.rogers.com (HELO ?192.168.1.101?) (69.196.31.219) by prohost.org with SMTP; 11 Mar 2005 19:36:17 -0000 Message-ID: <4231F330.6000705@prohost.org> Date: Fri, 11 Mar 2005 14:36:16 -0500 User-Agent: Mozilla Thunderbird 1.0 - [MOOX M3] (Windows/20041208) X-Accept-Language: en-us, en MIME-Version: 1.0 To: internals@lists.php.net X-Enigmail-Version: 0.89.5.0 X-Enigmail-Supports: pgp-inline, pgp-mime Content-Type: multipart/mixed; boundary="------------030308040903010706070904" Subject: HALT Patch From: ilia@prohost.org (Ilia Alshanetsky) --------------030308040903010706070904 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit The attach patch implements a special "token" that can be used to stop the Zend lexical parser from parsing any data after this token. The idea behind this patch is to allow tucking on of any data (binary and otherwise) to the PHP script without having to encode it. It also saves on memory/cpu that normally be used/needed to parse the data. Memory is particularly important point, since many systems run with default memory limit (8 megs) and would easily hit it when a script had a 2-4 megs of data tacked on. The patch would be extremely helpful for application distribution where the entire install/upgrade script can be just a single script. The syntax chosen for the patch was design specifically in such a way as to not cause parser errors in older PHPs without the support for this feature. Ilia --------------030308040903010706070904 Content-Type: text/plain; name="halt.txt" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="halt.txt" Index: Zend/zend_language_scanner.l =================================================================== RCS file: /repository/ZendEngine2/zend_language_scanner.l,v retrieving revision 1.124 diff -u -a -p -r1.124 zend_language_scanner.l --- Zend/zend_language_scanner.l 7 Mar 2005 16:48:49 -0000 1.124 +++ Zend/zend_language_scanner.l 11 Mar 2005 19:30:47 -0000 @@ -1342,6 +1342,10 @@ NEWLINE ("\r"|"\n"|"\r\n") return T_INLINE_HTML; } +"" { + yyterminate(); +} + "" { HANDLE_NEWLINES(yytext, yyleng); if (CG(short_tags) || yyleng>2) { /* yyleng>2 means it's not */ --------------030308040903010706070904--