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

Deprecated on PHP 8.1.11: Calling end() on an object #1001

Open
aleixpellicer opened this issue Nov 11, 2022 · 3 comments · May be fixed by #1018
Open

Deprecated on PHP 8.1.11: Calling end() on an object #1001

aleixpellicer opened this issue Nov 11, 2022 · 3 comments · May be fixed by #1018

Comments

@aleixpellicer
Copy link

Not working in 8.1.11:

Deprecated: end(): Calling end() on an object is deprecated in X:\UniServerZ_15\vhosts\vatiometrogiovanni\vendor\thingengineer\mysqli-database-class\MysqliDb.php on line 1675

Having to go back to php 7 in order to work

@aleixpellicer aleixpellicer changed the title Deprecated on 8.1.11: Calling end() on an object Deprecated on PHP 8.1.11: Calling end() on an object Nov 11, 2022
@SilverOkami42
Copy link

I found a quick fix was to replace end($result) with $result->{array_key_last((array)$result)}

@SilverOkami42
Copy link

I also discovered changing line 2058 to $val = $vals[$i++] ?? null; fixed it finding a array value that didn't exist.

RivenSkaye added a commit to RivenSkaye/PHP-MySQLi-Database-Class that referenced this issue Jul 24, 2023
@RivenSkaye
Copy link

I also discovered changing line 2058 to $val = $vals[$i++] ?? null; fixed it finding a array value that didn't exist.

This sounds like there are fewer elements in the array than question marks in the query. Granted, it'd be better to check that, but that should be a separate issue.

@RivenSkaye RivenSkaye linked a pull request Jul 25, 2023 that will close this issue
stormwalkerec added a commit to stormwalkerec/php-mysqli-database-class that referenced this issue Mar 31, 2024
Fixes ThingEngineer#1016 by setting the defaults to an empty string; This matches nothing without notices about nulls.
Fixes ThingEngineer#1013 by defaulting to false instead of not initializing.
Fixes ThingEngineer#1015 by adding the missing null in the docstring. Re-aligned the other lines and fixed a typo.
Fixes ThingEngineer#1001 by special handling of stdClass objects
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 a pull request may close this issue.

3 participants