From:             nospam0 at malkusch dot de
Operating system: *
PHP version:      5.0.0
PHP Bug Type:     Strings related
Bug description:  behaviour of $string['text'] = 'new string';

Description:
------------
$string = 'a bla'; 
$string['index'] = 'b blub'; 
 
does the same work as 
 
$string = 'a bla'; 
$string{(int)'index'} = 'b blub'{0}; 
 
without any notic of undefined index or too long replacing 
string. But it should throw any notice, because one could 
expect that the code should produce a new Array('index' => 
'b blubb'). 
 

Reproduce code:
---------------
$string = 'a bla';
$string['index'] = 'b blub';
var_dump($string);

Expected result:
----------------
Either notices for use of deprecated [], undefined offset 
'index' and too long replace char (and of course the 
actual result) 
 
or 'a bla' is deleted and $string has array('index' => 'b 
blubb') as value. 

Actual result:
--------------
string(5) "b bla" 

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

Reply via email to