Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:64543 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 27626 invoked from network); 5 Jan 2013 10:31:27 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 5 Jan 2013 10:31:27 -0000 Authentication-Results: pb1.pair.com header.from=inefedor@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=inefedor@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.215.51 as permitted sender) X-PHP-List-Original-Sender: inefedor@gmail.com X-Host-Fingerprint: 209.85.215.51 mail-la0-f51.google.com Received: from [209.85.215.51] ([209.85.215.51:49652] helo=mail-la0-f51.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 1F/6D-38386-DF008E05 for ; Sat, 05 Jan 2013 05:31:26 -0500 Received: by mail-la0-f51.google.com with SMTP id fj20so11217069lab.10 for ; Sat, 05 Jan 2013 02:31:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:content-type:to:cc:subject:references:date:mime-version :from:message-id:in-reply-to:user-agent; bh=XlIQLecrGqkvDdbjxDB/EF4bvGNNgVpslmFplJnHReo=; b=UbJtlTAOvn1OIJCPiISr4aEqaYelOxel7DytxoP5iireDYGLFXHWrovP1LdCiSiPco x41ibWVSpFFnznLn+falK4u2IAMl2a1AJ4jzxiuSZE9jP5GN3VbORi4jAEILof/aetDm SKLgA8ZuYHynvv7ksZJg9FheOhGypi4r6Wkv6O2Kn9BROm7lZuWbU4CN1SropX3Ygru8 fEGEepIk82lWLZItiDVNdj5mZxDogf/lPVdUBTkUVrfInUhoEh3LGKqHNOKlzuLIxrYQ eS+iinoOKs+Ww8HiIfz9Y+FjNtEkWuaoQNH1PLynYvmoeF5YNL4Mxs2kJtDiL0OI/l6i fUBg== X-Received: by 10.112.54.6 with SMTP id f6mr22618632lbp.71.1357381882993; Sat, 05 Jan 2013 02:31:22 -0800 (PST) Received: from nikita2206-debian (128-72-169-108.broadband.corbina.ru. [128.72.169.108]) by mx.google.com with ESMTPS id v6sm18705409lbf.11.2013.01.05.02.31.21 (version=TLSv1/SSLv3 cipher=OTHER); Sat, 05 Jan 2013 02:31:21 -0800 (PST) Content-Type: multipart/alternative; boundary=----------2PYqI2Fe9FfcOhOWmmuiaJ To: Crocodile Cc: "internals@lists.php.net" References: Date: Sat, 05 Jan 2013 14:31:16 -0000 MIME-Version: 1.0 Message-ID: In-Reply-To: User-Agent: Opera Mail/12.12 (Linux) Subject: Re: [PHP-DEV] Ruby's symbols From: inefedor@gmail.com ("Nikita Nefedov") ------------2PYqI2Fe9FfcOhOWmmuiaJ Content-Type: text/plain; charset=utf-8; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit On Sat, 05 Jan 2013 10:27:01 -0000, Crocodile wrote: > Sounds like it could make some sense. However, I've got a question.. > > array( > 'label' => 'Comment', > 'required' => false, > 'property_path' => 'properties.comment' > ) > >> is actually equivalent to > >> array( > 'label' => 'Comment', > 'property_path' => 'properties.comment', > 'required' => false, > ) > >> (Notice the change in keys order. As long as we just use those arrays >> as hash maps, we notice no differences). > >> With symbols, which act as aliases for integer array keys, the >> situation could be different, right? Or excuse me if I don't get what >> symbols are (I don't >know much about Ruby) > >> Cheers, > Victor > > 2013/1/5 Nikita Nefedov >> array( >> 'label' => 'Comment', >> 'required' => false, >> 'property_path' => 'properties.comment' >> ) > Hi, PHP arrays are always ordered (they actually are doubly-linked lists and hash tables at the same time), so there won't be any change in ordering behavior. ------------2PYqI2Fe9FfcOhOWmmuiaJ Content-Type: multipart/related; boundary=----------2PYqI2Fe9FfcOhCaQDqIKc ------------2PYqI2Fe9FfcOhCaQDqIKc Content-Type: text/html; charset=utf-8 Content-ID: Content-Transfer-Encoding: Quoted-Printable On Sat, 05 Jan 2013 10:27:01 -0000, Crocodile <crocodile2u@gmai= l.com> wrote:

Sounds like it could make some sense. However, I've got a = question..

arra= y(
 'label' =3D> 'Comment',
 'required' =3D> false,
 'prope= rty_path' =3D> 'properties.comment'
)

<= /div>
is actu= ally equivalent to

array(
 'lab= el' =3D> 'Comment',
 'property_path' =3D> 'properties.comment',
 'required' =3D> false,
)

(Noti= ce the change in keys order. As long as we just use those arrays as hash= maps, we notice no differences).

<= /div>
With sy= mbols, which act as aliases for integer array keys, the situation could = be different, right? Or excuse me if I don't get what symbols are (I don= 't know much about Ruby)

<= /div>
Cheers,=
Victor

2013/1/5 Nikita Nefedov <= ;inefedor@gmail.= com>
array(
                'label' =3D> = 'Comment',
                'required' =3D&g= t; false,
                'property_path' = =3D> 'properties.comment'
            )

=

Hi,

PHP arrays= are always ordered (they actually are doubly-linked lists and hash tabl= es at the same time), so there won't be any change in ordering behavior.=
------------2PYqI2Fe9FfcOhCaQDqIKc-- ------------2PYqI2Fe9FfcOhOWmmuiaJ--