|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2013-11-08 18:45 UTC] requinix@php.net
-Status: Open
+Status: Feedback
[2013-11-08 18:45 UTC] requinix@php.net
[2014-05-08 16:21 UTC] ab@php.net
-Status: Feedback
+Status: No Feedback
[2014-05-08 16:21 UTC] ab@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Tue Nov 04 19:00:02 2025 UTC |
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*