Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:98972 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 81316 invoked from network); 5 May 2017 18:16:52 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 5 May 2017 18:16:52 -0000 Authentication-Results: pb1.pair.com smtp.mail=php@fleshgrinder.com; spf=permerror; sender-id=unknown Authentication-Results: pb1.pair.com header.from=php@fleshgrinder.com; sender-id=unknown Received-SPF: error (pb1.pair.com: domain fleshgrinder.com from 77.244.243.83 cause and error) X-PHP-List-Original-Sender: php@fleshgrinder.com X-Host-Fingerprint: 77.244.243.83 mx102.easyname.com Received: from [77.244.243.83] ([77.244.243.83:54284] helo=mx102.easyname.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id AE/7A-02776-191CC095 for ; Fri, 05 May 2017 14:16:51 -0400 Received: from cable-81-173-132-37.netcologne.de ([81.173.132.37] helo=[192.168.178.20]) by mx.easyname.com with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.84_2) (envelope-from ) id 1d6hmZ-00071j-3U; Fri, 05 May 2017 18:16:47 +0000 Reply-To: internals@lists.php.net References: <0b4f249f-f574-2dcc-4485-1d765bc4cb18@gmail.com> <33c54324-caf3-008d-ee1e-26ab492650d1@gmail.com> To: Rowan Collins , internals@lists.php.net Message-ID: <91d9980b-0890-a184-c967-e054ce48da16@fleshgrinder.com> Date: Fri, 5 May 2017 20:16:20 +0200 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0 MIME-Version: 1.0 In-Reply-To: <33c54324-caf3-008d-ee1e-26ab492650d1@gmail.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="0nbnEv75LeJbkOnHQC7WwCLpG3oQTQrgF" X-DNSBL-PBLSPAMHAUS: YES Subject: Re: [PHP-DEV] Add is_vectorlike($array) function From: php@fleshgrinder.com (Fleshgrinder) --0nbnEv75LeJbkOnHQC7WwCLpG3oQTQrgF Content-Type: multipart/mixed; boundary="jjfDpn5Wtd8XGARtgiocqohMSKEw3jwpk"; protected-headers="v1" From: Fleshgrinder Reply-To: internals@lists.php.net To: Rowan Collins , internals@lists.php.net Message-ID: <91d9980b-0890-a184-c967-e054ce48da16@fleshgrinder.com> Subject: Re: [PHP-DEV] Add is_vectorlike($array) function References: <0b4f249f-f574-2dcc-4485-1d765bc4cb18@gmail.com> <33c54324-caf3-008d-ee1e-26ab492650d1@gmail.com> In-Reply-To: <33c54324-caf3-008d-ee1e-26ab492650d1@gmail.com> --jjfDpn5Wtd8XGARtgiocqohMSKEw3jwpk Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 5/5/2017 12:00 AM, Rowan Collins wrote: > On 04/05/2017 13:51, Michael Morris wrote: >> For what it's worth, the Drupal assertion inspector calls these "Stric= t >> Arrays" since that's what they are - arrays in the true sense of the t= erm >> found in all other languages. What PHP is calling an "array" is more >> accurately a "map" or "hash" >=20 > I'm not sure on that terminology. Many languages / environments have > "sparse" arrays, arrays with negative indexes, and other variants. It's= > true that PHP's "array" type goes well beyond those, but we're talking > about more than "non-associative" here (or I hope we are). >=20 > I think possibly the best term would be "list" - a collection where > order is preserved, but there is no separate notion of keys: on a > "list-like array", $foo[42] can be seen as "access the 43rd value", not= > "access the value with key 42". >=20 > Regards, >=20 The terminology here is, as is often the case, very blurry. Many programming languages call resizable arrays vectors. Most often this stems from the actual implementation, or simply because they require a different name for the keyword. In Java it would be `ArrayList`, whereas `Vector` is the thread-safe counter-part to it. However, I think that vector is the best name. --=20 Richard "Fleshgrinder" Fussenegger --jjfDpn5Wtd8XGARtgiocqohMSKEw3jwpk-- --0nbnEv75LeJbkOnHQC7WwCLpG3oQTQrgF Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQIcBAEBCAAGBQJZDMGIAAoJEOKkKcqFPVVrLCQP/26FSfeLuqo9NgNh+Pk1Xxkf nAM7U7yx5+VdT05JYw8CfwS0GV9YE/GU43ly6Ds7eKUD+/TibpD27pLJkyoDNvzx zttn6pq53PQQ1VzD7hedWJ8UAkNncLs8lg/Ht/6Q3bgR1X/8lK0bWqnhQEwXQsSM RTJVko/m+JaYrlcPlFXIhoTyGB7PZfVyU59zNp3ELrTb3m3A6PF1hIfwfQrXDPGx iqS5/wEKbALolsrlTL5+GNnfNmwpOMBQm/03otfrWxzWn/tHTXN+zpi7cTNCzpNx N0iUXeJddT/51nZ+UkgWul6DjiwVhyAfr0Jm7gxZL4ljRD4IPpE0aA+RW0JfY0wP 3dP0LL6APYtjvLWbfD7/sPJCFfrR2yjez6nHz7SGnS/QbQSBldbZQvnzgND4TeOI CDPiHfqhvk4kQHDjeAYM4uS2CsoMnC8DmKTblvTh6a2XzBDp8FPN55h+iDnRpW1p PCaKDGwnFLKT+UAmXRtiI+/TyOybpBHQK5Fsd6BFKxWEM6Fj5MdvrQATSfSNRkWI SgCu+uLH0/pxR1P7sQdVdrf137q08wvlTuQA1lX33+mJfhmP9mMt0UEmuy/NriIH /m+ne98qE41x9xIv9pABslJKscEFuRXQG3YFTndhQ6wbduIj77DO3KdRRrHmpLFh rTzmx4fCeVvbGR14gjxF =VUzu -----END PGP SIGNATURE----- --0nbnEv75LeJbkOnHQC7WwCLpG3oQTQrgF--