#26740 [NEW]: Object Attribute Unexpectly Overwritten
| From: | leo at myleo dot info | Date: | Mon, 29 Dec 2003 13:43:01 +0000 |
| Subject: | #26740 [NEW]: Object Attribute Unexpectly Overwritten | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-52579@lists.php.net to get a copy of this message | ||
From: leo at myleo dot info
Operating system: Linux
PHP version: 5.0.0b2 (beta2)
PHP Bug Type: Scripting Engine problem
Bug description: Object Attribute Unexpectly Overwritten
Description:
------------
In the source code, $this->filepath is overwritten unexpectly in the
assignment
$this->$tempFilepath=$this->$filepath.".tmp";
Reproduce code:
---------------
class Zone{
var $path; // The path to store zone files
var $filepath; // The zone file with absolute filepath
var $tempFilepath; // Temporary file
var $domain; // Domain object
function Zone($domainTemp,$pathTemp){
if(preg_match("/^\//",$pathTemp)){
$this->$path=$pathTemp;
$this->$domain=new Domain($domainTemp.".");
$this->$filepath=$pathTemp."/".$domainTemp.".zone";
print $this->$filepath;
$this->$tempFilepath=$this->$filepath.".tmp";
print $this->$filepath;
...
...
Expected result:
----------------
I create the object
$zone=new Zone("mydomain.com","/var/named");
$this->$filepath should be /var/named.mydomain.com.zone
$this->$tempFilepath should be /var/named.mydomain.com.zone.tmp
Actual result:
--------------
both variable metioned above have the same value
/var/named.mydomain.com.zone.tmp
--
Edit bug report at http://bugs.php.net/?id=26740&edit=1
--
Try a CVS snapshot (php4): http://bugs.php.net/fix.php?id=26740&r=trysnapshot4
Try a CVS snapshot (php5): http://bugs.php.net/fix.php?id=26740&r=trysnapshot5
Fixed in CVS: http://bugs.php.net/fix.php?id=26740&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=26740&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=26740&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=26740&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=26740&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=26740&r=support
Expected behavior: http://bugs.php.net/fix.php?id=26740&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=26740&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=26740&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=26740&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=26740&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=26740&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=26740&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=26740&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=26740&r=float