May 2016
Intermediate to advanced
155 pages
2h 15m
English
© Mikael Olsson 2016
Mikael Olsson, PHP 7 Quick Scripting Reference, 10.1007/978-1-4842-1922-5_18
Mikael Olsson1
(1)Hammarland, Finland
Type declarations allow a function to declare the expected types of their parameters and return value. This permits the PHP engine to enforce that the specified types are used.
Early versions of PHP relied exclusively on proper documentation of functions for developers to know what arguments a function accepts. To allow for functions that are more robust, PHP 5 began to introduce argument type declarations, permitting the type of a function parameter to be specified. Valid types for type declarations are shown in Table 18-1, along with the PHP version in which these ...
Read now
Unlock full access