Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:13130 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 74337 invoked by uid 1010); 4 Oct 2004 08:42:28 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 74166 invoked from network); 4 Oct 2004 08:42:27 -0000 Received: from unknown (HELO mproxy.gmail.com) (64.233.170.202) by pb1.pair.com with SMTP; 4 Oct 2004 08:42:27 -0000 Received: by mproxy.gmail.com with SMTP id 76so4767706rnk for ; Mon, 04 Oct 2004 01:42:27 -0700 (PDT) Received: by 10.38.208.53 with SMTP id f53mr5245533rng; Mon, 04 Oct 2004 01:42:26 -0700 (PDT) Received: by 10.39.1.1 with HTTP; Mon, 4 Oct 2004 01:42:26 -0700 (PDT) Message-ID: <106cc120041004014249c02f8@mail.gmail.com> Date: Mon, 4 Oct 2004 18:12:26 +0930 Reply-To: Daniel O'Connor To: internals@lists.php.net Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Subject: PHP Language Query From: daniel.oconnor@gmail.com (Daniel O'Connor) Hi, Apologies if this is the inappropriate place to ask; however: I'm trying to minimise the amount of PHP I have to code. For instance: function callbackIterator($array,&$callbackFunction) { //If $array is actually an array, iterate through all of the values and //call $callbackFunction($array[$i]) //else, just return. } class Foo { function bar($mixed) { callbackIterator($mixed,$something)); // Rest of functionality here } function bar2($mixed) { callbackIterator($mixed,$something)); // Rest of functionality here } } Rather than implement for *every* function stuff to check if its an array, format it correctly and whatever, is there any kind of internal functionality that is exposed to enable $something to pass "this current instance of this class's function pointer".. . Being able to do so would allow me to save loads of time developing as I can write it once and use it anywhere... It was suggested an alternative would be to have a wrapper outside of the function: call($mixed,$function), which is workable but not pretty for your typical noober who doesn't like messing with objects... ie callbackIterator($args, $Foo->Function) Suggestions, thoughts, or "RTFM"'s appreciated -Daniel O'Connor -- http://www.ahsonline.com.au/dod/FOAF.rdf