KS2006
Une fn est affichée au lieu d’être appelée. L’affichage d’une fn, ou son insertion dans un texte, montre son propre code, car rien ne l’appelle. Cela arrive surtout avec un tube : le corps d’une fn s’étend jusqu’à la fin de la ligne, donc |> call(...) placé après elle fait partie du corps. Mettez la fn entre crochets pour que l’appel soit fait sur elle. La correction rapide le fait.
<echo value="fn(width, height) => $width * $height |> call(6, 7)" /> <!-- warning: prints the fn's code -->
<echo value="(fn(width, height) => $width * $height)->call(6, 7)" /> <!-- right: 42 -->
<echo value="(fn(width, height) => $width * $height) |> call(6, 7)" /> <!-- right: 42, the brackets end the fn -->echo fn(width, height) => $width * $height |> call(6, 7) // warning: prints the fn's code
echo (fn(width, height) => $width * $height)->call(6, 7) // right: 42
echo (fn(width, height) => $width * $height) |> call(6, 7) // right: 42, the brackets end the fn