Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:67135 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 91322 invoked from network); 24 Apr 2013 17:54:22 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 24 Apr 2013 17:54:22 -0000 Authentication-Results: pb1.pair.com smtp.mail=ralph@ralphschindler.com; spf=permerror; sender-id=unknown Authentication-Results: pb1.pair.com header.from=ralph@ralphschindler.com; sender-id=unknown Received-SPF: error (pb1.pair.com: domain ralphschindler.com from 209.85.219.49 cause and error) X-PHP-List-Original-Sender: ralph@ralphschindler.com X-Host-Fingerprint: 209.85.219.49 mail-oa0-f49.google.com Received: from [209.85.219.49] ([209.85.219.49:55728] helo=mail-oa0-f49.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 2A/46-60231-D4C18715 for ; Wed, 24 Apr 2013 13:54:21 -0400 Received: by mail-oa0-f49.google.com with SMTP id j1so2026170oag.36 for ; Wed, 24 Apr 2013 10:54:17 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:message-id:date:from:user-agent:mime-version:to:subject :references:in-reply-to:content-type:content-transfer-encoding :x-gm-message-state; bh=TTICG/1ZgIbdlVDh8Ta0NMHQ9R9wZLpTPOUBxXBYlis=; b=Kay7ERnCaB7SeYRCrHGlxEJuM6DUpcPNuhey67EEdIuVoAR3JMtLLUM+YmDxWT0stt O3GfFSnERGFuXf0wEqYzNhurnBr0fAwGHrcVVijnhtv4BOsGx6z/iWZI+wXW7gPq0RM3 zziKHxET/MBls/PmyrVYD9kbyfJLtk7GG1AbQx9R0pYHzWfZZ5ZLn5gsGV8NJznimX05 L3SCcAP+ecZl2+NXwmoZBWFyB/AU2/IINcRK7MqYnjX95dLNwHuDRuW6PdtgvHt2QLWy 9EW34p7OPnMcQr/7XItaDpPONpvLLB7zixwVrWD2nyz2UANkSr+ID/HDKDKuxai8mrqh xAkg== X-Received: by 10.60.125.41 with SMTP id mn9mr6978809oeb.84.1366826057677; Wed, 24 Apr 2013 10:54:17 -0700 (PDT) Received: from Ralphs-Mac-Pro.local (ip174-73-14-247.no.no.cox.net. [174.73.14.247]) by mx.google.com with ESMTPSA id t9sm1578307obk.13.2013.04.24.10.54.15 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 24 Apr 2013 10:54:16 -0700 (PDT) Message-ID: <51781C46.8080904@ralphschindler.com> Date: Wed, 24 Apr 2013 12:54:14 -0500 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.8; rv:17.0) Gecko/20130328 Thunderbird/17.0.5 MIME-Version: 1.0 To: internals@lists.php.net References: <1366818838.2564.36.camel@guybrush> In-Reply-To: <1366818838.2564.36.camel@guybrush> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Gm-Message-State: ALoCoQkvXXkAE+cBzMbLo8J/r0fhibd4MLSaHufQpATMW3csUIaLtQUjugDFtao+pjB7NQ9wduoU Subject: Re: [PHP-DEV] vsprintf() From: ralph@ralphschindler.com (Ralph Schindler) 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 > > >