Req #65244 [Opn]: function_exist() returns false when using imported namespace alias
| From: | ab@php.net | Date: | Fri, 12 Jul 2013 12:30:03 +0000 |
| Subject: | Req #65244 [Opn]: function_exist() returns false when using imported namespace alias | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-180215@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=65244&edit=1
ID: 65244
Updated by: ab@php.net
Reported by: strategycon at yahoo dot com
Summary: function_exist() returns false when using imported
namespace alias
Status: Open
Type: Feature/Change Request
Package: Reflection related
Operating System: Ubuntu
PHP Version: 5.3Git-2013-07-11 (snap)
Block user comment: N
Private report: N
New Comment:
Compile vs. execution phase is that.
Previous Comments:
------------------------------------------------------------------------
[2013-07-11 15:47:36] strategycon at yahoo dot com
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 this bug report at https://bugs.php.net/bug.php?id=65244&edit=1