|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2002-06-27 05:20 UTC] miguel at ipatimup dot pt
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.
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sat Dec 13 22:00:01 2025 UTC |
I, i'm sorry to upset you again....but i have some extra things to tell you about the bug: The code seams to be right, doesnt it? Please take a look at the explanations below. >$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 > ); Output: BEFORE:temp_file_path=/temp/x/1234.IMG.gz<BR>interfile_final_path=/t >$file_name = $interf->getFileName(); >printf("<P>AFTER:temp_file_path=%s<BR>interfile_final_path=%s</P>", $temp_f Output: AFTER:temp_file_path=/temp/x/1234<BR>interfile_final_path=/temp/1234 After this line, var $temp_file_path has changed...reason???? If i comment out the getFileName() line, the output is correct. It seams that PHP is executing something like: $temp_file_name = $file_name after getFileName() method. Again, i'm very sorry if you dont think this a bug, but this anormal beaviour isnt right. Dont you agree? Regards MiguelI, here are the requested lines: $temp_file_path = "/home/mnuc/x/1234.IMG.gz"; $interfile_final_path = "/home/mnuc/1234.IMG.gz"; $full_file_path = $temp_file_path; printf("<P>BEFORE:temp_file_path=%s<BR>interfile_final_path=%s</P>", $temp_file_path,$interfile_final_path ); $ficheiro_nome = basename( $full_file_path, ".IMG.gz"); printf("<P>AFTER: temp_file_path=%s<BR>interfile_final_path=%s</P>", $temp_file_path,$interfile_final_path ); die(); Regards, Miguel