ID:               29271
 Updated by:       [EMAIL PROTECTED]
 Reported By:      nospam0 at malkusch dot de
-Status:           Open
+Status:           Bogus
 Bug Type:         Strings related
 Operating System: *
 PHP Version:      5.0.0
 New Comment:

Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.php.net/manual/ and the instructions on how to report
a bug at http://bugs.php.net/how-to-report.php

It's expected behaviour: 'index' is casted to it's integer value (0),
that's why you get this result.


Previous Comments:
------------------------------------------------------------------------

[2004-07-20 01:54:22] nospam0 at malkusch dot de

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 this bug report at http://bugs.php.net/?id=29271&edit=1

Reply via email to