Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:61171 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 14274 invoked from network); 12 Jul 2012 16:38:33 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 12 Jul 2012 16:38:33 -0000 Authentication-Results: pb1.pair.com header.from=rasmus@lerdorf.com; sender-id=unknown Authentication-Results: pb1.pair.com smtp.mail=rasmus@lerdorf.com; spf=permerror; sender-id=unknown Received-SPF: error (pb1.pair.com: domain lerdorf.com from 209.85.213.42 cause and error) X-PHP-List-Original-Sender: rasmus@lerdorf.com X-Host-Fingerprint: 209.85.213.42 mail-yw0-f42.google.com Received: from [209.85.213.42] ([209.85.213.42:38641] helo=mail-yw0-f42.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 0A/70-11045-78DFEFF4 for ; Thu, 12 Jul 2012 12:38:32 -0400 Received: by yhoo21 with SMTP id o21so1723411yho.29 for ; Thu, 12 Jul 2012 09:38:28 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:x-enigmail-version:content-type :content-transfer-encoding:x-gm-message-state; bh=Mdx486tvRb+DjUDkfs2IzYQKgLMxI3qP7CoBgtdI8tE=; b=lvRqLd0AcbN1DUij5zpzq76gV15AGGbb6MIugZWdldeAeAPeCt/rj8loQUda+sH3n7 cZ7CWmbCyqiiIQ5ivEOlwVkEl9VMqRur1JeRaDDFn4i+2+S19U6zf7v950AkOUr93UQG aJPZrMp1813emJJqqDQUj9/skMKnXwIBMAk9XrlkfYQ7QmFPBzuXLd59zr6f+PhNHezc DGpR/hv+3EzGCLXaPEBb16IDXf+nYSYb6+Ah61gCdudI973PEuxIAUIEj5J1ntar1pnh pb9+bawp7QLMMugSwY6b3YAkayrPscgI6+SU6a1J1Nw5MshhRO0TXFHJcu3h/J6hZTHh bjqg== Received: by 10.236.153.104 with SMTP id e68mr62537813yhk.36.1342111108789; Thu, 12 Jul 2012 09:38:28 -0700 (PDT) Received: from [172.16.26.30] ([38.106.64.245]) by mx.google.com with ESMTPS id g22sm9587556yhh.20.2012.07.12.09.38.26 (version=SSLv3 cipher=OTHER); Thu, 12 Jul 2012 09:38:28 -0700 (PDT) Message-ID: <4FFEFD81.6020404@lerdorf.com> Date: Thu, 12 Jul 2012 09:38:25 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:13.0) Gecko/20120615 Thunderbird/13.0.1 MIME-Version: 1.0 To: Stas Malyshev CC: Anthony Ferrara , "internals@lists.php.net" References: <4FFEFBB3.7090507@sugarcrm.com> In-Reply-To: <4FFEFBB3.7090507@sugarcrm.com> X-Enigmail-Version: 1.4.2 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Gm-Message-State: ALoCoQmOsg07HoxyaZGmqlVe+Gn/gReuQPh+O4HUXOI0zCTC/l2Whs+ctP/Wznq7v1L4q7utV5gL Subject: Re: [PHP-DEV] Iterable Type Hint From: rasmus@lerdorf.com (Rasmus Lerdorf) On 07/12/2012 09:30 AM, Stas Malyshev wrote: > Hi! > >> Would it be worth while adding a new type hint that checks for this >> condition? I'd propose Iterable: > > I see more and more multiplication of weird ad-hoc type checks. First we > had "callable", now "traversable", then we invent more and more weird > functional types with complex logic. I don't like this development at > all. It's ad-hoc introducing of half-baked, unstandartized, undesigned > strict typing. Strict typing is not a good idea for PHP, and weird > strict typing based on complex conditions hidden from the user is even > worse IMO. For non-interchangeable types it is already strict by definition. I don't see a problem with type hints that make life easier on both the caller (by generating better error messages) and the callee (by having to write less boilerplate type verification code). You may have a point on the ad-hoc nature of it and that we need to do it once and for all in a more organized fashion, but the basic premise looks ok to me. -Rasmus