You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
After upgrading to php 8, I encountered a fatal error when using my existing code base:
Stackstrace:
Uncaught TypeError: method_exists(): Argument #1 ($object_or_class) must be of type object|string, bool given in /.../adodb/drivers/adodb-mysqli.inc.php:1206
Stack trace:
#0 /../adodb/drivers/adodb-mysqli.inc.php(1206): method_exists() #1 /../myconnector.php(8):
ADODB_mysqli->SetCharSet()
thrown in /.../adodb/drivers/adodb-mysqli.inc.php on line 1206
On mysqli, PHP 8 throws an 'Uncaught TypeError: method_exists():
Argument 1 ($object_or_class) must be of type object|string, bool
given'. Checking that _connectionID is set fixes the problem.
A similar issue was found and fixed with the postgres7 driver as well.
Note that fixing the legacy mysql driver is not necessary, as the driver
has been removed in PHP 7, and the error suppression operator should do
the job on PHP 5.
Fixes#686
Versions:
After upgrading to php 8, I encountered a fatal error when using my existing code base:
Stackstrace:
Uncaught TypeError: method_exists(): Argument #1 ($object_or_class) must be of type object|string, bool given in /.../adodb/drivers/adodb-mysqli.inc.php:1206
Stack trace:
#0 /../adodb/drivers/adodb-mysqli.inc.php(1206): method_exists()
#1 /../myconnector.php(8):
ADODB_mysqli->SetCharSet()
thrown in /.../adodb/drivers/adodb-mysqli.inc.php on line 1206
My code is as simple as:
If I comment out the line
$db->setCharset('utf-8');
, the error goes away.Underlying reason: in PHP 8 method_exists now throws a Type Error if it encounters an unexpected value, which it didn't do previously.
Thanks for investigating the issue.
The text was updated successfully, but these errors were encountered: