Req #51044 [Opn->Csd]: errorInfo should allow for returning msg only
| From: | cmb@php.net | Date: | Mon, 16 Nov 2020 16:34:34 +0000 |
| Subject: | Req #51044 [Opn->Csd]: errorInfo should allow for returning msg only | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-230392@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=51044&edit=1
ID: 51044
Updated by: cmb@php.net
Reported by: otto dot wyss at orpatec dot ch
Summary: errorInfo should allow for returning msg only
-Status: Open
+Status: Closed
Type: Feature/Change Request
Package: PDO related
Operating System: Irrelevant
PHP Version: 5.2.12
-Assigned To:
+Assigned To: cmb
Block user comment: N
Private report: N
New Comment:
As of PHP 5.4.0, array dereferencing of function call results is
allowed:
$pdo->errorInfo()[2]
So I think this request is obsolete.
Previous Comments:
------------------------------------------------------------------------
[2010-02-14 09:25:59] otto dot wyss at orpatec dot ch
Description:
------------
Currently PDO::errorInfo returns an array (SQLSTATE, driver specific code, message) but almost ever
only the message is interesting. Therefore I propose to expand the API to add an obtional array
index, if present only the indexed information will be returned. The return type probably has to be
changed to mixed as well.
Current calls without parameter return the current array, future calls i.e. errorInfo (2) will only
return the text message as a string.
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=51044&edit=1