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

Pull Requests

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: Mon Dec 02 17:01:35 2024 UTC