Bug #76691 [Asn->Nab]: bad result when using reference
| From: | requinix@php.net | Date: | Tue, 07 Aug 2018 07:03:10 +0000 |
| Subject: | Bug #76691 [Asn->Nab]: bad result when using reference | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-216652@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=76691&edit=1
ID: 76691
Updated by: requinix@php.net
Reported by: dying318 at gmail dot com
Summary: bad result when using reference
-Status: Assigned
+Status: Not a bug
Type: Bug
Package: *General Issues
Operating System: macOs
PHP Version: 7.2Git-2018-08-01 (Git)
Assigned To: cmb
Block user comment: N
Private report: N
New Comment:
There is nothing inherently wrong with creating a reference, but apparently Phalcon is doing
something with $parameters that is affected by [0] being a reference. So I suggest you not do that.
As for what or why, you'd have to ask the Phalcon people. If they say there is a PHP bug then
we can always revisit this.
Previous Comments:
------------------------------------------------------------------------
[2018-08-07 06:28:46] dying318 at gmail dot com
Embarrassing for the assuming, cause I don't know it is a bug from phalcon or something wrong
with the reference. The parameters pass to findFirst is considered to be the same, but actually it
is not, I wonder why this happened.
------------------------------------------------------------------------
[2018-08-01 11:54:46] cmb@php.net
> Note: the findFirst method is defined in phalcon.
Then why do you report the issue here?
------------------------------------------------------------------------
[2018-08-01 08:58:35] 641202944 at qq dot com
Note: the findFirst method is defined in phalcon.
------------------------------------------------------------------------
[2018-08-01 08:57:25] dying318 at gmail dot com
Description:
------------
the test script is ok, but when I remove the annotation at line 2, the findFirst will return a bad
result,
Note: the findFinst is defined in phalcon framework.
Test script:
---------------
$parameters = [[["id=470"]]];
// $conditions = &$parameters[0]; // the problem code
$model = Model::findFirst($parameters);
echo $model->name , "<br>";
echo $this->di->get('profiler')->getLastProfile()->getSQLStatement(),
"<br>";
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=76691&edit=1