kitserve / php7-compat

Wrapper functions around the deprecated `mysql_*` and `ereg*` functions for use in PHP 7
Apache License 2.0
9 stars 2 forks source link

mysql_free_result behaviour doesn't match mysqli_free_result behaviour #11

Closed kitserve closed 1 year ago

kitserve commented 1 year ago

According to https://www.php.net/manual/en/function.mysql-free-result, mysql_free_result(resource $result) returns a bool, and issues a warning when its argument is not a resource. By contrast, per https://www.php.net/manual/en/mysqli-result.free.php, mysqli_free_result(mysqli_result $result) returns void, and throws an error when its argument is not an open mysqli_result object.

kitserve commented 1 year ago

Low priority, but this isn't fully fixed. There is a TODO comment in the code where the behaviour could be improved. It would also be worth doing a sweep of the existing code, checking for other functions whose signatures and error behaviour doesn't match.