From:             piotrek at salaciak dot net
Operating system: win 2003 + iis 6
PHP version:      5.1.2
PHP Bug Type:     Variables related
Bug description:  assigment operator and calling function with by ref variable

Description:
------------
I've made a block plugin for smarty templates library, it's working fine
on PHP 5.1.1 and earlier, but not on 5.1.2. The reproduce code is just
minimized to show how it works and how should it work.

Reproduce code:
---------------
$a = true;
while($a){
     fun1($a = false);
}

// ---------------------
$iterator = 0;
function fun1(&$repeat){
     global $iterator;
     if ($iterator > 10)
          $repeat = true;
     iterator++;
}

changing code of while to making it work as expected:
$a = true;
while($a){
     $a = false
     fun1($a);
}

Expected result:
----------------
more than 1 iteration should be executed, 

Actual result:
--------------
while executed once.

-- 
Edit bug report at http://bugs.php.net/?id=36948&edit=1
-- 
Try a CVS snapshot (PHP 4.4): 
http://bugs.php.net/fix.php?id=36948&r=trysnapshot44
Try a CVS snapshot (PHP 5.1): 
http://bugs.php.net/fix.php?id=36948&r=trysnapshot51
Try a CVS snapshot (PHP 6.0): 
http://bugs.php.net/fix.php?id=36948&r=trysnapshot60
Fixed in CVS:                 http://bugs.php.net/fix.php?id=36948&r=fixedcvs
Fixed in release:             
http://bugs.php.net/fix.php?id=36948&r=alreadyfixed
Need backtrace:               http://bugs.php.net/fix.php?id=36948&r=needtrace
Need Reproduce Script:        http://bugs.php.net/fix.php?id=36948&r=needscript
Try newer version:            http://bugs.php.net/fix.php?id=36948&r=oldversion
Not developer issue:          http://bugs.php.net/fix.php?id=36948&r=support
Expected behavior:            http://bugs.php.net/fix.php?id=36948&r=notwrong
Not enough info:              
http://bugs.php.net/fix.php?id=36948&r=notenoughinfo
Submitted twice:              
http://bugs.php.net/fix.php?id=36948&r=submittedtwice
register_globals:             http://bugs.php.net/fix.php?id=36948&r=globals
PHP 3 support discontinued:   http://bugs.php.net/fix.php?id=36948&r=php3
Daylight Savings:             http://bugs.php.net/fix.php?id=36948&r=dst
IIS Stability:                http://bugs.php.net/fix.php?id=36948&r=isapi
Install GNU Sed:              http://bugs.php.net/fix.php?id=36948&r=gnused
Floating point limitations:   http://bugs.php.net/fix.php?id=36948&r=float
No Zend Extensions:           http://bugs.php.net/fix.php?id=36948&r=nozend
MySQL Configuration Error:    http://bugs.php.net/fix.php?id=36948&r=mysqlcfg

Reply via email to