Functions and Closures

Functions, Closures and References

Since PHP 7, functions have gained typed parameters and returns, named arguments, arrow functions and closures you pass around as values, and in 8.5 closures inside constant expressions. Underneath, the value model is unchanged: arrays are copied lazily, objects travel as handles, and & makes a true alias. The section ends there, because most baffling PHP bugs start there.

Subsections