Level 75
& sets a reference to the variable. Top one is probably an updated at PHP 8 version of same.
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
I was reading about arrow functions in php documentions and I came across this code
fn($x = 42) => $x;
fn(&$x) => $x;
what is the difference between these two statements and what they do ?
Please or to participate in this conversation.