php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #2653 Constants defined but not viewable
Submitted: 1999-11-02 19:36 UTC Modified: 2000-08-17 15:40 UTC
From: leon at clearink dot com Assigned:
Status: Closed Package: Parser error
PHP Version: 3.0.12 OS: Solaris
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.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: leon at clearink dot com
New email:
PHP Version: OS:

 

 [1999-11-02 19:36 UTC] leon at clearink dot com
<?
	function test()
	{
		if(defined("SOME_CONSTANT")) print("YES: ");
		
		print(SOME_CONSTANT);
	}

	define("SOME_CONSTANT", "the value of the constant");

	
	test();
?>

This produces "YES: SOME_CONSTANT".  I know I may be using constants in an unintended way, but I'd like to set a constant value sometime after I've defined a function that uses it.  If this use is disallowed, I'm cool with that decision, but in that case, I'd like to see a parse error about an unrecognized token.

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2000-08-17 15:40 UTC] hholzgra@php.net
fixed in php4 (although still present in 3.0.16)
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Apr 25 01:01:30 2024 UTC