[Phpmyadmin-devel] a PHP 5.1.2 bug?

Sebastian Mendel lists at sebastianmendel.de
Fri Jan 13 06:51:04 CET 2006


Garvin Hicking schrieb:
> Hi!
> 
> 
>> the problem is not that this variable is not assigned in the function call, but
>> it is assigned AFTER the function is executed:
> 
> [...]
> 
> This is a very good reduced example. I urgently suggest to post this on the PHP
> Bugtracker, no matter what you think of them - I agree that it is a  BC-break
> which should at least be documented in the ChangeLog of PHP5.

much more confusing:

<?php
function myFuncR(&$var)
{
    echo 'before inside function overwrite:';
    var_dump($var);
    echo "\n";
    $var = 9999;
    echo 'after inside function overwrite:';
    var_dump($var);
    echo "\n";
}

$var = 0;
echo 'before function call:';
var_dump($var);
echo "\n";
myFuncR($var = 20);
echo 'after function call:';
var_dump($var);
echo "\n";
?>

before function call:int(0)

before inside function overwrite:int(20)

after inside function overwrite:int(9999)

after function call:int(20)


-- 
Sebastian Mendel

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




More information about the Developers mailing list