Skip to content
#externals

Search

68 results · page 1 of 4

  1. Barel ·

    … are over simple function composition (array_any was introduced for exactly this sort of job and is applicable to any function) I agree. Especially since the Partial Function Application RFC was accepted an ad-hoc implementation would just be: $str …

  2. Vadim Dvorovenko ·

    04.02.2026 04:58, Morgan: I'm wondering how this would relate to the function composition operator, noted in the follow-up RFC. Basically, would "return" make sense at the end of a function composition chain, and what sense …

  3. Larry Garfield ·

    … for that is already written, just needs code. I hope to formally propose it soon: https://wiki.php.net/rfc/function-composition Hmm, that's great, but looks like we are missing something. Would you propose the RFC to 8 …

  4. Larry Garfield ·

    … show how ugly it can get, but I can shorten it. About Haskell, rather than (or in addition to) the function composition [not "concatenation"] (.), I would mention the reverse application operator (&): https://hackage.haskell.org/package/base-4.15.0 …

  5. Bruce Weirdan ·

    … a small pedantry note - in a comparison section, the RFC compares this syntax to function composition. But this is not function composition. This is a syntax sugar for calling two functions one after another, not operator that produces a function …

  6. Larry Garfield ·

    … s not already a variable. My first thought there is to borrow the $$ variable name from Sara's old function composition proposal, but there may be others. There's likely other issues to discuss here but allowing expressions on …

  7. Andrea Faulds ·

    … mean by “functional primitives”, here are some examples: Function composition: a function that takes a function f($x) and a function g($y) and returns a new function($x) { return g(f($x)); }. Thus compose("trim", "strtoupper") returns a function …

  8. Yasuo Ohgaki ·

    … not There is no reason good enough for justifying yet another added endpoint that can even be implemented with simple function composition. OK. Thank you. You prefer full userland implementation. In addition to that, the lack of a strongly typed …

  9. Robert Stoll ·

    … least) in an E_NOTICE. But maybe that is something for PHP 8. I dislike this, because it punishes dynamic code (function composition). For example: $logUtility = partialLeft(function(string $a, string $b): void { syslog(LOG_INFO, $a . ": " . $b); }); $log = $log("

  10. Walter Parker ·

    … the order present means that there are not math operators that are right associative. This is not true. Assignment and function composition are right associative. As for why the exponent operator SHOULD (not must, should) be right assocative, let me …

  11. Stefan Marr ·

    … does not have any effect. Aliasing can be used to make a function accessible that has a naming conflict with another function. It enables composition of traits, but does not do anything with regard which function names a trait-functio

  12. Davey Shafik ·

    … setting up "run this function, pass its result to this function, pass its result to this function, etc." That makes composition really easy. |> is essentially a continuation syntax. The $$ is to work around the fact that PHP function can …

  13. Rowan Tommins ·

    Don't know if this already exists, but maybe we could consider brainstorming or gather alternatives for different types of encapsulation when using composition? Although not quite equivalent to your suggestions, these threads on making delegation to an encapsulated …

  14. Larry Garfield ·

    Hi, I've been thinking about how the language could better support Composition patterns like Decorators and Proxies, using some simple syntax sugar not dissimilar to Traits. Example problem: The other day, I was writing a session handler which …

  15. Levi Morrison ·

    … $initial, $data), but that's still 2 steps rather than 3. Genuine question, not a criticism - this functional(?) style of composition is not something I'm very familiar with. (For the same reason, I struggle to read that function definition …

  16. RFC Discussion Native Markup Expressions

    Garrett W. ·

    … native syntax for HTML fragments as first-class PHP expressions, akin to how the frontend community has adopted JSX, with composition and escape-by-default output: class Greeting implements Markup\Html { public function __construct(public string $name) {} public function toHtml …

  17. Robert Humphries ·

    … and the functions are not deprecated/warned against use/etc). That said, I certainly wouldn't be suggesting adding the function if it didn't already exist. But more over I don't even think you addition makes that much …

  18. ignace nyamagana butera ·

    … single implementation - the internal one. The situation I'm telling about is when one will accept an argument described as function (\Uri\WhatWg\Url $url) If the Url class is final, this signature means only one possible implementation can ever …

  19. Deleu ·

    … to avoid ambiguity would be throwing an exception instead of involving the key because involving the key can be a composition between array_first()* and array_key_first(). Although I would prefer the function to throw, I think it will …

  20. Larry Garfield ·

    … a while. The reason why I voted "no" is that this is feasible with a pipe(callable $first, callable ...$piped) function, without having to add syntax/AST for it. Type safety for such a closure would still be very messy …