[PHP-DEV] Bug #6662 Updated: array keys of type real not allowed?

2001-09-24 Thread jeroen

ID: 6662
Updated by: jeroen
Reported By: [EMAIL PROTECTED]
Status: Closed
Bug Type: Scripting Engine problem
Operating System: linux
PHP Version: 4.0.2
New Comment:

From the docs (by heart): in object initializers only constant scalar experssions are 
allowed, no arrays, objects, or expressions, only simple int/float/etc.

That's incorrect thus? Should be 'only constant values', because arrays and 'new 
Object()' are allowed? Or arrays only?

IMO, it should be the case, but I don't know wether it's supported in ZE1.

Previous Comments:


[2001-05-06 11:38:46] [EMAIL PROTECTED]

Fixed in the CVS - thanks for your report!



[2000-09-16 17:00:56] [EMAIL PROTECTED]

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] [EMAIL PROTECTED]

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);







Edit this bug report at http://bugs.php.net/?id=6662edit=1


-- 
PHP Development Mailing List http://www.php.net/
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP-DEV] Bug #6662 Updated: array keys of type real not allowed?

2001-05-06 Thread zeev

ID: 6662
Updated by: zeev
Reported By: [EMAIL PROTECTED]
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] [EMAIL PROTECTED]
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] [EMAIL PROTECTED]
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=6662edit=2


-- 
PHP Development Mailing List http://www.php.net/
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]