On Sun, 2011-06-05 at 12:42 -0400, Pierre Joye wrote: > +1, very good job! > > On Sun, Jun 5, 2011 at 5:52 PM, Felipe Pena <felipe...@gmail.com> wrote: > > Hi all, > > Reading our bug tracker I noticed a good feature request [1] from 2009 which > > points to an interesting feature that I think makes sense for us, since we > > are now working with $f() using objects and strings, and the array('class', > > 'method') is an old known for call_user_func()-like functions. > > > > So, I wrote a patch [2] that allow such behavior to be consistent with > > arrays. See some examples: > > > > class Hello { > > public function world($x) { > > echo "Hello, $x\n"; return $this; > > } > > } > > > > $f = array('Hello','world'); > > var_dump($f('you')); > > > > $f = array(new Hello, 'foo'); > > $f(); > > > > All such calls match with the call_user_func() behavior related to magic > > methods, static & non-static methods. > > > > The array to be a valid callback should be a 2-element array, and it must be > > for the first element object/string and for the second string only. (just > > like our zend_is_callable() check and opcodes related to init call) > > > > Any thoughts? > > > > [1] - http://bugs.php.net/bug.php?id=47160 > > [2] - http://felipe.ath.cx/diff/fr47160.diff > > phpt: http://felipe.ath.cx/diff/fr47160.phpt > > > > -- > > Regards, > > Felipe Pena > > > > > > -- > Pierre > > @pierrejoye | http://blog.thepimp.net | http://www.libgd.org > This is a very good idea.
-- Marcel Esser VP/Engineering, CROSCON Washington, D.C. Office @: marcel.es...@croscon.com office.us +1 (202) 470-6090 mobile.us +1 (202) 250-1988 mobile.de +49 (0)176 391 226 23 -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php