php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #47593 interface_exists() returns false when using absolute namespace path
Submitted: 2009-03-08 00:14 UTC Modified: 2009-03-08 17:29 UTC
Votes:2
Avg. Score:4.5 ± 0.5
Reproduced:2 of 2 (100.0%)
Same Version:2 (100.0%)
Same OS:2 (100.0%)
From: crystality at mail dot ru Assigned: felipe (profile)
Status: Closed Package: Class/Object related
PHP Version: 5.3CVS-2009-03-08 (snap) OS: WinXpSP3
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: crystality at mail dot ru
New email:
PHP Version: OS:

 

 [2009-03-08 00:14 UTC] crystality at mail dot ru
Description:
------------
Looks like this is the windows version of bug #46813.

Function interface_exists() used without autoloading returns FALSE whith a fully qualified namespace.

class_exists() works ok. Well interface_exists() does work too but as long as leading backslash isn't there or with autoloading enabled.

Reproduce code:
---------------
namespace interfaces;
interface debug{}

var_dump(interface_exists("\interfaces\debug", false)); // FALSE

Expected result:
----------------
True

Actual result:
--------------
False

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2009-03-08 08:21 UTC] kalle@php.net
The following patch is just a port of the patch for class_exists() that resolves the bug:
http://paste2.org/p/160586 - PHP_5_3
 [2009-03-08 14:19 UTC] crystality at mail dot ru
When will a snapshot be available with the bug fixed?
 [2009-03-08 17:29 UTC] felipe@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.


 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Wed Feb 05 16:01:30 2025 UTC