-
Book Overview & Buying
-
Table Of Contents
-
Feedback & Rating
PHP 8 Programming Tips, Tricks and Best Practices
By :
A number of new operators have been introduced with PHP 8. In addition, PHP 8 generally introduces a uniform and consistent manner in which these operators can be used. In this section, we examine the following operators:
Let's start with a discussion of the variadics operator.
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:
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.
One of the most common uses for the variadics operator is in a situation...