19. Type Juggling
Type Juggling is a feature (or design flaw, according to where you
stand on typing) where convert a variable type to the most
appropriate type according to the action performed.
It can lead to an unexpected output.
27. Scalar Type Hinting in PHP7
RFC introduced last year:
https://wiki.php.net/rfc/scalar_type_hints_v5
Extends type hints for scalar types.
Scalar Types – integer, float, string and boolean
33. Return Type Declarations
In PHP7, we could specify the datatype of the return value of a
function. This is great!
Adding Return Type Declarations facilitates a nice contract where
the caller is sure that the called function would return a value with
type as promised
36. Return Type Declarations - Features
Contract between Caller and Callable function.
No Error handling required in the caller function.
Function definitions are more readable.
48. Important points to note -
Return Type Declarations are optional, even in the strict mode.
The only type conversions allowed is int to float, i:e Float parameter
type can accept an integer value.
NULL is still allowed as a default value for a function parameter.