2023-07-18 14:48 GMT+02:00, someniatko <somenia...@gmail.com>:
> I am glad this topic arose! I was also planning to write on this topic to
> the internals mailing list, but have abandoned this idea, because I feel it
> might be inconvenient for the real active PHP developers on the list to
> receive too many emails from the people which don't actively participate in
> the development itself.
>
> My interest in the pipe operator might seem a little non-standard -
> basically what I'd really want to see is a **nullable** pipe operator!
>
> There is a popular library github.com/schmittjoh/php-option, which has 250
> MILLION installations. Basically what it provides is a class-wrapper of a
> value of lack thereof: it's either `Some<Type>` or `None`.

I'd just like to mention that the Option type comes from FP and it's
not necessarily needed in PHP-land where we have flow-sensitive type
checkers like Psalm (a nullable type `?int` or such is refined to just
`int` after a null check). Flow-sensitive type-checking was not
invented when the Option type was first created, so adding it to PHP
is basically stepping back in time, from my point of view.

Olle

-- 
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: https://www.php.net/unsub.php

Reply via email to