ID:               20204
 Updated by:       [EMAIL PROTECTED]
 Reported By:      [EMAIL PROTECTED]
-Status:           Open
+Status:           Closed
-Bug Type:         Feature/Change Request
+Bug Type:         Documentation problem
 Operating System: Linux
 PHP Version:      4.2.3
 New Comment:

As you state, this calling convention is not supported.  The reason
relates to how the Zend engine parses PHP syntax and will not change in
the forseeable future.  However, there is cleaner way to accomplish
what you're attempting without using eval().

Try:

  return call_user_func(array($varclassname,'function'));

I notice that the documentation for call_user_func fails to note the
ability to call static class methods in this way(changing category to
documentation problem) and have added an additional paragraph and
explanation explaining this.


Previous Comments:
------------------------------------------------------------------------

[2002-10-31 15:37:27] [EMAIL PROTECTED]

The comma `:' in the first line of code is supposed to be a double
comma `::'

------------------------------------------------------------------------

[2002-10-31 15:34:41] [EMAIL PROTECTED]

Using

$var_classname:function();

throws up a parse error. This was probably not a feature intended to be
included rather than a bug. Currently I have a workaround using this:

print eval("return ".$var_classname."::function();");

Would like to see it implemented in a future version if possible :)

------------------------------------------------------------------------


-- 
Edit this bug report at http://bugs.php.net/?id=20204&edit=1


-- 
PHP Documentation Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to