From:             strategycon at yahoo dot com
Operating system: Ubuntu
PHP version:      5.3Git-2013-07-11 (snap)
Package:          Reflection related
Bug Type:         Feature/Change Request
Bug description:function_exist() returns false when using imported namespace 
alias

Description:
------------
namespace mynamespace;

use Symfony\Component\Validator\Constraints as Assert;

class myClass
{
    function classExists($name == 'NotBlank')
    {
        return function_exists('Assert\\' . $name)
    }

    function classExistsExt($name == 'NotBlank')
    {
        return function_exists('Symfony\Component\Validator\Constraints\\'
. 
$name)
    }
}

myClass::classExists()
// returns false

myClass::classExists()
// returns true



Expected result:
----------------
To fully benefit from namespace importing and "aliasing", I would expect
that 
method to return true when namespace alias is used instead of full/original
one.


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

Reply via email to