#29556 [NEW]: inconsistent dereference using multidimensional arrays inside strings

From: Date: Fri, 06 Aug 2004 19:28:59 +0000
Subject: #29556 [NEW]: inconsistent dereference using multidimensional arrays inside strings
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-64205@lists.php.net to get a copy of this message
From: ash at aeria dot net Operating system: FreeBSD4 PHP version: 4.3.8 PHP Bug Type: Strings related Bug description: inconsistent dereference using multidimensional arrays inside strings Description: ------------ Arrays containing strings may be used inline as thus: $vec = array (1=>"foo",2=>"baz"); echo "$vec[1]"; Fine. However if you use a multidim array instead, you end with the 'Array' reference string. I think the RE that contcatenates text should have better judgement about where a variables key might stop. The issue is present in all the php version I have access to. Or mabe this was fixed in .9 and I missed the other bug This is my php version PHP 4.3.8 (cli) (built: Jul 30 2004 17:08:10) Copyright (c) 1997-2004 The PHP Group Zend Engine v1.3.0, Copyright (c) 1998-2004 Zend Technologies Exit 1 Reproduce code: --------------- <? $grid[1][1]= "textstring"; echo "$grid[1][1]"; #this outputs 'Array[1]' echo $grid[1][1]; #this works ?> Expected result: ---------------- textstringtextstring Actual result: -------------- root@sqee.aeria.net:bin}./php ~/foo.php Array[1]textstring -- Edit bug report at http://bugs.php.net/?id=29556&edit=1 -- Try a CVS snapshot (php4): http://bugs.php.net/fix.php?id=29556&r=trysnapshot4 Try a CVS snapshot (php5): http://bugs.php.net/fix.php?id=29556&r=trysnapshot5 Fixed in CVS: http://bugs.php.net/fix.php?id=29556&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=29556&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=29556&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=29556&r=needscript Try newer version: http://bugs.php.net/fix.php?id=29556&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=29556&r=support Expected behavior: http://bugs.php.net/fix.php?id=29556&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=29556&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=29556&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=29556&r=globals PHP 3 support discontinued: http://bugs.php.net/fix.php?id=29556&r=php3 Daylight Savings: http://bugs.php.net/fix.php?id=29556&r=dst IIS Stability: http://bugs.php.net/fix.php?id=29556&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=29556&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=29556&r=float

« previous php.bugs (#64205) next »