#35706 [Opn->Fbk]: Constants defined even when they are no randomly

From: Date: Fri, 16 Dec 2005 15:34:30 +0000
Subject: #35706 [Opn->Fbk]: Constants defined even when they are no randomly
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-90552@lists.php.net to get a copy of this message
 ID:               35706
 Updated by:       sniper@php.net
 Reported By:      andy at mandlnet dot co dot uk
-Status:           Open
+Status:           Feedback
 Bug Type:         Unknown/Other Function
 Operating System: Linux
 PHP Version:      4.4.1
 New Comment:

Please try using this CVS snapshot:

  http://snaps.php.net/php5.1-latest.tar.gz
 
For Windows:
 
  http://snaps.php.net/win32/php5.1-win32-latest.zip




Previous Comments:
------------------------------------------------------------------------

[2005-12-16 16:28:29] andy at mandlnet dot co dot uk

I have now downgraded to 4.3.10 so can not provide you with a URL for
examples however, If you create a new virtual host and a script
containing the following:
<?php
define('CMS_CONFIG_MYSQL_HOST','localhost');
define('CMS_CONFIG_MYSQL_USERNAME','username');
define('CMS_CONFIG_MYSQL_PASSWORD','password');
define('CMS_CONFIG_MYSQL_DATABASENAME','databasename');
echo "Constants Defined";
?>
Visit this site and then using a different virtual server on the same
physical server use the script posted earlier to display all
constants.
You may have to reload each page a few times before the constants are
displayed, but it does eventually.

------------------------------------------------------------------------

[2005-12-16 11:41:38] tony2001@php.net

Thank you for this bug report. To properly diagnose the problem, we
need a short but complete example script to be able to reproduce
this bug ourselves. 

A proper reproducing script starts with <?php and ends with ?>,
is max. 10-20 lines long and does not require any external 
resources such as databases, etc.

If possible, make the script source available online and provide
an URL to it here. Try to avoid embedding huge scripts into the report.



------------------------------------------------------------------------

[2005-12-16 11:31:39] andy at mandlnet dot co dot uk

Description:
------------
Defined constants appear to carry over occasionally between sites on
the same server. We have downgraded to PHP 4.3.10 now and this has
fixed the problem.

Reproduce code:
---------------
<?php
foreach(get_defined_constants() as $key => $value) {
  printf("%s = ", $key);
  var_dump($value);
}
?>

Expected result:
----------------
Sometimes you will get just a normal result, if you have a site on the
same server that uses defined constants sometimes they appear at the
bottom.
It should display all defined constants from 
E_ERROR = int(1) to GD_BUNDLED = int(0) as no others have been defined
in our script.

Actual result:
--------------
Occasionally we got :
CMS_VERSION_MAJ = int(4) CMS_VERSION_MIN = int(0) CMS_VERSION_INC =
int(3) CMS_VERSION = string(5) "4.0.3" CMS_CONFIG_SITENAME = string(11)
"<deleted>" CMS_CONFIG_CHIEF_EMAIL = string(21) "<deleted>"
CMS_CONFIG_ADMIN_CLIENTHELPCONTACT = string(58) "<deleted>" 

as well as constants defined for database conectivity. (username and
password) from other virtual hosts on the same server.


------------------------------------------------------------------------


-- 
Edit this bug report at http://bugs.php.net/?id=35706&edit=1


Thread (4 messages)

« previous php.bugs (#90552) next »