Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:3431 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 46748 invoked from network); 15 Jul 2003 22:19:12 -0000 Received: from unknown (HELO moutng.kundenserver.de) (212.227.126.187) by pb1.pair.com with SMTP; 15 Jul 2003 22:19:12 -0000 Received: from [212.227.126.162] (helo=mrelayng.kundenserver.de) by moutng.kundenserver.de with esmtp (Exim 3.35 #1) id 19cY8d-0006FC-00; Wed, 16 Jul 2003 00:19:11 +0200 Received: from [217.80.180.203] (helo=[217.80.180.203]) by mrelayng.kundenserver.de with asmtp (Exim 3.35 #1) id 19cY8c-0006Ms-00; Wed, 16 Jul 2003 00:19:11 +0200 To: Greg Beaver Cc: internals@lists.php.net In-Reply-To: <3F147B5D.5070406@chiaraquartet.net> References: <3F147B5D.5070406@chiaraquartet.net> Content-Type: text/plain Organization: Message-ID: <1058307535.64284.84.camel@localhost> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.2.4 Date: 16 Jul 2003 00:18:56 +0200 Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] $this assignment and call_user_func question From: thekid@thekid.de (Timm Friebe) On Wed, 2003-07-16 at 00:08, Greg Beaver wrote: > Hi, [...] As Marcus already replied on this part and as I agree, I'll leave out any comments:) > In addition, will call_user_func() support static methods before 1.0? > call_user_func('class::method', $args); This is already supported (in PHP4). Simply use array("class", "method") for the first argument instead of array($instance, "method"). thekid@friebes:~ > php -r 'class Foo { function bar($arg) { var_dump($arg, $this); echo "--\n"; }} call_user_func(array("Foo", "bar"), "static"); call_user_func(array(new Foo(), "bar"), "non-static");' string(6) "static" NULL -- string(10) "non-static" object(foo)(0) { } -- $this is NULL for the call via array("Foo", "bar") - meaning this method has been called statically. thekid@friebes:~ > php -v PHP 4.3.1 (cli) (built: Feb 23 2003 20:37:24) Copyright (c) 1997-2002 The PHP Group Zend Engine v1.3.0, Copyright (c) 1998-2002 Zend Technologies - Timm