Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:67129 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 80077 invoked from network); 24 Apr 2013 16:37:00 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 24 Apr 2013 16:37:00 -0000 Authentication-Results: pb1.pair.com smtp.mail=rquadling@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=rquadling@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.223.172 as permitted sender) X-PHP-List-Original-Sender: rquadling@gmail.com X-Host-Fingerprint: 209.85.223.172 mail-ie0-f172.google.com Received: from [209.85.223.172] ([209.85.223.172:42835] helo=mail-ie0-f172.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id E2/E3-60231-B2A08715 for ; Wed, 24 Apr 2013 12:36:59 -0400 Received: by mail-ie0-f172.google.com with SMTP id c12so2384064ieb.3 for ; Wed, 24 Apr 2013 09:36:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:mime-version:reply-to:in-reply-to:references:from:date :message-id:subject:to:cc:content-type; bh=d3JlAOOVp7ILFgRe2zUL3PEZE4iA6Q9tYFQkq5Ng1w0=; b=YwvuAJcjTWY0vY+5YvLA99AdMiqnHcDOoXYyAVGPEZqxfimUYWCK7tdGlM3tTtwde0 S/lUGXZkL0Z+D1EHcETGr8qExvhBXBunyeyCkQ1sTRZON6Y5MJqicd8RMZ8Q7r4tR9Yc DxgLPyj1RpAKdBGBsdDKXwviu1Waxr6Bq5lLtC2SX0LTYGqAqsJHGS4whI/vwkPL1pPf sZ3NYsYOjvmZ7G845mbkpRDrdVUNjxIoqjfuXO8QLQRSy33UjJ5VZ5CIQiO8n3eI+/7O R0QdjDzlKkEEtG5YMzcKVMangNlGfcvN60l0mknVwoA7m3xct+YoPN/0TTav+UkdcFqi D8rA== X-Received: by 10.50.67.18 with SMTP id j18mr15891222igt.110.1366821417068; Wed, 24 Apr 2013 09:36:57 -0700 (PDT) MIME-Version: 1.0 Received: by 10.64.22.170 with HTTP; Wed, 24 Apr 2013 09:36:36 -0700 (PDT) Reply-To: RQuadling@GMail.com In-Reply-To: References: Date: Wed, 24 Apr 2013 17:36:36 +0100 Message-ID: To: Richard Bradley Cc: Rasmus Schultz , PHP internals Content-Type: multipart/alternative; boundary=047d7bdc053209419204db1de9a8 Subject: Re: [PHP-DEV] vsprintf() From: rquadling@gmail.com (Richard Quadling) --047d7bdc053209419204db1de9a8 Content-Type: text/plain; charset=UTF-8 On 24 April 2013 17:31, Richard Bradley wrote: > > -----Original Message----- > > From: Rasmus Schultz [mailto:rasmus@mindplay.dk] > > Sent: 24 April 2013 16:45 > > To: PHP internals > > Subject: [PHP-DEV] vsprintf() > > > > 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? > > Yes, please. > > What's the big deal here? If you coerce an object to an array, you get the > public > properties in the order in which they were declared. > > See http://www.php.net/manual/en/language.types.array.php > > "If an object is converted to an array, the result is an array whose > elements are the > object's properties. The keys are the member variable names, with a few > notable > exceptions: ...." > > What was the point of your email? Did you hope for some action to arise, > or are > you just letting off steam? > > Best, > > > Rich Oh! Another magic method opportunity ... /** * Operates just like __toString(), but returns an array. */ public function __toArray(); (ducking) -- Richard Quadling Twitter : @RQuadling --047d7bdc053209419204db1de9a8--