From:             hanskrentel at yahoo dot de
Operating system: 
PHP version:      5.4.11
Package:          Scripting Engine problem
Bug Type:         Feature/Change Request
Bug description:is_callable does not check syntax

Description:
------------
Using is_callable with the syntax_only parameter set to true does actually
*not* 
check the syntax, for example of a valid classname or FQCN.

Also not for the method name.

My feature request is, that it will always check those strings according to
the 
rules set in the PHP parser of the same PHP version the function ships with
so 
that it can be used to validate PHP syntax as well.

Same for calls with :: for static class name method calls.

Test script:
---------------
var_dump(is_callable(['', ''], true));
var_dump(is_callable(['', 'method'], true));
var_dump(is_callable(['0', 'method'], true));
var_dump(is_callable(['0\\foo', 'method'], true));
var_dump(is_callable(['\\0\\foo', 'method'], true));

Expected result:
----------------
bool(false)
bool(false)
bool(false)
bool(false)
bool(false)

Actual result:
--------------
bool(true)
bool(true)
bool(true)
bool(true)
bool(true)

-- 
Edit bug report at https://bugs.php.net/bug.php?id=64185&edit=1
-- 
Try a snapshot (PHP 5.4):   
https://bugs.php.net/fix.php?id=64185&r=trysnapshot54
Try a snapshot (PHP 5.3):   
https://bugs.php.net/fix.php?id=64185&r=trysnapshot53
Try a snapshot (trunk):     
https://bugs.php.net/fix.php?id=64185&r=trysnapshottrunk
Fixed in SVN:               https://bugs.php.net/fix.php?id=64185&r=fixed
Fixed in release:           https://bugs.php.net/fix.php?id=64185&r=alreadyfixed
Need backtrace:             https://bugs.php.net/fix.php?id=64185&r=needtrace
Need Reproduce Script:      https://bugs.php.net/fix.php?id=64185&r=needscript
Try newer version:          https://bugs.php.net/fix.php?id=64185&r=oldversion
Not developer issue:        https://bugs.php.net/fix.php?id=64185&r=support
Expected behavior:          https://bugs.php.net/fix.php?id=64185&r=notwrong
Not enough info:            
https://bugs.php.net/fix.php?id=64185&r=notenoughinfo
Submitted twice:            
https://bugs.php.net/fix.php?id=64185&r=submittedtwice
register_globals:           https://bugs.php.net/fix.php?id=64185&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=64185&r=php4
Daylight Savings:           https://bugs.php.net/fix.php?id=64185&r=dst
IIS Stability:              https://bugs.php.net/fix.php?id=64185&r=isapi
Install GNU Sed:            https://bugs.php.net/fix.php?id=64185&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=64185&r=float
No Zend Extensions:         https://bugs.php.net/fix.php?id=64185&r=nozend
MySQL Configuration Error:  https://bugs.php.net/fix.php?id=64185&r=mysqlcfg

Reply via email to