Hi

Am 2025-10-14 15:29, schrieb Larry Garfield:
I've added assert() and get_defined_vars() to the list, and relabeled it to be incomplete. I also added a note about FCC and it being the same list.

assert() *is* compatible with FCC:

    <?php
    $f = assert(...);
    $f(1 < 0);

This will print:

    Fatal error: Uncaught AssertionError in /tmp/test.php:3

without any stringified expression. I assume it will be the same with PFA then? Or will that print something like this:

    Uncaught AssertionError: assert(?) in /tmp/test.php:4

--------------------

Some more notes:

1.

The desugaring in the RFC shows non-static Closures only. This makes sense to me for simplicity. The RFC should however explicitly specify whether or not the resulting Closures will be static Closures or not (or which conditions need to folks for them to be static). This is important to know, because non-static Closures might keep objects alive for longer than necessary or expected.

2.

I am noticing that the error messages are quite inconsistent with existing error messages:

not enough arguments or placeholders for application of stuff, 1 given and at least 4 expected"

vs

    json_encode() expects at least 1 argument, 0 given

So it should probably be:

Partial application of json_encode() expects at least 1 argument or placeholder, 0 given

or something similar. Can you please double-check all the error messages in the implementation for consistency with existing error messages?

Best regards
Tim Düsterhus

Reply via email to