PHP Function Expression
PHP functions allow us to break down complex tasks into smaller parts. They help reduce the amount of code in a program and make it easier to debug if something goes wrong.
Essentially, a function in php is just an area of memory or a bucket that you can store a value in. This value can be anything from an integer to a string - remember, it doesn't have to be an int. Whenever you need to use this value again, you can access it by using the equals sign in conjunction with the variable name (in PHP this is indicated by the $ symbol).
When a function is invoked the values passed into it are replaced at run time by the function's return value. Like other programming languages, PHP supports several data types: scalar values, arrays and objects. The type of value that a particular variable or function parameter is defined to accept can be determined by placing a colon followed by the data type in front of the function name inside the curly (
This is known as a type declaration. It lets you specify what data types you'll be using for a particular function and, in strict mode, it means that if there is a mismatch between the return value of a function and its argument, an error will be raised. PHP also has the eval() intrinsic function which allows you to pass a string that will be evaluated as PHP source code. In this case, if there is a mismatch, a ParseError will be raised.