Bug #18013: Local variable losing value

From: Date: Thu, 27 Jun 2002 09:20:56 +0000
Subject: Bug #18013: Local variable losing value
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-12216@lists.php.net to get a copy of this message
From: miguel@ipatimup.pt Operating system: Linux 2.2.16 - Suse 7.x PHP version: 4.2.1 PHP Bug Type: Variables related Bug description: Local variable losing value This is a big snip of the code: $temp_file_path="/temp/x/1234.IMG.gz"; $interfile_final_path="/temp/1234.IMG.gz"; printf("<P>BEFORE:temp_file_path=%s<BR>interfile_final_path=%s</P>", $temp_file_path,$interfile_final_path ); $file_name = $interf->getFileName(); printf("<P>AFTER:temp_file_path=%s<BR>interfile_final_path=%s</P>", $temp_file_path,$interfile_final_path ): Object $interf, is a class created by me. The method getFileName() of the class is implemented like this: function getFileName() { $aux = $this->_getFileName(); //print "aux= $aux<BR>"; $ret = basename( $aux, ".IMG.gz" ); //print "ret=$ret<BR>"; return $ret; } My problem is that var $temp_file_path after a call to method getFileName, gets the value returned by getFileName Is there any way of knowing the address( pointer like ) of a variable? My configure line: './configure' '--with-apxs=/usr/local/apache/bin/apxs' '--with-pgsql' '--with-oci8=/usr/local/oracle' '--with-oracle=/usr/local/oracle' '--with-debug' Also, ftp functions are active. If any adicional information is needed please let me know. -- Edit bug report at http://bugs.php.net/?id=18013&edit=1 -- Fixed in CVS: http://bugs.php.net/fix.php?id=18013&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=18013&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=18013&r=needtrace Try newer version: http://bugs.php.net/fix.php?id=18013&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=18013&r=support Expected behavior: http://bugs.php.net/fix.php?id=18013&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=18013&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=18013&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=18013&r=globals

« previous php.bugs (#12216) next »