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
Have you experienced this issue?
Rate the importance of this bug to you:

 [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-2021 The PHP Group
All rights reserved.
Last updated: Mon Dec 06 14:03:34 2021 UTC