php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #65108 is_callable() triggers Fatal Error
Submitted: 2013-06-24 09:55 UTC Modified: 2013-06-25 04:41 UTC
Votes:2
Avg. Score:4.0 ± 1.0
Reproduced:1 of 1 (100.0%)
Same Version:0 (0.0%)
Same OS:0 (0.0%)
From: miloslav dot hula at gmail dot com Assigned: laruence (profile)
Status: Closed Package: *General Issues
PHP Version: 5.5Git-2013-06-24 (snap) OS:
Private report: No CVE-ID: None
 [2013-06-24 09:55 UTC] miloslav dot hula at gmail dot com
Description:
------------
A Fatal Error is emmited when using is_callable() in static context on class with defined the __call() method and non-public non-static method simultaneously.

Similar to https://bugs.php.net/bug.php?id=33455.

Test script:
---------------
class C {
    private function f() {}
    function __call($name, $args) {}
}

$isCallable = is_callable(array('C', 'f'));

Expected result:
----------------
$isCallable is boolean

Actual result:
--------------
Fatal Error

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2013-06-24 10:01 UTC] miloslav dot hula at gmail dot com
I'm sorry. I forgot to add the Fatal Error message.

Fatal error: Call to private method C::f() from context '' in /home/milo/fat.php on line 8
 [2013-06-24 15:21 UTC] dsp@php.net
Automatic comment on behalf of dsp
Revision: http://git.php.net/?p=php-src.git;a=commit;h=ecd9d7625098bfc0a14ffa1fc39535848e71fc80
Log: Fix #65108 (is_callable() triggers Fatal Error)
 [2013-06-24 15:21 UTC] dsp@php.net
-Status: Open +Status: Closed
 [2013-06-24 18:55 UTC] miloslav dot hula at gmail dot com
Thank you for the fix.
 [2013-06-25 04:41 UTC] laruence@php.net
-Assigned To: +Assigned To: laruence
 [2013-06-25 04:41 UTC] laruence@php.net
hmm, didn't mention bug id in ci log.

here is the final fix:

https://github.com/php/php-src/commit/9cf3e65391d6aa637e5471449499e957cff6ee89
 [2013-11-17 09:30 UTC] laruence@php.net
Automatic comment on behalf of dsp
Revision: http://git.php.net/?p=php-src.git;a=commit;h=ecd9d7625098bfc0a14ffa1fc39535848e71fc80
Log: Fix #65108 (is_callable() triggers Fatal Error)
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sun Dec 22 05:01:30 2024 UTC