Type Hinting

  • Mikael Olsson


PHP relies on the proper documentation of functions for developers to know what arguments a function can take. To simplify this PHP 5 introduced type hinting, which allows a function to specify the type of arguments it accepts. Allowed types include classes, interfaces and the pseudo types array and callable.


Function Signature Callable Function Scalar Type Language Construct Type Array 
These keywords were added by machine and not by the authors. This process is experimental and the keywords may be updated as the learning algorithm improves.

Copyright information

© Mikael Olsson 2013

Authors and Affiliations

  • Mikael Olsson
    • 1
  1. 1.AlandFinland

Personalised recommendations