Hi Kalle, Thank you for the list. It's very helpful!
On Fri, Dec 5, 2014 at 4:58 AM, Kalle Sommer Nielsen <ka...@php.net> wrote: > 2014-12-04 9:28 GMT+01:00 Yasuo Ohgaki <yohg...@ohgaki.net>: > > Any comments? > > > > Regards, > > > > -- > > Yasuo Ohgaki > > yohg...@ohgaki.net > > I think we should solve these on a case-by-case basis, I can think of > one reason why the warning exists, and that is because it modifies the > array pointer and the argument is sent by reference. But I think we > can safely remove the warning if the parameter was not sent by > reference, as then we would expect the user to use the return value of > array_pop() to assign the value from. I don't think we should remove > warnings if you pass a statically value to it, sure some APIs can > return a variable length/dynamic array but then I think they should be > referenced into a variable and then passed to the function as they are > most likely going to be used later, I can't really think of a case > where it would be useful to send a return value of some API call to > array_multisort() and then use the boolean true or false to check if > it was a successful call for example.. > > For functions like next() that only supports taking the argument by > reference, this should remain (since the return value is the internal > array pointer position). > > I went over the manual and the following should remain that warning: > array_multisort() > array_push() > array_shift() > array_unshift() > array_walk() > array_walk_recursive() > asort() > arsort() > each() > ksort() > krsort() > natsort() > natcasesort() > reset() -- Debatable though (does not many any sense, but if current() > and family is, and this is not, it will make it inconsistent) > rsort() > shuffle() > sort() > usort() > uasort() > uksort() > Agreed. I would like to do like $var; array_walk(func(), function ($v, $k) use ($var) { $var .= $v.$k; }); though. > > > And the following can have the warning removed if the argument is not > passed by reference: > array_pop() > array_splice() > current() -- Debatable though > end() -- Debatable though (use array deferencing?) > extract() > key() -- Same as current() > next() -- Same as current() > prev() -- Same as current() > I think array_pop() array_splice() extract() These could be changed. First of all, removing warnings only for these is feasible in PHP7? We need Engine experts. Thank you. Does anyone object to remove warnings for these? Regards, -- Yasuo Ohgaki yohg...@ohgaki.net