Re: [RFC] Partial Function Application v2

From: Date: Mon, 13 Oct 2025 21:00:14 +0000
Subject: Re: [RFC] Partial Function Application v2
References: 1 2 3 4 5 6  Groups: php.internals 
Request: Send a blank email to internals+get-128827@lists.php.net to get a copy of this message
Hi

I'll give the RFC another read at a later point, but I wanted to get something out before I forget:

Am 2025-10-13 20:23, schrieb Larry Garfield:
- How does it interact with compact(), specifically:
     $partial = compact(someValue(), ?);
Would the ? be able to capture a variable containing the return value of someValue()?
Good question! compact(), extract(), etc. can't actually work with PFA, because they operate on the ambient context, which PFA by design changes. I've updated the RFC to note three incompatible core functions. (The other is func_get_arg()).
- get_defined_vars() should be added to the list (possibly more?). Or to make things easier: Just say everything that doesn't already work with FCC will not work with PFA either. - What will happen with assert(?)? Assert is special in that it captures the AST at compile time to render it in the error message. So specifically:
    $x = assert(?);
    assert(false); // How will the AssertionError look like?
Best regards Tim Düsterhus

Thread (54 messages)

« previous php.internals (#128827) next »