ID: 8325
Updated by: [email]helly@php.net[/email]
Reported By: cynic at mail dot cz
-Status: Open
+Status: Bogus
Bug Type: Feature/Change Request
Operating System: *
PHP Version: 4.0 Latest CVS (19/12/2000)
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
[url]http://www.php.net/manual/[/url] and the instructions on how to report
a bug at [url]http://bugs.php.net/how-to-report.php[/url]

Indexes with numerical vales (zero or positive) are casted to integer.


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

[2003-02-08 12:36:42] [email]moriyoshi@php.net[/email]

Related to bug #21918


------------------------------------------------------------------------

[2000-12-19 15:54:22] cynic at mail dot cz

(Actually, this is for PHP 4 versions up to 4.0.4 RC6, but it ain't in
the version list.)

I don't want to sound harsh or something, and this behavior seemed to
be accepted as feature from what I saw elsewhere in the bug database
(can't find it, though), but I think it shouldn't be that way.

Current behavior:

<?
$p = 1 ;
settype( $p , 'string' ) ;
$a = array( $p => 'aaaa' ) ;
var_dump( $a ) ;
?>

output (note: casting within the array() doesn't help):
string(1) "1"
array(1) {
[1]=>
string(4) "aaaa"
}


'Right' (YMMV) behavior:
string(1) "1"
array(1) {
["1"]=>
string(4) "aaaa"
}


------------------------------------------------------------------------


--
Edit this bug report at [url]http://bugs.php.net/?id=8325&edit=1[/url]