Bug #6662 Updated: array keys of type real not allowed?

From: Date: Sun, 06 May 2001 15:38:50 +0000
Subject: Bug #6662 Updated: array keys of type real not allowed?
Groups: php.dev 
Request: Send a blank email to php-dev+get-54118@lists.php.net to get a copy of this message
ID: 6662 Updated by: zeev Reported By: jeroen@polder.net Old-Status: Analyzed Status: Closed Bug Type: Scripting Engine problem Operating system: PHP Version: 4.0.2 Assigned To: Comments: Fixed in the CVS - thanks for your report! Previous Comments: --------------------------------------------------------------------------- [2000-09-16 17:00:56] stas@php.net Float keys don't work, the variable gets converted to integer. This, however, doesn't work with array initializers - this should be fixed. --------------------------------------------------------------------------- [2000-09-11 22:06:25] jeroen@polder.net It seems that array keys of type real are not allowed in class declaration: class MyClass { var $a = array( 1.5=>1, 3.5=>2, 7.5=>5, 99=>10); ... } Results in only one item 99=>10 in array. Above is accepted in PHP3. Workaround: var $a = array( '1.5'=>1, '3.5'=>2, '7.5'=>5, '99'=>10); --------------------------------------------------------------------------- ATTENTION! Do NOT reply to this email! To reply, use the web interface found at http://bugs.php.net/?id=6662&edit=2

« previous php.dev (#54118) next »