Closed as not planned
Description
Description
The following code:
<?php
declare(strict_types=1);
use PDO;
use PDOException;
try {
$database = new PDO('sqlite::memory:', null, null, null);
$query = $database->prepare('SELECT * FROM test2');
$query->execute();
} catch (PDOException $exception) {
$code = $exception->getCode();
echo gettype($code);
}
Resulted in this output:
string
But I expected this output instead:
int
https://www.php.net/manual/en/class.pdoexception
final public Exception::getCode(): int
PHP Version
php 8.2.10
Operating System
alpine 3.18.3