Bug #54091 [Bgs]: class_exists fail with a class name alias
| From: | jinmoku at hotmail dot com | Date: | Fri, 25 Feb 2011 09:36:37 +0000 |
| Subject: | Bug #54091 [Bgs]: class_exists fail with a class name alias | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-159040@lists.php.net to get a copy of this message | ||
Edit report at http://bugs.php.net/bug.php?id=54091&edit=1
ID: 54091
User updated by: jinmoku at hotmail dot com
Reported by: jinmoku at hotmail dot com
Summary: class_exists fail with a class name alias
Status: Bogus
Type: Bug
Package: Class/Object related
PHP Version: 5.3.5
Block user comment: N
Private report: N
New Comment:
try another thing :
use \PDO as mysql;
var_dump(method_exists('mysql', '__construct'));
var_dump(method_exists('\PDO', '__construct'));
/*
bool(false)
bool(true)
*/
something wrong no ?
Previous Comments:
------------------------------------------------------------------------
[2011-02-24 16:14:19] jinmoku at hotmail dot com
Sorry, there is nothing about this in the documentation,
how I can make an instance of this class if it's doesn't exists ???
it's not logical
------------------------------------------------------------------------
[2011-02-24 16:00:04] johannes@php.net
Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.php.net/manual/ and the instructions on how to
report
a bug at http://bugs.php.net/how-to-report.php
http://php.net/manual/en/language.namespaces.dynamic.php
------------------------------------------------------------------------
[2011-02-24 15:39:51] jinmoku at hotmail dot com
Description:
------------
class_exists fail with a class name alias, ReflectionClass too
Test script:
---------------
use \stdClass as object;
var_dump(new object);
var_dump(class_exists('object'));
Expected result:
----------------
object(stdClass)#1 (0) {
}
bool(true)
Actual result:
--------------
object(stdClass)#1 (0) {
}
bool(false)
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/bug.php?id=54091&edit=1