Re: Nasty Parser Bug

From: Date: Wed, 02 Jul 2003 14:11:47 +0000
Subject: Re: Nasty Parser Bug
References: 1  Groups: php.internals 
Request: Send a blank email to internals+get-3164@lists.php.net to get a copy of this message
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. - Timm

« previous php.internals (#3164) next »