-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Add mode for verifying internal function param defaults #5366
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
base: master
Are you sure you want to change the base?
Conversation
cdf7025
to
0257cac
Compare
cc @kocsismate Ugh internal functions are so weird. |
@nikic OMG, all these failures are due to bad default values? 😱I'll try to have a look at them |
Fixing the |
ext/session/session.stub.php | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/ext/session/session.stub.php b/ext/session/session.stub.php
index 09c35aae28..8c13281243 100644
--- a/ext/session/session.stub.php
+++ b/ext/session/session.stub.php
@@ -37,7 +37,7 @@ function session_register_shutdown(): void {}
/** @alias session_write_close */
function session_commit(): bool {}
-function session_set_save_handler($open, $close = null, $read = null, $write = null, $destroy = null, $gc = null, $create_sid = null, $validate_sid = null, $update_timestamp = null): bool {}
+function session_set_save_handler($open, $close = UNKNOWN, $read = UNKNOWN, $write = UNKNOWN, $destroy = UNKNOWN, $gc = UNKNOWN, $create_sid = UNKNOWN, $validate_sid = UNKNOWN, $update_timestamp = UNKNOWN): bool {}
function session_cache_limiter(string $cache_limiter = UNKNOWN): string|false {}
@@ -45,7 +45,7 @@ function session_cache_expire(?int $new_cache_expire = null): int|false {}
function session_set_cookie_params($lifetime_or_options, string $path = UNKNOWN, string $domain = "", ?bool $secure = null, ?bool $httponly = null): bool {}
-function session_start(array $options = []): bool {}
+function session_start(array $options = UNKNOWN): bool {}
interface SessionHandlerInterface
{ fixes all ext/session test failures for me. |
@cmb69 The session_set_save_handler change looks good to me, but why the session_start change? |
@nikic I've fixed quite some issues. Please, rebase when you'll have time so that I can see the remaining issues more easily :) |
0257cac
to
404fb15
Compare
@nikic If all the wishes would come true this fast... :D |
Oh, indeed, the signature is correct; however, session_set_save_handler_sid_002.phpt and two other tests fail on AppVeyor and locally for me because of a slightly different stack trace. Why is the argument shown on Windows, but not on Linux? |
Am I right that the default value of the |
@kocsismate, yes. |
As far as I see there will lots of issues with |
404fb15
to
b9b297a
Compare
To avoid printing arguments in exception backtrace. This reduces false positives for phpGH-5366.
b9b297a
to
52b1841
Compare
@nikic Can you please rebase this next week? It's not urgent at all, but we should have a look at the current state soon :) |
4aedb8b
to
bba66f9
Compare
A few next weeks later, this is now rebased :) I've already fixed a couple of issues that have cropped up. |
2863536
to
5501c17
Compare
5501c17
to
e0da596
Compare
A problem here is that the extra parameters show up in exception stack traces, and make tests spuriously fail.