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
 [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

Add a Patch

Pull Requests

Add a Pull Request

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-2024 The PHP Group
All rights reserved.
Last updated: Tue Mar 19 07:01:29 2024 UTC