php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #42820 defined() on constant with namespace prefixes tries to load class
Submitted: 2007-10-01 19:23 UTC Modified: 2007-10-03 10:38 UTC
From: bs@php.net Assigned: dmitry (profile)
Status: Closed Package: Scripting Engine problem
PHP Version: 5CVS-2007-10-01 (CVS) OS:
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: bs@php.net
New email:
PHP Version: OS:

 

 [2007-10-01 19:23 UTC] bs@php.net
Description:
------------
i don't know if it's right to expect a class named foo here, but anyway  it should be possible to check for a constant within a namespace

Reproduce code:
---------------
<?php
namespace foo;
var_dump(defined("foo::BAR"));

Expected result:
----------------
false

Actual result:
--------------
Fatal error: Class 'foo' not found in ... on line 3

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2007-10-03 10:38 UTC] dmitry@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: Mon Dec 08 12:00:01 2025 UTC