Skip to content

Should this wrapper library include typehints? #13

@kitserve

Description

@kitserve

Currently there are no typehints in the code. This maximises compatibility, but also increases the risk of bugs creeping in, for example as occurred in #11. Should we include typehints? Adding them in would make the code incompatible with PHP 5, but that's probably not such a big issue since it's intended to allow PHP 5 code to run in newer PHP versions. More problematic is that PHP's typehinting has changed between versions 7.x and 8.x. Even if we were to add in typehints, we'd probably be forced to stick with 7.0 syntax and avoid any of the more advanced union types.

Additionally/alternatively, we could just use docblock function declarations. This wouldn't provide any strict guarantees about function arguments and return types, but would at least encourage checking legacy mysql_* function signatures against the wrappers in this library.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions