Return Type Declaration in PHP 7

As of PHP 7, we can specify the type of the returned value for the function we declare. The return type can be string, int, float, bool, array, callable, self (when defining methods only), parent (when defining methods only), Closure, the name of a class or the name of an interface.
Back to Top