php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #64221 is_callable() reports constructors as not callable
Submitted: 2013-02-15 19:48 UTC Modified: 2016-06-25 15:14 UTC
From: wowkise at gmail dot com Assigned: cmb (profile)
Status: Closed Package: Variables related
PHP Version: 5.4.11 OS:
Private report: No CVE-ID: None
 [2013-02-15 19:48 UTC] wowkise at gmail dot com
Description:
------------
---
From manual page: http://www.php.net/function.is-callable#refsect1-function.is-callable-examples
---

The Manual should clearly states that calling "is_callable()" on class that has a method with holds the same name as the className will return false for backwards compatibility. i wasted hours trying to understand why until i hit a bug that dealt with this issue. 

Test script:
---------------
class test
{
    public function __construct() {}
    public function test() {}
}

var_dump( is_callable( ['test','test'] ) );


Expected result:
----------------
it should return Boolean(true), but for compatibility reasons its returns 
Boolean(false), which in my opinion makes no since if the class has __construct()

Actual result:
--------------
Boolean(false) 

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2013-02-19 18:32 UTC] kriscraig@php.net
-Status: Open +Status: Assigned -Assigned To: +Assigned To: kriscraig
 [2016-06-25 14:56 UTC] cmb@php.net
-Summary: incomplete manual +Summary: is_callable() reports constructors as not callable -Status: Assigned +Status: Verified -Package: Documentation problem +Package: Variables related -Assigned To: kriscraig +Assigned To: cmb
 [2016-06-25 15:13 UTC] cmb@php.net
Automatic comment from SVN on behalf of cmb
Revision: http://svn.php.net/viewvc/?view=revision&revision=339491
Log: Fix #64221: is_callable() reports constructors as not callable
 [2016-06-25 15:14 UTC] cmb@php.net
-Status: Verified +Status: Closed
 [2016-06-25 15:14 UTC] cmb@php.net
This bug has been fixed in the documentation's XML sources. Since the
online and downloadable versions of the documentation need some time
to get updated, we would like to ask you to be a bit patient.

Thank you for the report, and for helping us make our documentation better.
 [2020-02-07 06:07 UTC] phpdocbot@php.net
Automatic comment on behalf of cmb
Revision: http://git.php.net/?p=doc/en.git;a=commit;h=4a5de0c62d4bd48fbca835d3fdc0dbed0d5d7018
Log: Fix #64221: is_callable() reports constructors as not callable
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Mar 28 23:01:26 2024 UTC