php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #47851 is_callable throws fatal error
Submitted: 2009-03-31 15:36 UTC Modified: 2009-04-02 09:57 UTC
From: mbeccati@php.net Assigned: dmitry (profile)
Status: Closed Package: Class/Object related
PHP Version: 5.3CVS-2009-03-31 (CVS) OS: Irrelevant
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: mbeccati@php.net
New email:
PHP Version: OS:

 

 [2009-03-31 15:36 UTC] mbeccati@php.net
Description:
------------
Under some circumstances is_callable() throws a fatal error when testing if the PHP4-style constructor of the class (e.g. is_callable(array('test1', 'test1')).

Unfortunately I wasn't able to create a self-contained example, but the issue seems to happen often when using Simpletest Mocks in the OpenX test suite.

It's ok if is_callable returns false if the method cannot be called statically, but definitely a fatal error isn't expected.

Reproduce code:
---------------
echo "Test";
is_callable(array('OX_Dal_Maintenance_Statistics', 'OX_Dal_Maintenance_Statistics'));

Expected result:
----------------
Test

Actual result:
--------------
Test
Fatal error: Non-static method OX_Dal_Maintenance_Statistics::OX_Dal_Maintenance_Statistics() cannot be called statically in ...

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2009-04-02 09:57 UTC] dmitry@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 12:01:29 2024 UTC