|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2003-12-29 09:05 UTC] derick@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Wed Dec 03 20:00:01 2025 UTC |
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