From: [EMAIL PROTECTED] Operating system: Linux PHP version: 4.1.2 PHP Bug Type: Arrays related Bug description: Cannot use [] for reading
I've build an array using the following in a function : ------------- $this->get_data(array("","","and D.XiParentId= 'gwak_root_element' ORDER BY D.vcOrder")); $arrCategory = $this->return_array(); for($i = 0 ; $i < sizeof($arrCategory) ; $i++) { $this->get_data(array("","","and D.XiParentId = '" . $arrCategory[$i]["XiDataId"] . "' ORDER BY D.vcOrder")); $arrItem[$arrCategory[$i]["vcItemId"]] = $this->return_array(); } return $arrItem; ------------- This constructs an array with values like : $arrItem["project_priority"][0] = array(...) $arrItem["project_priority"][1] = array(...) etc... Later I tried to do the following to the returned $arrItem : ------------- $arrItem["project_severity"][] = array("XiDataId" => "gwak_get_all", "vcText" => "All"); ------------- This gives the error : ------------- Fatal error: Cannot use [] for reading in /home/plb/public_html/gwak/module/project/include/Task.class.php on line 160 ------------- Funny because doing the following : ------------- $arrThis["here"][] = array("XiDataId" => "asdasdas", "vcText" => "324234234"); $arrThis["here"][] = array("XiDataId" => "asdasdas", "vcText" => "324234234"); $arrThis["here"][] = array("tr" => "ert"); $arrThis["where"][] = array("er" => "ert"); $arrThis["where"][] = array("we" => "ert"); $arrThis["where"][] = array("tr" => "ert"); ------------- gives no error at all, eventhough $arrThis and $arrItem have exactly the same format. Do you guys have an idea what is going on here? The only thing i can see could cause the problem is that $arrItem is built using "arrays within arrays": $arrItem[$arrCategory[$i]["vcItemId"]] = array(...); Can this be the cause or... In advance thx... -- Edit bug report at http://bugs.php.net/?id=17290&edit=1 -- Fixed in CVS: http://bugs.php.net/fix.php?id=17290&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=17290&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=17290&r=needtrace Try newer version: http://bugs.php.net/fix.php?id=17290&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=17290&r=support Expected behavior: http://bugs.php.net/fix.php?id=17290&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=17290&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=17290&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=17290&r=globals