PHP-MySQLi-Database-Class icon indicating copy to clipboard operation
PHP-MySQLi-Database-Class copied to clipboard

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

Open aleixpellicer opened this issue 3 years ago • 3 comments

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 avatar Nov 11 '22 12:11 aleixpellicer

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

SilverOkami42 avatar Feb 09 '23 15:02 SilverOkami42

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

SilverOkami42 avatar Feb 09 '23 19:02 SilverOkami42

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 avatar Jul 24 '23 14:07 RivenSkaye