php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #46238 Segmentation fault on static call with empty string method
Submitted: 2008-10-05 22:20 UTC Modified: 2008-10-06 00:41 UTC
From: seppo0010 at yahoo dot com dot ar Assigned: felipe (profile)
Status: Closed Package: Unknown/Other Function
PHP Version: 5.3.0alpha2 OS: Ubuntu 8.04
Private report: No CVE-ID: None
 [2008-10-05 22:20 UTC] seppo0010 at yahoo dot com dot ar
Description:
------------
The magic __callStatic method throws a segmentation fault when the method name is an empty string.

Reproduce code:
---------------
class a {
        static function __callStatic($name, $arguments)
        {
                var_dump(array($name, $arguments));
        }
}
$a = 'a';
$b = '';
$a::$b($a);


Expected result:
----------------
array(2) {
  [0]=>
  string(0) ""
  [1]=>
  array(1) {
    [0]=>
    string(1) "a"
  }
}

- OR -


Fatal error: Function name must be a not empty string in __FILE__ on line 10


Actual result:
--------------
Internal server error when running on apache.
Segmentation fault running as CLI.

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2008-10-06 00:41 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.


 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Nov 21 11:01:29 2024 UTC