Skip to content

Fix default value handling of mysqli_fetch_object() #6336

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

Closed
wants to merge 8 commits into from

Conversation

kocsismate
Copy link
Member

@kocsismate kocsismate commented Oct 13, 2020

Related to #5881

@kocsismate kocsismate force-pushed the fix-mysqli_fetch_object branch 2 times, most recently from cfb840a to a06c6b7 Compare October 13, 2020 22:22
@kocsismate
Copy link
Member Author

I've checked pg_fetch_object() and it already uses a nullable $ctor_args parameter, so it's good already (although the parameter name is hardcoded as $ctor_params in the error message).

@kocsismate kocsismate force-pushed the fix-mysqli_fetch_object branch from a06c6b7 to f8f42a6 Compare October 13, 2020 22:35
@kocsismate
Copy link
Member Author

Oh, and I've just noticed that mysqli_fetch_object() uses a $params parameter name rather than $ctor_args. I'd like to normalize these to $constructor_args. The more I have to use it, the more I realiz that I like it much more than the current name.

@kocsismate kocsismate force-pushed the fix-mysqli_fetch_object branch from e4d16ed to 79c4e7c Compare October 14, 2020 07:56
@nikic
Copy link
Member

nikic commented Oct 15, 2020

There's still a test failure, but I don't really understand it.

@kocsismate kocsismate force-pushed the fix-mysqli_fetch_object branch from a893ede to 6e678ce Compare October 16, 2020 10:02
@kocsismate kocsismate force-pushed the fix-mysqli_fetch_object branch from 42403ae to 8ec0578 Compare October 19, 2020 08:36
@nikic
Copy link
Member

nikic commented Oct 19, 2020

Code changes look good to me now, just need those tests to pass :)

@kocsismate
Copy link
Member Author

Code changes look good to me now, just need those tests to pass :)

Yeah, I'll try to make CI status green in the evening. It's really a puzzling failure, though

} catch (Error $e) {
handle_catchable_fatal($e->getCode(), $e->getMessage(), $e->getFile(), $e->getLine());
$res->fetch_object('mysqli_fetch_object_construct', null);
} catch (TypeError $e) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It took me an embarrassingly long time to find this, but ... the problem is that this uses $e here and then dumps $exception, which points to an earlier exception :(

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OMG... I was also searching for the problem in the morning, but didn't find it 🤦

@php-pulls php-pulls closed this in d5f92ba Oct 20, 2020
@kocsismate kocsismate deleted the fix-mysqli_fetch_object branch October 20, 2020 15:04
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.

2 participants