Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Should this wrapper library include typehints? #13

Open
kitserve opened this issue Jul 3, 2023 · 0 comments
Open

Should this wrapper library include typehints? #13

kitserve opened this issue Jul 3, 2023 · 0 comments

Comments

@kitserve
Copy link
Owner

kitserve commented Jul 3, 2023

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant