php.net |  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:
MUST BE VALID
Solve the problem:
49 + 26 = ?
Subscribe to this entry?

 
 [2016-07-30 12:25 UTC] conradbrinker at gmail dot com
Description:
------------
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.


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

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

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

Looks good enough to me.

[1] <https://wiki.php.net/rfc/argument_unpacking>
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Mar 28 10:01:26 2024 UTC