|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #54091 class_exists fail with a class name alias
Submitted: 2011-02-24 15:39 UTC Modified: 2011-02-25 10:36 UTC
From: jinmoku at hotmail dot com Assigned:
Status: Not a bug Package: Class/Object related
PHP Version: 5.3.5 OS:
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Bug Type:
From: jinmoku at hotmail dot com
New email:
PHP Version: OS:


 [2011-02-24 15:39 UTC] jinmoku at hotmail dot com
class_exists fail with a class name alias, ReflectionClass too

Test script:
use \stdClass as object;
var_dump(new object);

Expected result:
object(stdClass)#1 (0) {

Actual result:
object(stdClass)#1 (0) {


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2011-02-24 16:00 UTC]
-Status: Open +Status: Bogus
 [2011-02-24 16:00 UTC]
Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at and the instructions on how to report
a bug at
 [2011-02-24 16:14 UTC] 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-25 10:36 UTC] jinmoku at hotmail dot com
try another thing : 

use \PDO as mysql;
var_dump(method_exists('mysql', '__construct'));
var_dump(method_exists('\PDO', '__construct'));

something wrong no ?
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Wed Jul 17 20:01:29 2024 UTC