Re: A little syntactic sugar on array_* function calls?
| From: | Hendra Gunawan | Date: | Wed, 26 May 2021 23:44:40 +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-114629@lists.php.net to get a copy of this message | ||
Hello.
>
> Yes, but Nikita wrote this note about technical limitations at the bottom of the repo README:
>
> Due to technical limitations, it is not possible to create mutable APIs for
> primitive types. Modifying $self within the methods is not possible (or
> rather, will have no effect, as you'd just be changing a copy).
>
If it is solved, this is a great accomplishment for PHP. But I think
scalar object is not going anywhere in the near future. If you are not
convinced, please take a look
https://github.com/nikic/scalar_objects/issues/20#issuecomment-569520181.
This makes me have a strong feeling about pipe operator greater than
before to solve object-style for scalar issue.
I hope that someone will take an initiative to fix the old
inconsistent and confusing API.
Pipe operator+new API is a better solution than no solution at all.