Type Hinting
Learn about type hinting for arrays, objects, and other basic data types in PHP.
We'll cover the following...
What is type hinting?
Type hinting is used to specify the expected data type (arrays, objects, interfaces, and so on) for an argument in a function declaration. It is especially useful because it results in better code organization and improved error messages.
Type hinting for arrays
When we want a function to only get arrays as valid arguments, we can put the ...