Term

Function

Meaning

A function is a named block of instructions that can receive inputs, called parameters, do some work and return a result, so the same work can be reused wherever it is needed. PHP ships with a very large number of built-in functions for strings, arrays, dates and files, and you can write your own. A good function is small and has one clear job; if you cannot name it without the word and, it probably does too much. Declaring parameter and return types catches mistakes early. See also: Class, Namespace, and the guide PHP Functions and Object Oriented Programming Concepts.

All terms