note 57719 deleted from function.array-shift by nlopess
| From: | nlopess@php.net | Date: | Thu, 07 Sep 2006 14:59:12 +0000 |
| Subject: | note 57719 deleted from function.array-shift by nlopess | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-116836@lists.php.net to get a copy of this message | ||
Note Submitter: groups at 8legs dot co dot nz
----
As of version 5.0.5 it has been decreed that array_shift (and other methods that manipulate an
array, like: array_pop, array_push) can no longer accept a reference, only a value.
For example:
Until 5.0.5 this was perfectly acceptable:
$first_element = array_shift(functionThatReturnsAnArray());
now it would have to look a little like this:
$arbitrary_array = functionThatReturnsAnArray()
$first_element = array_shift($arbitrary_array);
or
$first_element = array_shift($arbitrary_array = functionThatReturnsAnArray());
The change apparently has something to do with possible memory corruption but that sounds like a cop
out to me. Fix the memory corruption if it's a problem, don't break a widely used and
hither-to perfectly legitimate piece of syntax, then foist it on an unsuspecting community in a
minor version change. Very unimpressed with the cavalier attitude regarding this issue.