Edit report at http://bugs.php.net/bug.php?id=53679&edit=1
ID: 53679
User updated by: mail at andreas-rex dot de
Reported by: mail at andreas-rex dot de
Summary: Array are reference by copying to another array,
after bind_param()
Status: Bogus
Type: Bug
Package: MySQLi related
PHP Version: 5.2.17
Block user comment: N
Private report: N
New Comment:
Sorry, for my bug posting, It's has nothing to do with bind_param(). Can
somebody close ii? Or is it already closed?
Previous Comments:
------------------------------------------------------------------------
[2011-01-07 08:53:56] mail at andreas-rex dot de
It like this example on
http://www.php.net/manual/en/language.references.whatdo.php you
mentioned:
<?php
/* Assignment of array variables */
$arr = array(1);
$a =& $arr[0]; //$a and $arr[0] are in the same reference set
$arr2 = $arr; //not an assignment-by-reference!
$arr2[0]++;
/* $a == 2, $arr == array(2) */
/* The contents of $arr are changed even though it's not a reference!
*/
?>
------------------------------------------------------------------------
[2011-01-06 22:42:31] [email protected]
This is not a bug, it's a consequence of how references and arrays work
in PHP (perhaps, more appropriately, this is a bug, but a it's a design
shortcoming that can't be fixed any time soon).
Take a look at
http://www.php.net/manual/en/language.references.whatdo.php
------------------------------------------------------------------------
[2011-01-06 22:21:00] mail at andreas-rex dot de
Description:
------------
When an array was in a parameter list from bind_param() you can't copy
it to another array, it's always a reference. But when you copy a single
field from this array to a variable it's not a refence to the array.
Test script:
---------------
http://www.madking.de/bind_param_and_array.txt
Expected result:
----------------
Some Examples, which show what I mean. It's bit hard to understand. It's
NOT the reference to bind_param(). It's that an array gives only his
reference when copied to another array.
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/bug.php?id=53679&edit=1