Well, since I was the one who posted it (https://twitter.com/ralphschindler/status/327084619507855361), I'll further explain it. I realized it was doing this when actually running this kind of snippet:

http://3v4l.org/ZkE6B

I must have left the public in there when I posted it to twitter. I'd have to say it's a little unintuitive when the properties are protected, but all in all, I don't dislike the behavior. Perhaps this just needs to be documented?

-ralph

On 4/24/13 10:53 AM, Johannes Schlüter wrote:
On Wed, 2013-04-24 at 11:45 -0400, Rasmus Schultz wrote:
This is all kinds of wrong:

http://3v4l.org/UZFME

So the order in which the properties were defined is the magic that makes
this work.

Wow. WTF?

Do I need to explain in detail why this is all kinds of effed up?

vsprintf()'s 2nd parameter is an array,so your objectis converted to an
array ['str1' => 'foo', 'str2'=>'bar'] and PHP arrays are ordered.

johannes





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

Reply via email to