Doc #53707 [NEW]: Wrong function declaration of PDOStatement->execute
| From: | info at a2er dot ch | Date: | Mon, 10 Jan 2011 15:08:44 +0000 |
| Subject: | Doc #53707 [NEW]: Wrong function declaration of PDOStatement->execute | ||
| Groups: | php.doc.bugs | ||
| Request: | Send a blank email to doc-bugs+get-5777@lists.php.net to get a copy of this message | ||
From:
Operating system: any
PHP version: 5.3.5
Package: Documentation problem
Bug Type: Documentation Problem
Bug description:Wrong function declaration of PDOStatement->execute
Description:
------------
---
From manual page: http://www.php.net/pdostatement.execute#Description
---
Argument $input_parameters can not be an array as default value.
Mustn't it be:
bool PDOStatement::execute ([ array $input_parameters = NULL ] )
Test script:
---------------
function execute(PDOStatement $statement, array $input_parameters =
array())
{
$statement->execute($input_parameters);
}
$pdo = new PDO("mysql:dbname=database;host=localhost", "user",
"pass");
$statement = $pdo->prepare("SELECT * FROM
table WHERE name = :name");
$statement->bindValue("name", "Peter");
execute($statement);
Expected result:
----------------
Query should be executed.
Actual result:
--------------
Warning: PDOStatement::execute(): SQLSTATE[HY093]: Invalid parameter
number: no parameters were bound in /var/www/wm2/public/testscript.php on
line 5
--
Edit bug report at http://bugs.php.net/bug.php?id=53707&edit=1
--
Try a snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=53707&r=trysnapshot52
Try a snapshot (PHP 5.3): http://bugs.php.net/fix.php?id=53707&r=trysnapshot53
Try a snapshot (trunk): http://bugs.php.net/fix.php?id=53707&r=trysnapshottrunk
Fixed in SVN: http://bugs.php.net/fix.php?id=53707&r=fixed
Fixed in SVN and need be documented: http://bugs.php.net/fix.php?id=53707&r=needdocs
Fixed in release: http://bugs.php.net/fix.php?id=53707&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=53707&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=53707&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=53707&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=53707&r=support
Expected behavior: http://bugs.php.net/fix.php?id=53707&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=53707&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=53707&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=53707&r=globals
PHP 4 support discontinued: http://bugs.php.net/fix.php?id=53707&r=php4
Daylight Savings: http://bugs.php.net/fix.php?id=53707&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=53707&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=53707&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=53707&r=float
No Zend Extensions: http://bugs.php.net/fix.php?id=53707&r=nozend
MySQL Configuration Error: http://bugs.php.net/fix.php?id=53707&r=mysqlcfg