PHP syntax for dereferencing function result

后端 未结 22 869
不知归路
不知归路 2020-11-22 02:14

Background

In every other programming language I use on a regular basis, it is simple to operate on the return value of a function without declaring

22条回答
  •  别跟我提以往
    2020-11-22 02:56

    After further research I believe the answer is no, a temporary variable like that is indeed the canonical way to deal with an array returned from a function.

    Looks like this will change starting in PHP 5.4.

    Also, this answer was originally for this version of the question:

    How to avoid temporary variables in PHP when using an array returned from a function

提交回复
热议问题