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").

[EMAIL PROTECTED]:~ > 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.

[EMAIL PROTECTED]:~ > 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


-- 
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to