Edit report at https://bugs.php.net/bug.php?id=63422&edit=1

 ID:                 63422
 Comment by:         iblacksmoke at gmail dot com
 Reported by:        iblacksmoke at gmail dot com
 Summary:            incorrect work is_callable
 Status:             Not a bug
 Type:               Bug
 Package:            Scripting Engine problem
 PHP Version:        5.4.8
 Block user comment: N
 Private report:     N

 New Comment:

But its illogical behavior of function. From place, where check, I can call my 
function, but is_callable says its impossible.


Previous Comments:
------------------------------------------------------------------------
[2012-11-03 03:18:58] [email protected]

Sorry, but your problem does not imply a bug in PHP itself.  For a
list of more appropriate places to ask for help using PHP, please
visit http://www.php.net/support.php as this bug system is not the
appropriate forum for asking support questions.  Due to the volume
of reports we can not explain in detail here why your report is not
a bug.  The support channels will be able to provide an explanation
for you.

Thank you for your interest in PHP.

There is a bug in your code

it should be is_callable(array($this, $method))

------------------------------------------------------------------------
[2012-11-02 18:04:50] iblacksmoke at gmail dot com

Description:
------------
Is_callable function doesnt determine ability to call private method in class, 
even if this call made in context of class, from which you can call private 
function.

Test script:
---------------
class A {
        public function test($method){
                return (is_callable($this, $method)) ? 'yes' : 'no';
        }
        private function qwerty(){}
}

echo (new A)->test('qwerty');

Expected result:
----------------
yes

Actual result:
--------------
no


------------------------------------------------------------------------



-- 
Edit this bug report at https://bugs.php.net/bug.php?id=63422&edit=1

Reply via email to