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 Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
If you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: conradbrinker at gmail dot com
New email:
PHP Version: OS:

 

 [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

Pull Requests

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: Sat Dec 21 13:01:31 2024 UTC