I saw a function declared like this:
public static function factory($file=null, array $data=null, $auto_encode=null)
If you want to see the real class, please go to this view.php
class from a fork of fuelphp parser package in github.
My question is, what does array
keyword means in array $data = null
?
This is an example of PHP5's type hinting. The parameter $data
is supposed to be an array. It is possible to hint method parameters as either object
or array
types. If it is an object, you can specify the name of the class as the hint keyword.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With