|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #33463 Unexpected Paamayim Nekudotayim in Dynamic Static Method Call
Submitted: 2005-06-24 12:26 UTC Modified: 2005-06-24 12:44 UTC
Avg. Score:4.4 ± 1.2
Reproduced:10 of 11 (90.9%)
Same Version:3 (30.0%)
Same OS:0 (0.0%)
From: etienne at actrix dot co dot nz Assigned:
Status: Wont fix Package: Class/Object related
PHP Version: 5.0.4 OS: Windows XP Pro
Private report: No CVE-ID: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please — but make sure to vote on the bug!
Your email address:
Solve the problem:
19 + 7 = ?
Subscribe to this entry?

 [2005-06-24 12:26 UTC] etienne at actrix dot co dot nz
Basically, a call to a static class method produces a parse error. Unexpected Paamayim Nekudotayim (::).

This sort of coding works on normal method calls, and object instantiation.

For example, the following works fine:

$name = "ClassName";
$instance = new $name();

^^ will create a new instance of ClassName;


public function method() {
//some code

$methodName = "method";

^^ will run method().

Reproduce code:
class ClassName {

public static function staticClassMethod() {
//some code


$name = "ClassName";

Expected result:
I expected php to call the method "staticClassMethod".

Actual result:
Parse error: syntax error, unexpected T_PAAMAYIM_NEKUDOTAYIM ...


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2005-06-24 12:44 UTC]
Use call_user_func() for that.
PHP Copyright © 2001-2021 The PHP Group
All rights reserved.
Last updated: Sun Sep 19 11:03:38 2021 UTC