Scalar type hints

For this RFC: https://wiki.php.net/rfc/scalar_type_hinting_with_cast

Created so patch can be reviewed.