ID: 35285 Updated by: [EMAIL PROTECTED] Reported By: admin at sellchain dot com -Status: Open +Status: Bogus Bug Type: Scripting Engine problem Operating System: Windows Server 2003 PHP Version: 5.0.5 New Comment:
Sorry, but your problem does not imply a bug in PHP itself. For a list of more appropriate places to ask for help using PHP, please visit http://www.php.net/support.php as this bug system is not the appropriate forum for asking support questions. Due to the volume of reports we can not explain in detail here why your report is not a bug. The support channels will be able to provide an explanation for you. Thank you for your interest in PHP. Previous Comments: ------------------------------------------------------------------------ [2005-11-18 21:53:58] admin at sellchain dot com Description: ------------ When using PHP to build a multi-dimensional array, the first 5 days, this code worked fine. Suddenly, PHP got picky, and decided it shouldn't work anymore. # Because i declare $myp to become empty, (because this $myp is put into a loop), I want the array to be empty next time around. So I declared it $myp='' before it starts. This worked fine for a few days, I have been testing this inside and out. All of a sudden FOR NO REASON, it just starts telling me this error. ''Cannot use string offset as an array site'' Hmm? Well I did manage to fix it, by declaring $myp[0][0]='' instead of $myp='', however it seems like a really weird bug, because it decided to jump at me 5 days after usage. Code examples below. Maybe you guys should look into it. Reproduce code: --------------- <? $myp=''; $myp=BuildAMultiArray(0,0,"test"); $GTIN = $myp[0][0]; echo $GTIN; function BuildAMultiArray($l1, $l2, $str) { $built[$l1][$l2] = $str; return $built; } ?> Expected result: ---------------- test Actual result: -------------- CODE THAT FIXED IT: <? $myp[0][0]=''; $myp=BuildAMultiArray(0,0,"test"); $GTIN = $myp[0][0]; function BuildAMultiArray($l1, $l2, $str) { $built[$l1][$l2] = $str; return $built; } ?> ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=35285&edit=1