php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #24378 Calling static methods without knowing the name of the class
Submitted: 2003-06-28 17:09 UTC Modified: 2003-06-28 17:51 UTC
Votes:1
Avg. Score:4.0 ± 0.0
Reproduced:0 of 0 (0.0%)
From: ville dot tapio at fountainpark dot com Assigned:
Status: Not a bug Package: Class/Object related
PHP Version: 4.3.1 OS:
Private report: No CVE-ID: None
 [2003-06-28 17:09 UTC] ville dot tapio at fountainpark dot com
Description:
------------
Class Foo {
    function bar() {}
}

$class = 'Foo';
$class::bar();




Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2003-06-28 17:37 UTC] ville dot tapio at fountainpark dot com
Ugly workaround:

Class Foo {
    function bar() {}
}

$class = 'Foo';
eval ($class . '::bar();');
 [2003-06-28 17:39 UTC] ville dot tapio at fountainpark dot com
Category fixed.
 [2003-06-28 17:51 UTC] derick@php.net
Not a bug, this just isn't supported.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Apr 20 03:01:28 2024 UTC