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
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
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 17:01:58 2024 UTC