|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2007-04-30 16:06 UTC] tony2001@php.net
[2007-04-30 16:13 UTC] laurynas at by dot lt
[2007-04-30 16:52 UTC] johannes@php.net
[2007-04-30 17:15 UTC] laurynas at by dot lt
|
|||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Tue Oct 28 18:00:01 2025 UTC |
Description: ------------ Array values are destroyed after using it as reference in function call defining in call dirrectly as array. If given array is constructed before function call in the same parameters line, PHP returns nothing, but really shoud return a value associated to array. Reproduce code: --------------- <?php // this is our defined function // as you can see the second parameter is reference function someFunc($param1, & $array) { // so expecting $array as array we // put some value in it $array[0] = 'some value'; } // now call the function, please note, that array $user // is created as array type *outside* function someFunc(null, $user = array()); // now let's check returned value print_r($user); ?> Expected result: ---------------- Array ( [0] => some value ) Actual result: -------------- Array ( )