|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2011-02-24 15:39 UTC] 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)
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sun Oct 26 17:00:01 2025 UTC |
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 ?