|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #72712 mysqli::bind_param is outdated - parameter binding should be by single array
Submitted: 2016-07-30 12:25 UTC Modified: 2016-09-26 14:43 UTC
From: conradbrinker at gmail dot com Assigned: cmb (profile)
Status: Wont fix Package: MySQLi related
PHP Version: 7.0.9 OS: Ubuntu 16.04
Private report: No CVE-ID: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please — but make sure to vote on the bug!
Your email address:
Solve the problem:
18 - 2 = ?
Subscribe to this entry?

 [2016-07-30 12:25 UTC] conradbrinker at gmail dot com
MySQLi::bind_param() is still stuck in the old days. We should not have to use call_user_func_array() to bind a referenced array of data to a prepared statement. MySQLi::bind_param() should be like PDO in that we should at least be able to pass a PHP array to it as the second parameter and it will process the request accordingly.

Test script:
It's not a bug... it's a feature.


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2016-09-26 14:43 UTC]
-Status: Open +Status: Wont fix -Assigned To: +Assigned To: cmb
 [2016-09-26 14:43 UTC]
As of PHP 5.6 you can use argument unpacking, e.g.

  $stmt->bind_param($types, ...$params)

Looks good enough to me.

[1] <>
PHP Copyright © 2001-2023 The PHP Group
All rights reserved.
Last updated: Fri Sep 22 13:01:24 2023 UTC