Couldn't you just use
return $stmt->fetch() ?: null;
to return null instead of false?
On Wed, May 10, 2017 at 9:51 AM, Csonka Titus wrote:
> Greetings,
>
> I want to propose a new PDO FETCH MODE.
>
> Whenever I fetch(http://php.net/manual/en/pdostatement.fetch.php) a
> class, it returns the n
Greetings,
I want to propose a new PDO FETCH MODE.
Whenever I fetch(http://php.net/manual/en/pdostatement.fetch.php) a class, it
returns the new instance of the requested class or false in any other cases.
However with the new php7.1 return type
declaration(https://wiki.php.net/rfc/nullable_t