Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:71241 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 13294 invoked from network); 18 Jan 2014 12:36:12 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 18 Jan 2014 12:36:12 -0000 Authentication-Results: pb1.pair.com header.from=are.you.winning@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=are.you.winning@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.216.169 as permitted sender) X-PHP-List-Original-Sender: are.you.winning@gmail.com X-Host-Fingerprint: 209.85.216.169 mail-qc0-f169.google.com Received: from [209.85.216.169] ([209.85.216.169:49856] helo=mail-qc0-f169.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 57/80-08251-B357AD25 for ; Sat, 18 Jan 2014 07:36:11 -0500 Received: by mail-qc0-f169.google.com with SMTP id w7so4598135qcr.28 for ; Sat, 18 Jan 2014 04:36:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=QxqmOslMKjIycyoNPt2O+bIrz2yEO6g9gIAw9oSMk64=; b=f4Zqwp73+Xv/Ji7dQ1TMUx9zi6fVBaXqPUYuhrv3p1K5r2LuHMJftzXFYr7aHtwjdo njYRaB/vqtOJvoxwqvz9LJXTztr1KKh0N66IOV6H0kPwFCESyx69VKul51rpEK3e6Pof C+nrTfgiOE6mwAJK+mEWfWBjO4AlkpzAcXRT5xjTql+1ah8ewFXrvLhm6abw5NMkpu1S JD5Eox9hOb+QhZ5GSqHaXTjuxfPTMT2WSMQ7xJsgjfxFK8QvbbQJlFWAGk2LknPkS+Gr DNbI75ZmgzZRqVB9idOEJ1KU0w3HswkEMWm14wQjRbVUN767EOxERwxl+MlW28I+Y6Ae yqCA== MIME-Version: 1.0 X-Received: by 10.140.37.20 with SMTP id q20mr11228807qgq.65.1390048568652; Sat, 18 Jan 2014 04:36:08 -0800 (PST) Sender: are.you.winning@gmail.com Received: by 10.229.240.193 with HTTP; Sat, 18 Jan 2014 04:36:08 -0800 (PST) Received: by 10.229.240.193 with HTTP; Sat, 18 Jan 2014 04:36:08 -0800 (PST) In-Reply-To: References: <001301cf1227$6d082ab0$47188010$@tutteli.ch> <002d01cf1234$01e6dc60$05b49520$@tutteli.ch> <004c01cf123d$35730870$a0591950$@tutteli.ch> <52D71748.1090402@googlemail.com> <52D71FAE.8030002@ajf.me> <005001cf124f$3a40df00$aec29d00$@tutteli.ch> <20140116110127.202079vzjsj76n7b@webmail.tutteli.ch> <0B.B1.24763.139B7D25@pb1.pair.com> <002001cf12da$2bfbda90$83f38fb0$@tutteli.ch> Date: Sat, 18 Jan 2014 12:36:08 +0000 X-Google-Sender-Auth: 0B61a6mh3BxPZNq1njsQI_yk92g Message-ID: To: Julien Pauli Cc: internals@lists.php.net, Matthieu Napoli , Robert Stoll Content-Type: multipart/alternative; boundary=001a11c1264627b71504f03de700 Subject: Re: [PHP-DEV] Introducing "Array Of" RFC From: cw@daverandom.com (Chris Wright) --001a11c1264627b71504f03de700 Content-Type: text/plain; charset=ISO-8859-1 On 18 Jan 2014 03:53, "Julien Pauli" wrote: > I'm in favor of designing a new "typed array" structure , instead of > adding a new syntax that checks things at runtime of every function > call, mainly by iterating over the array at runtime. This, while useful, doesn't solve the same problem as this RFC is solving. You wouldn't be able to type hint for the type contained within the structure without some form of new syntax. What if we did both? So that the new syntax actually expects an SplTypedArray (or whatever you want to call it) and if an instance of this structure is passed the class entry attached to the structure can be used as an O(1) shortcut, but if an array is passed it is run through SplTypedArray::fromArray(), allowing users to pass an array and take the performance hit if they want to. Thanks, Chris --001a11c1264627b71504f03de700--