Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:15383 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 45619 invoked by uid 1010); 11 Mar 2005 21:46:22 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 45511 invoked from network); 11 Mar 2005 21:46:22 -0000 Received: from unknown (HELO pb1.pair.com) (127.0.0.1) by localhost with SMTP; 11 Mar 2005 21:46:22 -0000 X-Host-Fingerprint: 64.233.184.192 wproxy.gmail.com Linux 2.4/2.6 Received: from ([64.233.184.192:17679] helo=wproxy.gmail.com) by pb1.pair.com (ecelerity HEAD r(5124)) with SMTP id 91/55-31540-7A112324 for ; Fri, 11 Mar 2005 16:46:15 -0500 Received: by wproxy.gmail.com with SMTP id 37so802571wra for ; Fri, 11 Mar 2005 13:46:12 -0800 (PST) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:reply-to:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:references; b=nsXW3mQOYdJF9acLsdAMpkoHuZHFTRIpDGE3jbKYMYJxi9YVVzWSlXiopt5pOx67cTGelEO+ZwyZxs9t79e5t1tWFeHWnjdDn0AaghmWEeomHPglxCb3zn0Lb3/eOG4mmbsyEumDysePxmf8XlobUdC66gqcil7+/nUFXmwAAeE= Received: by 10.54.63.11 with SMTP id l11mr1725755wra; Fri, 11 Mar 2005 13:46:12 -0800 (PST) Received: by 10.54.44.57 with HTTP; Fri, 11 Mar 2005 13:46:12 -0800 (PST) Message-ID: <4e89b426050311134633b22b@mail.gmail.com> Date: Fri, 11 Mar 2005 16:46:12 -0500 Reply-To: Wez Furlong To: Ilia Alshanetsky Cc: internals@lists.php.net In-Reply-To: <4231F330.6000705@prohost.org> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit References: <4231F330.6000705@prohost.org> Subject: Re: [PHP-DEV] HALT Patch From: kingwez@gmail.com (Wez Furlong) If you name the token __HALT_PHP_PARSER__ instead (or something equally unlikely to be used by accident and unambiguous in meaning), you'll get a +1 from me :-) --Wez. On Fri, 11 Mar 2005 14:36:16 -0500, Ilia Alshanetsky wrote: > 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 > > > 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 */ > > > -- > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: http://www.php.net/unsub.php > >