[Phpmyadmin-devel] a PHP 5.1.2 bug?

Sebastian Mendel lists at sebastianmendel.de
Fri Jan 13 07:24:12 CET 2006


Garvin Hicking schrieb:
> Hi Sebastian!
> 
>> printLocalDate(time() + 60*60*24 * 12); // current time plus 12 days
>> and
>> myFunc($var = 'value');
>> is not much different, or?
> 
> Actually, this is much different. The first call doesn't need to to any variable
> assignment. The second call does, and needs to store it somewhere in memory.

yes, and store it in the memory on the address of $var! there is really
no logical reason for me why this should not work.


> Exactly this "store it in memory" has in the past time led to memory corruption,
> and was the reason why the PHP notice "Fatal error/Warning: Only variables can
> be passed by reference..." [1] was introduced, resulting in one really big BC
> break.
> 
> I think your method is a follow-up to that same problem, but it should also not
> have become changed without any notice in the ChangeLog. But it seems not many
> people use that mechanism, so it has/may not yet been reported. Which is all the
> more reason to post this report on bugs.php.net.
> 
> [1] http://cow.neondragon.net/index.php/375-Annoying-Things-About-Php
>     http://phplens.com/phpeverywhere/?q=node/view/214

this 'old' reference problem is known to me

i also have in mind that this new change with 5.1.2 has still something
to do with this, but not on the technical side but on the developer side
(as some developer changes this behavior or something what leads to this
new behavior with 'old' reference problem in mind), but i don't agree
that the old behavior was not correctly working or lead to any memory
corruption, the 'old' reference problem is a little bit different!

i give the function a valid variable, as required by call-by-reference,
i just assign a value just before passing it to the function!


p.s.: bist du auch auf der deutschen php mailingliste: php at phpbar.de?

-- 
Sebastian Mendel

www.sebastianmendel.de
www.sf.net/projects/phpdatetime | www.sf.net/projects/phptimesheet





More information about the Developers mailing list