Doc #64221 [Asn->Ver]: is_callable() reports constructors as not callable
| From: | cmb@php.net | Date: | Sat, 25 Jun 2016 14:56:23 +0000 |
| Subject: | Doc #64221 [Asn->Ver]: is_callable() reports constructors as not callable | ||
| References: | 1 | Groups: | php.doc.bugs |
| Request: | Send a blank email to doc-bugs+get-13606@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=64221&edit=1
ID: 64221
Updated by: cmb@php.net
Reported by: wowkise at gmail dot com
-Summary: incomplete manual
+Summary: is_callable() reports constructors as not callable
-Status: Assigned
+Status: Verified
Type: Documentation Problem
-Package: Documentation problem
+Package: Variables related
PHP Version: 5.4.11
-Assigned To: kriscraig
+Assigned To: cmb
Block user comment: N
Private report: N
Previous Comments:
------------------------------------------------------------------------
[2013-02-15 19:48:08] 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)
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=64221&edit=1