php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #29210 Function: is_callable - no support for private and protected classes
Submitted: 2004-07-16 15:07 UTC Modified: 2005-04-27 17:46 UTC
Votes:7
Avg. Score:4.7 ± 0.5
Reproduced:5 of 5 (100.0%)
Same Version:5 (100.0%)
Same OS:4 (80.0%)
From: freeload at softhome dot net Assigned: andi (profile)
Status: Closed Package: Scripting Engine problem
PHP Version: 5CVS-2005-03-07 OS: *
Private report: No CVE-ID: None
 [2004-07-16 15:07 UTC] 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)

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2005-03-07 20:12 UTC] sniper@php.net
Andi, check the patch please.

 [2005-04-27 17:46 UTC] dmitry@php.net
Fixed in CVS HEAD and PHP_5_0.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Nov 23 21:01:28 2024 UTC