php7-mysql-shim
php7-mysql-shim copied to clipboard
Fixed stdClass constructor call in mysql_fetch_object()
Fixed error "stdClass does not have a constructor hence you cannot use ctor_params" (tested in PHP 7.0.33) when explicitly passing "stdClass" instead of null to mysql_fetch_object().
@lorenzos would this same issue occur for any class without a constructor? Perhaps the better option is to check method _exists($class, '__construct') and have an additional elseif that calls without the third param?
@lorenzos also, and I can't stress this enough, PHP 7.0 has been without security fixes for three years. You should be using 7.4, 8.0, or 8.1. This library still works with those.
@dshafik Yes, you're right, thanks :slightly_smiling_face: I removed the string check since it's not necessary anymore: it looks like method_exists() works just fine with stdClass, which is the default parameter value for mysqli_fetch_object() anyway.
PHP 7.0 has been without security fixes for three years. You should be using 7.4, 8.0, or 8.1. This library still works with those.
If it was up to me and my developer colleagues... Unfortunately that is one of those cases where, after informing them, there's not much you can do: the customer and his hosting provider don't want to understand it, or probably they just don't want to invest time or money on software migration. :man_shrugging:
Thanks for the warning anyway, and thanks for being clear in the README too, I much appreciated it.