#29210 [Asn->Csd]: Function: is_callable - no support for private and protected classes
| From: | dmitry@php.net | Date: | Wed, 27 Apr 2005 15:46:03 +0000 |
| Subject: | #29210 [Asn->Csd]: Function: is_callable - no support for private and protected classes | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-78300@lists.php.net to get a copy of this message | ||
ID: 29210
Updated by: dmitry@php.net
Reported By: freeload at softhome dot net
-Status: Assigned
+Status: Closed
Bug Type: Zend Engine 2 problem
Operating System: *
PHP Version: 5CVS-2005-03-07
Assigned To: andi
New Comment:
Fixed in CVS HEAD and PHP_5_0.
Previous Comments:
------------------------------------------------------------------------
[2005-03-07 20:12:01] sniper@php.net
Andi, check the patch please.
------------------------------------------------------------------------
[2004-08-29 06:53:25] tony2001@php.net
This patch should fix the bug:
http://tony2001.phpclub.net/dev/tmp/is_callable.diff
test file:
http://tony2001.phpclub.net/dev/tmp/is_callable.phpt
------------------------------------------------------------------------
[2004-07-16 15:07:46] freeload at softhome dot net
Description:
------------
The built in function is_callable, does not return false, on
unreachable functions like protected and private ones.
Reproduce code:
---------------
<?php
class test_class {
private function test_func1(){}
protected function test_func2(){}
}
$object = new test_class;
var_dump(is_callable(array($object,'test_func1')));
echo chr(10);
var_dump(is_callable(array($object,'test_func2')));
?>
Expected result:
----------------
bool(false)
bool(false)
Actual result:
--------------
bool(true)
bool(true)
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=29210&edit=1