PHP Function Return Type Declarations

PHP Function Return Type Declarations PHP 7 also supports Type Declarations for the return statement. Like with the type declaration for function arguments, by enabling the strict requirement, it will throw a “Fatal Error” on a type mismatch. To declare a type for the function return, add a colon ( : ) and the type right before the opening … Read more