On Thu, 10 Jun 2021 at 18:32, Guilliam Xavier <guilliam.xav...@gmail.com> wrote: > Since `$null?->whatever(1, 'a')` currently always > returns null without error, shouldn't `$null?->whatever(?, 'a')` return a > closure (with a signature built from the placeholders only) that will > return null when called (i.e. equivalent to `fn (mixed $arg1) => null` > here)?
No. The short circuiting should happen in the same place, no matter what is to the right of the "?->". Having the behaviour vary and sometimes not return null, would be highly surprising. cheers Dan Ack -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: https://www.php.net/unsub.php