PHP is one of this powerful language allowing to define a default value for a method argument. But all method arguments with a default value should be declared after the method arguments without default value.

Noncompliant Code Example

In the following case, calling makeyogurt("raspberry") won't lead to the expected result :

function makeyogurt($type = "acidophilus", $flavour){...}

The following warning will be generated at runtime: Missing argument 2 in call to makeyogurt()

Compliant Solution

function makeyogurt($flavour, $type = "acidophilus", ){...}