Concept

What are the key features of functions in PHP?

ComputerScienceOne / Declaring Functions

"Functions are essential in PHP programming. PHP provides a large library of standard functions to perform basic input/output, math, and many other functions. PHP also provides the ability to define and use your own functions. PHP does not support function overloading, so when you define a function and give it a name, that name cannot be in conflict with any other function name in the standard library or any other code that you might use. Careful thought should go into the design and naming of your functions. PHP supports both call by value and call by reference. As of PHP 5.6, vararg functions are also supported (though earlier versions supported some vararg-like functions such as printf() ). However, we will not go into detail here. Finally, another feature of PHP is that function parameters are all optional. You may invoke a function with a subset of the parameters. Depending on your PHP setup, the interpreter may issue a warning that a parameter was omitted. However, PHP allows you to define default values for optional parameters."

Related Ideas