|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #70552 Declaration of Statement should be compatible with existing method
Submitted: 2015-09-22 15:42 UTC Modified: 2015-12-11 18:10 UTC
Avg. Score:3.0 ± 2.0
Reproduced:1 of 2 (50.0%)
Same Version:0 (0.0%)
Same OS:0 (0.0%)
From: deathruler at gmail dot com Assigned:
Status: Duplicate Package: Class/Object related
PHP Version: 7.0Git-2015-09-22 (Git) OS: linux
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: deathruler at gmail dot com
New email:
PHP Version: OS:


 [2015-09-22 15:42 UTC] deathruler at gmail dot com
I've created a class that extends PDO and a class that extends PDOStatement.
When upgrading to PHP 7.0 RC2, it gave me a strict warning on a code that gave no issues before.

What is particular is that the result error says that on line 90 is where the error occurred, but that's wrong as it contains the ending bracket of the Statement class and thus is incorrect hoping that this error is also unexpected behavior.
Cause all I wanted to do is to let the PDO "execute" method do more then default.

Just because the method shares the same name, doesn't mean it must share the same arguments (at least in my opinion).

Test script:
 class Statement extends PDOStatement{
  public function execute(...$args){ #because this arg list is different from pdo arg list it gives a strict error.
    # do stuff
  public function __construct($handle){}
 class Database extends PDO{
  function __construct(){
   parent::__construct($dsn, $username, $password, [parent::ATTR_STATEMENT_CLASS => ['Statement', [$this]]]);

Expected result:
I expect to see no strict errors ;)

Actual result:
Warning: Declaration of Statement::execute(...$args) should be compatible with PDOStatement::execute($bound_input_params = NULL) in /path/to/statement.php on line 90 


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2015-09-24 15:47 UTC] alec at alec dot pl
This comes probably from or is related, but personally I also do not like the change in this particular case.
 [2015-12-11 18:10 UTC]
-Status: Open +Status: Duplicate
 [2015-12-11 18:10 UTC]
Duplicate of
PHP Copyright © 2001-2023 The PHP Group
All rights reserved.
Last updated: Sun Jan 29 16:05:54 2023 UTC