Variadics Operator

Learn about the variadics operator and how it helps the developer to provide multiple arguments without specifying the names of variables.

The variadics operator consists of three leading dots () preceding a normal PHP variable (or object property). This operator has actually been with the language since PHP 5.6. It’s also referred to as the following:

  • Splat operator

  • Scatter operator

  • Spread operator

Before we dive into the improvements PHP 8 has made using this operator, let’s have a quick look at how the operator is normally used.

Unknown number of arguments

...