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

Support strict_types=1 for overridden functions #44

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Nebual
Copy link

@Nebual Nebual commented Jan 14, 2019

This fixes #43.
I'm simply copying the parameter parsing from official php source https://github.com/php/php-src/blob/e219ec144ef6682b71e135fd18654ee1bb4676b4/ext/date/php_date.c as it appears the strict_type checking occurs inside the Z_PARAM_STR()/ZEND_PARSE_PARAMETERS_END_EX() macros. I left the original php-source names, which is why they're a little inconsistent (heh).

As this is effectively parsing the parameters an additional time, it comes with a very slight performance hit, but I figure that's totally acceptable for a testing library if it means more correctness.

cs278 added a commit to kiddivouchers/php-timecop that referenced this pull request Sep 27, 2019
hnw#44

* hnw/pr/44:
  Support strict_types=1 for overridden functions Fixes hnw#43
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

Successfully merging this pull request may close these issues.

Overridden functions ignore declare(strict_types=1)
1 participant