Type Hinting
- In simple word, type hinting means providing hints to function to only accept the given data type.
- In technical word we can say that Type Hinting is method by which we can force function to accept the desired data type.
- In PHP, we can use type hinting for Object, Array and callable data type.
Example 1
Output:
Example 2
Output:
|