A language with first-class functions allows the following behavior:
- Assign a function to a variable
- Pass them to another function as an argument
- Return a function
PHP supports all of these behaviors and, hence, PHP functions are first-class functions. In our previous example, the ucfirst function is an example of a first-class function.