php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #2084 Constants don't get recognized
Submitted: 1999-08-17 06:53 UTC Modified: 2000-07-18 10:53 UTC
From: emilio_tunon at nl dot compuware dot com Assigned:
Status: Closed Package: Other
PHP Version: 3.0.9 OS: Linux (Red Hat 6.0)
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: emilio_tunon at nl dot compuware dot com
New email:
PHP Version: OS:

 

 [1999-08-17 06:53 UTC] emilio_tunon at nl dot compuware dot com
Using something like xxtest.php3 it does not seem to 
recognize/acknowledge the constant definitons, the
return value of define shows ok but when the constant
actually gets used it does not become translated,
instead one gets the constant name (XXTOP). I tried 
infinite times without success, even restarted the
web server. At some point, all of a sudden it started
working. I implemented then something else following
the same approach and then again the original was
working but the 'cloned' one was not working.

The same happened when trying to load the
define'd constants from a file with include(). And
in this case require() would not even work.

--- xxpaths.php3 ---
function xxPaths() {
    global $SERVER_NAME;
    if ($SERVER_NAME == "www.production.com") {
      $home = "/usr/home/someone";
      $whome = "$home/www";
      $top = $SERVER_NAME;
   } else {
      $home = "/home/someone";
      $whome = "$home/public_html";
      $top = "homehost.isp.com/~someone";
   }
   define("XXTOP", "http://$top");
   define("XXHOME", "$home");
  define("XXWHOME', "$whome");
}
----- xxtest.php3 ------
include("xxpaths.php3");
xxPaths();
print( XXTOP . "/php3lib");

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2000-07-18 10:53 UTC] hholzgra at cvs dot php dot net
can't reproduce in latest php 3 or 4 cvs
so i assume it was solved a long time ago ...
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Wed May 15 18:01:34 2024 UTC