PHP 8.5.0 Alpha 1 available for testing

Voting

: five plus three?
(Example: nine)

The Note You're Voting On

2M
3 years ago
Do not use the strict operator as suggested when checking the Exception Code in \PDOException.
As per documentation: \PDOException is returning a string for its Exception Code and not an Integer.

Ran into the following in PHP8:
<?php

catch(\PDOException $e) {
var_dump($e->getCode()); //Output: string(5) "23000"
}

?>

<< Back to user notes page

To Top