Bug #66058 [Fbk->NoF]: Add a new Array value makes a RECURSIVE Value
| From: | ab@php.net | Date: | Thu, 08 May 2014 16:21:20 +0000 |
| Subject: | Bug #66058 [Fbk->NoF]: Add a new Array value makes a RECURSIVE Value | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-185721@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=66058&edit=1
ID: 66058
Updated by: ab@php.net
Reported by: jkt at steampower dot hu
Summary: Add a new Array value makes a RECURSIVE Value
-Status: Feedback
+Status: No Feedback
Type: Bug
Package: Arrays related
Operating System: Windows XP SP3
PHP Version: 5.4.21
Block user comment: N
Private report: N
New Comment:
No feedback was provided. The bug is being suspended because
we assume that you are no longer experiencing the problem.
If this is not the case and you are able to provide the
information that was requested earlier, please do so and
change the status of the bug back to "Re-Opened". Thank you.
Previous Comments:
------------------------------------------------------------------------
[2013-11-08 18:45:29] requinix@php.net
Thank you for this bug report. To properly diagnose the problem, we
need a short but complete example script to be able to reproduce
this bug ourselves.
A proper reproducing script starts with <?php and ends with ?>,
is max. 10-20 lines long and does not require any external
resources such as databases, etc. If the script requires a
database to demonstrate the issue, please make sure it creates
all necessary tables, stored procedures etc.
Please avoid embedding huge scripts into the report.
That script isn't something we can use to reproduce the issue. It needs to be as self-contained
as possible: no database, no other functions called, and not an excerpt of some code from within a
function.
Also, the "expected result" is probably not what you actually expect (shouldn't it be
[1] => Array... at the end?) and the "actual result" isn't possible ([1] => [1]
=> is invalid).
------------------------------------------------------------------------
[2013-11-08 09:03:04] jkt at steampower dot hu
Description:
------------
There is a short function, which starts one query and then parse the results.
If the script goes to commented line, the $ret array new value makes a recursive array.
I checked set the value by hand, like ='35';, but the PHP do the same.
I think it's a bug, because I downgrade the v5.3.27 and the script functional normally again.
Test script:
---------------
$ret = Array();
$query = "SELECT * FROM any WHERE ID=".html2sql($ID).";";
$results = mysqli_query($connectedID, $query);
if (mysqli_num_rows($results)) {
$i = 0;
while ($row = mysqli_fetch_assoc($results)) {
$r[$i]['GyujtoEgysegID'] = $row['GyujtoEgysegID'];
$r[$i]['EgysegID'] = $row['EgysegID'];
$r[$i]['Jogosultsag'] = $row['Jogosultsag'];
$i++;
};
$j = 0;
foreach ($r as $d) {
if ($d['GyujtoEgysegID'] != '') {
$gye = GET_user_egysegGyujto($d['GyujtoEgysegID']);
foreach ($gye as $e) {
$ret[$j]['EgysegID'] = $e['EgysegID'];
$ret[$j]['Jogosultsag'] = $d['Jogosultsag'];
$j++;
};
}else {
$ret[$j]['EgysegID'] = $d['EgysegID']; // This is goes RECURSIVE
$ret[$j]['Jogosultsag'] = $d['Jogosultsag'];
$j++;
};
};
return $ret;
}else {
return false;
};
Expected result:
----------------
Something like this:
$ret = Array([0] => Array('EgysegID' => 2, 'Jogosultsag' => 1),
Array...
Actual result:
--------------
$ret = Array([0] => Array('EgysegID' => 2, 'Jogosultsag' => 1),
Array([1] => [1] => *RECURSIVE*
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=66058&edit=1