Re: Error using Manuel's POP3 class

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hmm, I think the following both function calls produces the same result, 
were the second one is deprecated.

function foo(&$bar) {
    $bar .= " WORLD";
}
$tmp = "HELLO";
foo($tmp);
echo $tmp;

function bar($foo) {
    $foo .= " WORLD";
}
$tmp2 = "HELLO";
bar(&$tmp2);
echo $tmp2;


So why not change the deprecated function call to the working one?
If the function calls were only changed from foo(&$var) to foo($var)
the functions will not produce the expected results. They need to be 
changed, too!?



Manuel Lemos schrieb:
> 
> 
> Hello,
> 
> on 01/24/2008 01:56 PM Stephan Schulze said the following:
>  > You should get the newest version of the class.
>  >
>  > Or you fix it by replacing all calls with foo(&variable) to
>  > foo(variable) and change
> 
> That is the problem.
> 
>  > function foo(variable) to function foo(&variable)
> 
> Do not do this. This is not the problem. If you change this, the class
> will not be able to return values to variables passed by reference.
> 
> -- 
> 
> Regards,
> Manuel Lemos
> 
> PHP professionals looking for PHP jobs
> http://www.phpclasses.org/professionals/ 
> <http://www.phpclasses.org/professionals/>
> 
> PHP Classes - Free ready to use OOP components written in PHP
> http://www.phpclasses.org/ <http://www.phpclasses.org/>
> 
> 

-- 

.. UND EIN RIESIGES SCHAF WIRD VOM HIMMEL FALLEN UND DIE WELT RETTEN!!!
ACH IHR GLÜCKLICHEN  ;-)

[Index of Archives]     [PHP Home]     [PHP Users]     [PHP Soap]     [Kernel Newbies]     [Yosemite]     [Yosemite Campsites]

  Powered by Linux