Rowan Collins wrote: > Christoph Becker wrote on 09/06/2015 14:09: >> I wonder where these coercion rules are described. The manual has a >> section about "Converting to array"[1] which actually describes casting, >> and is obviously not what is happening when the subscript operator (as >> the langspec calls it[2]) is applied to non-null scalars. > > There's a manual page on "Type Juggling" which is probably more > relevant: http://php.net/manual/en/language.types.type-juggling.php > > Interestingly, it notes that: > >> The behaviour of an automatic conversion to array is currently undefined.
Thanks. I've missed that. It explains the current behavior. > So, at least as far as that reference point is concerned, any change in > behaviour could be justified (if agreed by RFC) as defining what was > previously undefined. I would welcome that. In my opinion, undefined behavior is better avoided in a language specification. -- Christoph M. Becker -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php