Thursday, May 12, 2011

Type Hinting

more info..

Type Hinting
PHP 5 introduces Type Hinting. Functions are now able to force parameters to be objects (by
specifying the name of the class in the function prototype) or arrays (since PHP 5.1). However, if
NULL is used as the default parameter value, it will be allowed as an argument for any later call.
* Another test function
** First parameter must be an array
public functiontest_array(array$input_array) {
}// Another example class
classOtherClass {
public$var = 'Hello World';

No comments: