|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #52003 Incorrect PDOStatement::execute() signature
Submitted: 2010-06-05 22:53 UTC Modified: 2017-10-24 08:29 UTC
Avg. Score:4.2 ± 0.9
Reproduced:4 of 4 (100.0%)
Same Version:4 (100.0%)
Same OS:4 (100.0%)
From: me at paulofreitas dot me Assigned:
Status: Open Package: PDO related
PHP Version: Irrelevant OS: Irrelevant
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Bug Type:
From: me at paulofreitas dot me
New email:
PHP Version: OS:


 [2010-06-05 22:53 UTC] me at paulofreitas dot me
Manual says PDOStatement::execute() signature is:

bool PDOStatement::execute  ([  array $input_parameters = array()  ] )

But in fact it is:

bool PDOStatement::execute  ([  $input_parameters = null  ] )

Test script:

class DBStatement extends PDOStatement
    public function execute(array $input_parameters = array())
        return parent::execute($input_parameters);

$PDO = new PDO('mysql:host=', 'root', '');
$PDO->setAttribute(PDO::ATTR_STATEMENT_CLASS, array('DBStatement'));

Expected result:
No errors

Actual result:
Strict Standards: Declaration of DBStatement::execute() should be compatible with that of PDOStatement::execute() in /media/ext/Web/htdocs/test/bug.php on line 9


ZEND_ARG_ARRAY_INFO (last revision 2010-06-06 04:13 UTC by

Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2010-06-06 06:13 UTC]
The following patch has been added/updated:

Revision:   1275797622
 [2010-10-19 07:07 UTC]
-Type: Documentation Problem +Type: Bug -Package: Documentation problem +Package: PDO related -Assigned To: +Assigned To: pierrick
 [2010-10-19 07:07 UTC]
Pierrick, why don't you commit that patch the src? And add a changelog entry if reasonable for PDOStatement::execute() :)
 [2012-01-30 05:52 UTC] larry at ldrutledge dot com
The situation appears to be unchanged in 5.3.9. The manual still shows a type hint of array but a method in an extended class still triggers a warning unless the type hint is omitted.
 [2012-09-09 14:37 UTC] reeze dot xia at gmail dot com
This seems been forgotten by pierrick.
 [2012-09-10 02:32 UTC]
maybe change to doc problem, there maybe already some user defined their extended 
class with the *wrong* signature.
 [2012-11-17 00:58 UTC]
I never committed this patch because it was breaking some php code by adding 
strict errors. We should (as said in the previous comment) update the 

I'm assigning this to you Ilia since you're the PDO primary maintainer. Do you 
also think it's best to just update the documentation ? Thanks for your feedback
 [2012-11-17 00:58 UTC]
-Assigned To: pierrick +Assigned To: iliaa
 [2012-11-17 01:00 UTC]
I think the patch make sense, we should update the docs to reflect the patch.
 [2012-11-17 06:08 UTC]
Ok then I'll commit it on 5.3 and > or on 5.5 and > ?
 [2013-02-06 22:44 UTC] rick at wrep dot nl
This is still not fixed in the documentation, it would be great if the 
documentation could be updated to reflect the real situation!
 [2013-02-13 23:42 UTC] me at paulofreitas dot me
-: v1d4l0k4 at gmail dot com +: me at paulofreitas dot me
 [2013-02-13 23:42 UTC] me at paulofreitas dot me
Using PHP 5.4.6 I noticed that the Strict Standards error message was improved, now it includes the expected signature, which actually helps more than before:

Strict Standards: Declaration of DBStatement::execute() should be compatible with PDOStatement::execute($bound_input_params = NULL) in Unknown on line 0

If it won't get patched, please, don't forget to update the docs! (if php-doc was already mirrored on GitHub I'd have done it myself – hint)
 [2014-01-01 12:49 UTC]
-Package: PDO related +Package: PDO Core
 [2015-08-31 22:28 UTC]
IMO, this is not a documentation problem, but rather an
implementation bug. While the ARG_INFO is untyped[1], the
respective ZPP expects a nullable array[2]. Actually, this
inconsistency should be fixed, instead of weakening the docs.

[1] <>
[2] <>
 [2017-10-20 18:39 UTC]
-Status: Assigned +Status: Open -Assigned To: iliaa +Assigned To:
 [2017-10-20 18:39 UTC]
Unassigning as Ilia is not currently active
 [2017-10-24 08:29 UTC]
-Package: PDO Core +Package: PDO related
PHP Copyright © 2001-2020 The PHP Group
All rights reserved.
Last updated: Fri Apr 03 20:01:23 2020 UTC