[prev in list] [next in list] [prev in thread] [next in thread] 

List:       php-doc-cvs
Subject:    [DOC-CVS] =?utf-8?q?svn:_/phpdoc/en/trunk/reference/var/functions/_is-callable.xml?=
From:       Christoph_Michael_Becker <cmb () php ! net>
Date:       2016-06-25 15:13:40
Message-ID: svn-cmb-1466867620-339491-432272624 () svn ! php ! net
[Download RAW message or body]

cmb                                      Sat, 25 Jun 2016 15:13:40 +0000

Revision: http://svn.php.net/viewvc?view=revision&revision=339491

Log:
Fix #64221: is_callable() reports constructors as not callable

Bug: https://bugs.php.net/64221 (Verified) is_callable() reports constructors as not callable
      
Changed paths:
    U   phpdoc/en/trunk/reference/var/functions/is-callable.xml

Modified: phpdoc/en/trunk/reference/var/functions/is-callable.xml
===================================================================
--- phpdoc/en/trunk/reference/var/functions/is-callable.xml	2016-06-25 14:42:12 UTC (rev 339490)
+++ phpdoc/en/trunk/reference/var/functions/is-callable.xml	2016-06-25 15:13:40 UTC (rev 339491)
@@ -121,6 +121,39 @@
 ]]>
     </programlisting>
    </example>
+   <example>
+    <title><function>is_callable</function> and constructors</title>
+    <simpara>
+     As of PHP 5.3.0 <function>is_callable</function> reports constructors as
+     not being callable. This affects PHP 5 style constructors
+     (<literal>__construct</literal>) as well as PHP 4 stlye constructors (i.e.
+     methods with the same name as the class). Formerly, both cases have been
+     considered callable.
+    </simpara>
+    <programlisting role="php">
+<![CDATA[
+<?php
+
+class Foo
+{
+    public function __construct() {}
+    public function foo() {}
+}
+
+var_dump(
+    is_callable(array('Foo', '__construct')),
+    is_callable(array('Foo', 'foo'))
+);
+]]>
+    </programlisting>
+    &example.outputs;
+    <screen>
+<![CDATA[
+bool(false)
+bool(false)
+]]>
+    </screen>
+   </example>
   </para>
  </refsect1>




-- 
PHP Documentation Commits Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic