php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #45089 __callStatic $name case sensitivity
Submitted: 2008-05-26 00:41 UTC Modified: 2008-06-03 19:01 UTC
Votes:2
Avg. Score:5.0 ± 0.0
Reproduced:2 of 2 (100.0%)
Same Version:2 (100.0%)
Same OS:0 (0.0%)
From: danielc at analysisandsolutions dot com Assigned: pollita (profile)
Status: Closed Package: Class/Object related
PHP Version: 5.3CVS-2008-05-26 (snap) OS:
Private report: No CVE-ID: None
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 !
Your email address:
MUST BE VALID
Solve the problem:
33 - 23 = ?
Subscribe to this entry?

 
 [2008-05-26 00:41 UTC] danielc at analysisandsolutions dot com
Description:
------------
The value of $name produced by __callStatic() is lower cased but the $name produced by the regular __call() is unchanged.

Please adjust __callStatic() so it doesn't change the case of $name.

Reproduce code:
---------------
class MethodTest {
    public static function __callStatic($name, $arguments) {
        echo "Calling static method '$name' "
             . implode(', ', $arguments). "\n";
    }
}

MethodTest::runTest('in static context');

Expected result:
----------------
Calling static method 'runTest' in static context


Actual result:
--------------
Calling static method 'runtest' in static context


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2008-05-26 19:23 UTC] felipe@php.net
Here's a patch:
http://felipe.ath.cx/diff/callstatic.diff

Solve the callback issue too.

I also added two tests in:
http://felipe.ath.cx/diff/tests/

 [2008-06-03 19:01 UTC] felipe@php.net
This bug has been fixed in CVS.

Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
http://snaps.php.net/.
 
Thank you for the report, and for helping us make PHP better.

Fixed in 5_3 and HEAD.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Tue Dec 10 09:01:27 2024 UTC