| 
        php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login | 
 PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits             
             [2000-06-15 21:25 UTC] venaas at cvs dot php dot net
  | 
    |||||||||||||||||||||||||||
            
                 
                Copyright © 2001-2025 The PHP GroupAll rights reserved.  | 
        Last updated: Tue Nov 04 09:00:01 2025 UTC | 
The following code demonstrates the 'feature' ... <CODE> function myfunc(&$value, $key, &$user) { $value = "$user:$value"; $user++; printf("%3d : %s\n", $key, $value); } $myarray=array("one", "two", "three"); $myvar=1; array_walk($myarray, "myfunc", $myvar); echo "myvar=$myvar"; </CODE> This code outputs the following ... <SAMP> 0 : 1:one 1 : 2:two 2 : 3:three myvar=1 </SAMP> myvar has been incremented between calls within array_walk but the final value is not passed back to the original variable. I understand that the above usage is not mentioned in the docs but it would be a nice feature to have. The current functionality seems to be somewhat inconsistent and I doubt its usefulness.