Re: PHP 4.0 Bug #6662: array keys of type real not allowed?
| From: | Stanislav Malyshev | Date: | Tue, 12 Sep 2000 11:30:27 +0000 |
| Subject: | Re: PHP 4.0 Bug #6662: array keys of type real not allowed? | ||
| References: | 1 | Groups: | php.dev |
| Request: | Send a blank email to php-dev+get-33032@lists.php.net to get a copy of this message | ||
>> 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);
>> ...
>> }
Generally, array keys indeed cannot be floats, just integers or strings
(it's also semantically unclear what should float key mean, especially
taking in account accuracy problems). However, I agree that at least
warning should be given in this case.
--
Stanislav Malyshev stas@zend.com http://www.zend.com/
+972-3-6139665 ext.106