0

An excerpt from the manual about the returned result:

The array. This array is passed by reference because it is modified by the function. This means you must pass it a real variable and not a function returning an array because only actual variables may be passed by reference.

I use end(explode( and it works without any warnings or notices, but I have PHP 5.4 on the localhost and the product requirements are "PHP 5.3 or higher". I read about the function array dereferencing which had appeared in 5.4, but I thought it worked only for the square brackets array element dereferencing.

Could somebody please clear the matter for me? Or at least give me some links about inner workings of PHP. There is a handy technical reference for JavaScript, I could make use of something like it for PHP.

4

1 に答える 1

1

As of PHP 5.4 it is possible to array dereference the result of a function or method call directly. Before it was only possible using a temporary variable.

it creates temporary variable automatically

于 2012-10-08T12:43:05.063 に答える