Hi!

As distasteful as it seems, it absolutely should be reverted IMHO.

You seem to misunderstand something here. This behavior is a direct consequence of string offset result being a string. To revert it means to reintroduce broken string-offset pseudo-var-type that led to huge amount of bugs, never worked reliably and may as well be incompatible with current engine after all changes that were made after that. Reintroducing old broken way of handling string offsets is a MAJOR engine refactoring, and doing it in RC stage is a worst idea ever.

I do not see any way to treat result of the offset operation not as a string without engine refactoring, if you do - please explain how. If the offset is handled as a string, the direct consequence is that is behaves as a string, which means every operation working on string works on it. It's not a question of taste, it's how the engine worked. In 5.3, the engine had this weird pseudo-type called string offset, which led to a lot of problems, one of them being that $a[0][0] didn't work because DIM opcodes didn't know how to handle this pseudo-type, and had to be handled specially on each corner (and produced tons of bugs because of it). I do not consider going back to that as an option.
--
Stanislav Malyshev, Software Architect
SugarCRM: http://www.sugarcrm.com/
(408)454-6900 ext. 227

--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to