Hi
Thank you. One note regarding the mailing list: Please do not “top
post”. Put your reply *below* the quoted original parts of the email you
are replying to and cut the quote to the relevant bits, just like I'm
doing here:
On 2026-10-27 11:35, Ayoub EZZINI wrote:
- Fixed the "[[], []]" rendering in "Semantics in detail".
One hint for the Wiki: Using `<php>` around code will perform the proper
escaping, and will also enable syntax highlighting.
- Replaced the stub in the proposal with a userland implementation
using foreach. While checking it against the native function, I found
one difference: the native function keeps by-reference elements as
references, like array_filter(), and the foreach version does not.
The RFC mentions it right below the code.
Good that I asked for the example implementation - and that you spelled
out the difference, because I did not realize the significance of the
“By-reference elements of the input are handled in the same way as in
array_filter()” in the “Semantics in detail” section - and there is no
corresponding example either. Can you please add another “edge case”
example that clearly shows the reference handling behavior to make sure
every reader is aware of the full implications.
I'm also not sure, I like the fact that `array_partition()` has behavior
that cannot be replicated in userland. I can see the “follow
array_filter()” argument for consistency, but at the same time
`array_find()` is dropping references (I believe) and I also feel that
“filtering an array” (i.e. just removing entries) is semantically
somewhat different than “creating new arrays with the original
elements”. There are probably good arguments for both positions and I'd
like to hear some more opinions from others on this matter.
Best regards
Tim Düsterhus