Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:71178 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 6006 invoked from network); 16 Jan 2014 11:12:27 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 16 Jan 2014 11:12:27 -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.180 as permitted sender) X-PHP-List-Original-Sender: are.you.winning@gmail.com X-Host-Fingerprint: 209.85.216.180 mail-qc0-f180.google.com Received: from [209.85.216.180] ([209.85.216.180:50795] helo=mail-qc0-f180.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id DA/E2-24763-99EB7D25 for ; Thu, 16 Jan 2014 06:12:26 -0500 Received: by mail-qc0-f180.google.com with SMTP id i17so2101904qcy.25 for ; Thu, 16 Jan 2014 03:12:23 -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=U4hLbj4pXjexQf0CqNfORYeeZcV3Wnv5gUKz/+bvWP4=; b=dfl849+n/nHvBu72EJLrLka7tcWbFcVulCVa6GHPg5lTeCs2V/SVDZKk0wv5iLnpb8 y/DlLxg1wmMNzaSqQ+quy6ZnEUgXt0T8vMQFiFEjI36sTMKonoVuthEHIhArefg3+2Km DMvBpRyc4/qHz1MmgNdsePyVWfxuM3GHn8kXgEWExYiQMweiHFUjFkMt2amJP2Vdbrj3 5rrvwZ2qRB7pWiETj6eTOhDZk9199S6imcUnUo87yrYrnuNERpKb/XRb/ILBwgJjGhlZ /XMhnmb92GobLv3TPeqzAMMFjtyaHmJ+nG7X0N5tBeng1YpnfWwWUOSAYsv3HZgDF1cL bUjA== MIME-Version: 1.0 X-Received: by 10.224.67.137 with SMTP id r9mr14668203qai.8.1389870743375; Thu, 16 Jan 2014 03:12:23 -0800 (PST) Sender: are.you.winning@gmail.com Received: by 10.229.240.193 with HTTP; Thu, 16 Jan 2014 03:12:23 -0800 (PST) In-Reply-To: <0B.B1.24763.139B7D25@pb1.pair.com> 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> Date: Thu, 16 Jan 2014 11:12:23 +0000 X-Google-Sender-Auth: yhauNjW7dd_SKhRsrHlRyyt6Mwo Message-ID: To: Matthieu Napoli Cc: "internals@lists.php.net" Content-Type: text/plain; charset=ISO-8859-1 Subject: Re: [PHP-DEV] Introducing "Array Of" RFC From: daverandom@php.net (Chris Wright) On 16 January 2014 10:49, Matthieu Napoli wrote: > The performance penalty is the same as if you were type-checking yourself. (Sorry if I'm stepping on your toes here Joe, since it was you who pointed this out to me): This is not completely true. With arrayof, there are two iterations of the passed value - one in C and one in PHP, vs only one iteration in the foreach/instanceof approach. However: - as you point out, the performance penalty for the check is negligible if it even exists - if you don't use the syntax there is no penalty whatsoever so for me this is a complete non-issue. The concise syntax and strong semantic possibilities this brings far outweigh a few microseconds of slowdown. Thanks, Chris