Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:12550 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 96181 invoked by uid 1010); 2 Sep 2004 20:35:12 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 80910 invoked from network); 2 Sep 2004 19:44:27 -0000 Received: from unknown (HELO mproxy.gmail.com) (64.233.170.195) by pb1.pair.com with SMTP; 2 Sep 2004 19:44:26 -0000 Received: by mproxy.gmail.com with SMTP id 77so64568rnk for ; Thu, 02 Sep 2004 12:44:26 -0700 (PDT) Received: by 10.38.11.79 with SMTP id 79mr95628rnk; Thu, 02 Sep 2004 12:44:26 -0700 (PDT) Received: by 10.38.89.34 with HTTP; Thu, 2 Sep 2004 12:44:26 -0700 (PDT) Message-ID: <8dd3173f04090212448d20a37@mail.gmail.com> Date: Thu, 2 Sep 2004 20:44:26 +0100 Reply-To: Stuart Dallas To: Sara Golemon Cc: internals@lists.php.net In-Reply-To: <20040901231601.94605.qmail@pb1.pair.com> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit References: <8dd3173f04090112506e5891@mail.gmail.com> <836225669.20040901172433@ionzoft.com> <8dd3173f04090114471aa25f2a@mail.gmail.com> <20040901231601.94605.qmail@pb1.pair.com> Subject: Re: [PHP-DEV] [PATCH] #29416 - ob_include From: stuart.dallas@gmail.com (Stuart Dallas) On Wed, 1 Sep 2004 16:15:59 -0700, Sara Golemon wrote: > > This is my first attempt at submitting a patch so please be gentle :). > > > *sharpens fangs* Oops, asked for that! > > The feature requested in #29416 is something I've wanted to see for a > > while, so I decided to have a go at adding it. > > > Considering the triviality of doing it in user space (the bug report shows > the four lines it'd take) and the potential for changes in how ZE compiles > and executes a new function, I'll throw a -1 vote at it. > > > I decided name ob_include described the method by which the function > > did it's job rather than what it was for. I have implemented it as > > eval_file_get_output which I feel is a better description of its > > purpose. The requester suggests require and _once variations but those > > make little sense to me so I haven't implemented those. > > > > Index: ext/standard/basic_functions.c > > > There's a considerable amount of work you're not doing here in terms of > managing variable scope and dealing with the return value (you'll notice > some particular weirdness if you use this from within a function). > > Take a look at (PHP5)Zend/zend_execute.c::zend_include_or_eval_handler() or > (PHP4)Zend/zend_execute.c::execute() (the potion involving `case > ZEND_INCLUDE_OR_EVAL:`) To be honest I wasn't really expecting much more. I made a patch that did what I wanted (I don't need it in a function... yet) and thought I'l throw it out there. In case anyone cares I've put it up here: http://dev.stut.net/php/eval_file_get_output.patch I appreciate your comments and those from Derick. -- Stuart