Re: RFC: Add `final class Vector` to PHP
| From: | Mike Schinkel | Date: | Sun, 19 Sep 2021 02:41:27 +0000 |
| Subject: | Re: RFC: Add `final class Vector` to PHP | ||
| References: | 1 2 3 4 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-116094@lists.php.net to get a copy of this message | ||
Hi Larry,
> On Sep 18, 2021, at 12:03 PM, Larry Garfield <larry@garfieldtech.com> wrote:
>
> Rather than go point by point, I'm going to respond globally here.
>
> I am frequently on-record hating on PHP arrays, and stating that I want something better. The
> problems with PHP arrays include:
>
> 1. They're badly performing (because they cannot be optimized)
> 2. They're not type safe
> 3. They're mutable
> 4. They mix sequences (true arrays) with dictionaries/hashmaps, making everything uglier
> 5. People keep using them as structs, when they're not
> 6. The API around them is procedural, inconsistent, and overall gross
> 7. They lack a lot of native shorthand operations found in other languages (eg, slicing)
> 8. Their error handling is crap
Would you mind elaborating on points #3 and #8?
It is not clear to me what you are getting at with those points.
-Mike