php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #46813 class_exists doesn`t work with fully qualified namespace
Submitted: 2008-12-09 17:20 UTC Modified: 2008-12-10 11:52 UTC
From: php at mobhoc dot de Assigned:
Status: Closed Package: Class/Object related
PHP Version: 5.3CVS-2008-12-09 (snap) OS: Gentoo Linux
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: php at mobhoc dot de
New email:
PHP Version: OS:

 

 [2008-12-09 17:20 UTC] php at mobhoc dot de
Description:
------------
The function class_exists doesn`t work with a fully qualified namespace.

Reproduce code:
---------------
namespace test;
{
	class inner
	{
		
	}
}

$inner = new \test\inner();

var_dump(class_exists('\test\inner', false));

Expected result:
----------------
true

Actual result:
--------------
false

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2008-12-09 19:19 UTC] johannes@php.net
This bug has been fixed in CVS.

Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
http://snaps.php.net/.
 
Thank you for the report, and for helping us make PHP better.


 [2008-12-10 11:52 UTC] php at mobhoc dot de
The function interface_exists has the same behaviour.

namespace test;
{
	interface inner
	{
		
	}
}

var_dump(interface_exists('\test\inner', false)); # false
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Wed Feb 05 19:01:31 2025 UTC