Req #70787 [NEW]: mysqli_stmt::bind_param() needs the “ready” variables only

From: Date: Sun, 25 Oct 2015 20:48:50 +0000
Subject: Req #70787 [NEW]: mysqli_stmt::bind_param() needs the “ready” variables only
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-196802@lists.php.net to get a copy of this message
From:             it_poz at interia dot eu
Operating system: irrelevant
PHP version:      Irrelevant
Package:          MySQLi related
Bug Type:         Feature/Change Request
Bug description:mysqli_stmt::bind_param() needs the “ready” variables only

Description:
------------
The mysqli_stmt::bind_param() needs the “ready” variables but
doesn’t accept the parameters as results – in such cases PHP parser
outputs the Fatal error: Uncaught Error: “Cannot pass parameter 2 by
reference”

Test script:
---------------
Example 1 (it works):

$stmt->bind_param('i', 1)

Example 2 (it doesn’t work and Fatal error is signaled):

$stmt->bind_param('i', ($i + 1))

Expected result:
----------------
I would expect this method working with the parameter’s values
calculated in real time, not just only with “ready” values.

Actual result:
--------------
Uncaught Error: Cannot pass parameter 2 by reference - for the code
example 2

-- 
Edit bug report at https://bugs.php.net/bug.php?id=70787&edit=1
-- 
Try a snapshot (PHP 5.4):   https://bugs.php.net/fix.php?id=70787&r=trysnapshot54
Try a snapshot (PHP 5.5):   https://bugs.php.net/fix.php?id=70787&r=trysnapshot55
Try a snapshot (trunk):     https://bugs.php.net/fix.php?id=70787&r=trysnapshottrunk
Fixed in SVN:               https://bugs.php.net/fix.php?id=70787&r=fixed
Fixed in release:           https://bugs.php.net/fix.php?id=70787&r=alreadyfixed
Need backtrace:             https://bugs.php.net/fix.php?id=70787&r=needtrace
Need Reproduce Script:      https://bugs.php.net/fix.php?id=70787&r=needscript
Try newer version:          https://bugs.php.net/fix.php?id=70787&r=oldversion
Not developer issue:        https://bugs.php.net/fix.php?id=70787&r=support
Expected behavior:          https://bugs.php.net/fix.php?id=70787&r=notwrong
Not enough info:            https://bugs.php.net/fix.php?id=70787&r=notenoughinfo
Submitted twice:            https://bugs.php.net/fix.php?id=70787&r=submittedtwice
register_globals:           https://bugs.php.net/fix.php?id=70787&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=70787&r=php4
Daylight Savings:           https://bugs.php.net/fix.php?id=70787&r=dst
IIS Stability:              https://bugs.php.net/fix.php?id=70787&r=isapi
Install GNU Sed:            https://bugs.php.net/fix.php?id=70787&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=70787&r=float
No Zend Extensions:         https://bugs.php.net/fix.php?id=70787&r=nozend
MySQL Configuration Error:  https://bugs.php.net/fix.php?id=70787&r=mysqlcfg



Thread (2 messages)

« previous php.bugs (#196802) next »