Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Catch ValueError on PHP 8.0 for Pdo Statement #85

Closed
wants to merge 25 commits into from

Conversation

glensc
Copy link
Contributor

@glensc glensc commented Mar 15, 2021

PHP Fatal error:  Uncaught ValueError: PDOStatement::setFetchMode(): Argument #1 ($mode) must be a bitmask of PDO::FETCH_* constants

Example:

Addresses previous fix with backward-compatible behavior:

For example, outer code expects Zend_Db_Statement_Exception to be thrown, but instead, \ValueError is thrown, and the whole application breaks:

Note: Even old PHPUnit breaks because \Error is not a subclass of \Exception :)

PHP Fatal error:  Uncaught ValueError: PDOStatement::setFetchMode(): Argument zf1s#1 ($mode) must be a bitmask of PDO::FETCH_* constants
PHP Fatal error:  Uncaught TypeError: fopen(): Argument zf1s#1 ($filename) must be of type string, XMLParser given
FPHP Fatal error:  Uncaught ValueError: Path cannot be empty
Configuration read from /Users/glen/scm/php/zf1/zf1s/phpunit.xml.dist
@falkenhawk falkenhawk mentioned this pull request Sep 10, 2021
@falkenhawk falkenhawk mentioned this pull request Sep 25, 2021
32 tasks
@falkenhawk
Copy link
Member

superseded by #106

@falkenhawk falkenhawk closed this Sep 26, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants