Re: Array dereferencing of scalars

From: Date: Tue, 09 Jun 2015 14:02:53 +0000
Subject: Re: Array dereferencing of scalars
References: 1 2 3 4 5 6 7  Groups: php.internals 
Request: Send a blank email to [email protected] to get a copy of this message
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.
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. Regards, -- Rowan Collins [IMSoP]

Thread (27 messages)

« previous php.internals (#86526) next »