class method as callback function

This is a discussion on class method as callback function within the alt.comp.lang.php forums, part of the PHP Programming Forums category; Hi, I am trying to use a method declared in a parent class as callback for let's say an &...


Go Back   Usenet Forums > PHP Programming Forums > alt.comp.lang.php

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 03-30-2005
toto
 
Posts: n/a
Default class method as callback function

Hi,

I am trying to use a method declared in a parent class as
callback for let's say an "array_walk" function.
I have found some information here
http://www.faqts.com/knowledge_base/...id/1725/fid/39

/*$this->"print_array" does the job...
DZ: Or, a better method:
array_walk($fruits, array($this, 'print_array'));
*/
The second method warks although I do not see how it can
be justified after reading the documentation.
How can I use such a static method as callback function ?
I am using PHP5 of course.

Johan
Reply With Quote
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 11:19 PM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0