php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #51044 errorInfo should allow for returning msg only
Submitted: 2010-02-14 09:25 UTC Modified: 2020-11-16 16:34 UTC
Votes:2
Avg. Score:2.0 ± 1.0
Reproduced:2 of 2 (100.0%)
Same Version:2 (100.0%)
Same OS:2 (100.0%)
From: otto dot wyss at orpatec dot ch Assigned: cmb (profile)
Status: Closed Package: PDO related
PHP Version: 5.2.12 OS: Irrelevant
Private report: No CVE-ID: None
View Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
If you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: otto dot wyss at orpatec dot ch
New email:
PHP Version: OS:

 

 [2010-02-14 09:25 UTC] 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.


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2010-11-24 14:04 UTC] jani@php.net
-Package: Feature/Change Request +Package: PDO related
 [2020-11-16 16:34 UTC] cmb@php.net
-Status: Open +Status: Closed -Assigned To: +Assigned To: cmb
 [2020-11-16 16:34 UTC] cmb@php.net
As of PHP 5.4.0, array dereferencing of function call results is
allowed:

    $pdo->errorInfo()[2]

So I think this request is obsolete.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Dec 26 12:01:30 2024 UTC