CakeFest 2025 Madrid: The Official CakePHP Conference

Voting

: min(eight, eight)?
(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