Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:3165 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 92621 invoked from network); 2 Jul 2003 14:26:24 -0000 Received: from unknown (HELO hasele) (216.179.74.133) by pb1.pair.com with SMTP; 2 Jul 2003 14:26:24 -0000 Received: by hasele (Postfix, from userid 1000) id 51F244F0BF; Wed, 2 Jul 2003 10:04:29 -0400 (EDT) To: Timm Friebe Cc: internals@lists.php.net In-Reply-To: <1057155106.32204.65.camel@localhost> References: <1057120491.17089.3.camel@hasele> <1057155106.32204.65.camel@localhost> Content-Type: text/plain Content-Transfer-Encoding: 7bit Message-ID: <1057154668.17107.69.camel@hasele> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.4.0 Date: 02 Jul 2003 10:04:29 -0400 Subject: Re: [PHP-DEV] Nasty Parser Bug From: sterling@bumblebury.com (Sterling Hughes) On Wed, 2003-07-02 at 10:11, Timm Friebe wrote: > On Wed, 2003-07-02 at 06:34, Sterling Hughes wrote: > [...] > > $t = new test; > > var_dump($t->filter('hello world')); > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ > Changing this line to: > var_dump(call_user_func(array($t, 'filter'), 'hello world')); > > or even > $t= new Reflection_Method('test', 'filter'); > var_dump($t->invoke(new test(), 'hello world')); > > yields the same bug. > > ZE1 outputs "int(1)". ZE2 does so, too, if I rename "test" to anything > else (except "__construct", which causes the same problem). > > The same problem arises for other array functions such as usort, > array_map etc., but _not_ for call_user_func(_array). > > After short investigation it looks like all of these use > fast_call_user_function() but do not pass an object_pp. Either this > should be patched in ext/standard/array.c or fast_call_user_function > shoud check for the callback being an array($obj, $func) / array($class, > $func) *even* when a function pointer is passed. Then why would it work if test() is undefined? Further, why would it work when no array functions are used (as with my original example). I think you might be right that this is a separate bug, but its certainly not the same bug that I'm talking about. -Sterling > > - Timm -- "Nothing is particularly hard if you divide it into small jobs." - Henry Ford