Why PDO generates warnings when we tell it not to do it?

后端 未结 2 379
遥遥无期
遥遥无期 2021-01-05 20:21

Problem

We tell PDO to wrap each issue into exception. In some cases it generates a few warnings and only then throws exception.

Why

2条回答
  •  醉梦人生
    2021-01-05 21:09

    It's because of PDO could use mysqlnd driver, which not respects any of PDO's "convert-issues-to-extensions" policy.

    Just look at sources of mysqlnd driver.

    We clearly see there direct calls to php_error_docref.

    And one of examples, shown at previous question explained by these lines: https://github.com/php/php-src/blob/PHP-5.5.31/ext/mysqlnd/mysqlnd_wireprotocol.c#L35:L61

提交回复
热议问题