Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:71345 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 21814 invoked from network); 20 Jan 2014 20:20:06 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 20 Jan 2014 20:20:06 -0000 Authentication-Results: pb1.pair.com header.from=pjsturgeon@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=pjsturgeon@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.217.176 as permitted sender) X-PHP-List-Original-Sender: pjsturgeon@gmail.com X-Host-Fingerprint: 209.85.217.176 mail-lb0-f176.google.com Received: from [209.85.217.176] ([209.85.217.176:56831] helo=mail-lb0-f176.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 22/57-02192-3F48DD25 for ; Mon, 20 Jan 2014 15:20:05 -0500 Received: by mail-lb0-f176.google.com with SMTP id w7so4713535lbi.7 for ; Mon, 20 Jan 2014 12:20:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=PMH5ms/Zf8PXJBnFGEsj3c6aDsb6SnYWCZ/t4BRo74s=; b=ZjMNLVAhCBhZh9FIIFSfzKRrwMDUJfRZF+iW2r2ZhcQaBVTersrnHOea5C9cRfvTb+ mXNcPOnAWtAj0v/l6RQWu788wep9pQ82t1j5UEzz7RUR2yvkrWtaaTpv5NNp6UA7mPhF 6o2RXgzFsqqei9uJ+ZyQqlyNGQRUpAE8mwGY0dxWzRzfpVx4G290kHaBcYPZ1sRL3gJb fsyJlvxBIBu//sFKPSvuYtWzj7pXs6djz0G8RyDVzo8qW99Qo8bFF1ygd2/5aDCFbw1z wgOlmOjg9lou/SUTAEQIJT3gTY9IfPfYtfhSnPMHFGUtpeVX6+CHkpZ9Dioo6fJLSl0W h3LA== MIME-Version: 1.0 X-Received: by 10.152.120.231 with SMTP id lf7mr3252932lab.36.1390249201012; Mon, 20 Jan 2014 12:20:01 -0800 (PST) Received: by 10.114.66.44 with HTTP; Mon, 20 Jan 2014 12:20:00 -0800 (PST) In-Reply-To: <009001cf1618$9667e090$c337a1b0$@tutteli.ch> References: <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> <52DCA3E7.80602@lerdorf.com> <52DCED71.3020207@pthreads.org> <009001cf1618$9667e090$c337a1b0$@tutteli.ch> Date: Mon, 20 Jan 2014 15:20:00 -0500 Message-ID: To: Robert Stoll Cc: Nikita Nefedov , "internals@lists.php.net" Content-Type: text/plain; charset=ISO-8859-1 Subject: Re: [PHP-DEV] Introducing "Array Of" RFC From: pjsturgeon@gmail.com (Philip Sturgeon) On Mon, Jan 20, 2014 at 2:48 PM, Robert Stoll wrote: >> >> I would love to get generics as long as typed arrays. And when I say typed >> arrays I mean array which can hold only the elements of said class (not an >> interface). It's not just semantics, it's also optimization that can be >> done when you know that array will hold only elements of the said type. >> (You know how much memory element will take. It'll make a room for >> possible optimizations) >> > > Hm.. I did not understand the RFC this way. It says, "allowing an array of that hinted type to be passed as an argument", so I assumed it would work with interfaces as well. > And what about sub-types? > > > -- > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: http://www.php.net/unsub.php > The RFC supports type-hinting against anything that you can currently type-hint against, just with the addition of [] to say "an array of them."