Date: 12/19/00
- Next message: Martin Sigut: "[PHP-DEV] RE: PHP 4.0 Bug #8152 Updated: DOM module requires libxml >= 2.0"
- Previous message: Leon Atkinson: "Re: [PHP-DEV] Weird question"
- Next in thread: Ignacio Vazquez-Abrams: "Re: [PHP-DEV] PHP 4.0 Bug #8325: numeric strings used as keys are converted to longs"
- Reply: Ignacio Vazquez-Abrams: "Re: [PHP-DEV] PHP 4.0 Bug #8325: numeric strings used as keys are converted to longs"
- Maybe reply: Cynic: "Re: [PHP-DEV] PHP 4.0 Bug #8325: numeric strings used as keys are converted to longs"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
From: cynic <email protected>
Operating system: *
PHP version: 4.0 Latest CVS (19/12/2000)
PHP Bug Type: Feature/Change Request
Bug description: numeric strings used as keys are converted to longs
(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 Bug report at: http://bugs.php.net/?id=8325&edit=1-- PHP Development Mailing List <http://www.php.net/> To unsubscribe, e-mail: php-dev-unsubscribe <email protected> For additional commands, e-mail: php-dev-help <email protected> To contact the list administrators, e-mail: php-list-admin <email protected>
- Next message: Martin Sigut: "[PHP-DEV] RE: PHP 4.0 Bug #8152 Updated: DOM module requires libxml >= 2.0"
- Previous message: Leon Atkinson: "Re: [PHP-DEV] Weird question"
- Next in thread: Ignacio Vazquez-Abrams: "Re: [PHP-DEV] PHP 4.0 Bug #8325: numeric strings used as keys are converted to longs"
- Reply: Ignacio Vazquez-Abrams: "Re: [PHP-DEV] PHP 4.0 Bug #8325: numeric strings used as keys are converted to longs"
- Maybe reply: Cynic: "Re: [PHP-DEV] PHP 4.0 Bug #8325: numeric strings used as keys are converted to longs"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]

