From:             reklov at unitedklasens dot de
Operating system: Win98SE
PHP version:      4.3.4
PHP Bug Type:     Arrays related
Bug description:  Array creation with '{}' instead of '[]'

Description:
------------
With $var{$i} = 'Test' I wanted to create a variable with the name 'var1',
using the '{}' and $i == 1, like ${$a}
(http://www.php.net/manual/en/language.variables.variable.php)
Insted of this, it will create an array, as if I had used '[]' instead of
'{}'.

Reproduce code:
---------------
<?php
$i = 1;
$var{$i} = 'Test';
echo $var{$i};
echo '<br>';
echo $var{1};
echo '<br>';
echo $var1;
?>

Expected result:
----------------
Test<br>
Test<br>  //not sure, what would happen...
Test

Actual result:
--------------
Test<br>
Test<br>


-- 
Edit bug report at http://bugs.php.net/?id=26980&edit=1
-- 
Try a CVS snapshot (php4):  http://bugs.php.net/fix.php?id=26980&r=trysnapshot4
Try a CVS snapshot (php5):  http://bugs.php.net/fix.php?id=26980&r=trysnapshot5
Fixed in CVS:               http://bugs.php.net/fix.php?id=26980&r=fixedcvs
Fixed in release:           http://bugs.php.net/fix.php?id=26980&r=alreadyfixed
Need backtrace:             http://bugs.php.net/fix.php?id=26980&r=needtrace
Need Reproduce Script:      http://bugs.php.net/fix.php?id=26980&r=needscript
Try newer version:          http://bugs.php.net/fix.php?id=26980&r=oldversion
Not developer issue:        http://bugs.php.net/fix.php?id=26980&r=support
Expected behavior:          http://bugs.php.net/fix.php?id=26980&r=notwrong
Not enough info:            http://bugs.php.net/fix.php?id=26980&r=notenoughinfo
Submitted twice:            http://bugs.php.net/fix.php?id=26980&r=submittedtwice
register_globals:           http://bugs.php.net/fix.php?id=26980&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=26980&r=php3
Daylight Savings:           http://bugs.php.net/fix.php?id=26980&r=dst
IIS Stability:              http://bugs.php.net/fix.php?id=26980&r=isapi
Install GNU Sed:            http://bugs.php.net/fix.php?id=26980&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=26980&r=float

Reply via email to