Re: A little syntactic sugar on array_* function calls?
| From: | Hossein Baghayi | Date: | Wed, 26 May 2021 10:29:37 +0000 |
| Subject: | Re: A little syntactic sugar on array_* function calls? | ||
| References: | 1 2 3 4 5 6 7 8 9 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-114609@lists.php.net to get a copy of this message | ||
On Wed, 26 May 2021 at 10:14, Hamza Ahmad <office.hamzaahmad@gmail.com>
wrote:
> Thus, array() or [] will return scaler array object,
>
Hello,
This doesn't seem trivial to me.
I mean, should array object be passed by value or by reference?
Arrays are passed by value by default so far, and objects are be-ref
internally.
If we are to have array object, will it be exceptional? Or should we change
its behaviour going forward?
To be clear, array() returns an array right now, which by default is passed
by value at the moment.
If it was supposed to be changed to an object, (array() to return an
object), should it be still passed by value? (an exceptional object) or we
should change its behaviour going forward and pass it by-ref?
Either way, it may have some quirks associated with it.