Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:97111 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 87785 invoked from network); 22 Nov 2016 03:42:00 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 22 Nov 2016 03:42:00 -0000 Authentication-Results: pb1.pair.com header.from=smalyshev@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=smalyshev@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 74.125.83.47 as permitted sender) X-PHP-List-Original-Sender: smalyshev@gmail.com X-Host-Fingerprint: 74.125.83.47 mail-pg0-f47.google.com Received: from [74.125.83.47] ([74.125.83.47:36218] helo=mail-pg0-f47.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 09/55-40890-78EB3385 for ; Mon, 21 Nov 2016 22:41:59 -0500 Received: by mail-pg0-f47.google.com with SMTP id f188so2589237pgc.3 for ; Mon, 21 Nov 2016 19:41:59 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=subject:to:references:cc:from:message-id:date:user-agent :mime-version:in-reply-to:content-transfer-encoding; bh=dyUvPN05w5C/cOo3cG1cuIPy3GhO7ATGwODtmuN2WBM=; b=YbLYh47uZes7kKB4G3/uvfLGpgVN1+lRaR6wGRl0xuHQ5XclRb3bfm9g9zT+Tb0oRy ZMgndqa9J0Hg1ns4/tYFTuXXfaEK/RlNMfTZbsRHK+xK/YincwIhNLu7WqAK+PQp0dvg mAlsnbbcBoFQUbr+1MuPEGz7t5taRxpbRnUlnwttFyD99u+0AaOwycN74nRRqOsr46xr KLbBLqcfjGml8nmwJnl8fZAf58rzuP0KUQuEpGG/4I76kEQJPtT7ZumosYxaa+0TxiIz F11vP+JdDhdbtvzacQ3caUGR3ccYKlggfUeJ2JsHA9Om/6M4jOIcpFM05eWo/sqAmHp/ ELDw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:subject:to:references:cc:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding; bh=dyUvPN05w5C/cOo3cG1cuIPy3GhO7ATGwODtmuN2WBM=; b=auF+tYLUPMzgjDGIkJa9KY2IaCw9FVQ3DCGXnGkzXYs2QfnChdg2nO32i7SP4GBpHz 0EctA9TDzXzyx62IlkwB7dtA2ZPvOy31qsCeE84fSwpwj/dFPhsxlCzRFWgMo6PNHH63 t7RJ1y5TlAjY1bf1XrjnCk9Kc/rwWV9NhXl2e4Xcyvhy/qwiUpq8CA5yjci1RVmoCxut sPEjNTIRN7idwJVIjThuIS2IASXxYV7HPFzw28NLrO2NaZ2ssZG6mX3tpUaCjqzggkKr 4Eh6RStohwoNDkzw3bTLbSNpcFeS20LpG7joI2HXhPmBFhnMcdgC7K9Upc+kpg6LwQ7z +uNQ== X-Gm-Message-State: AKaTC003I211CSdEVdtQ3iNpf6VCMvfYlo8jI7XxsetEiAwxmipkzd8C7uuAXbhB55mZeA== X-Received: by 10.99.141.193 with SMTP id z184mr40091511pgd.23.1479786116586; Mon, 21 Nov 2016 19:41:56 -0800 (PST) Received: from Stas-Air-3.local (108-233-206-104.lightspeed.sntcca.sbcglobal.net. [108.233.206.104]) by smtp.gmail.com with ESMTPSA id a1sm22655029pgf.16.2016.11.21.19.41.55 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 21 Nov 2016 19:41:56 -0800 (PST) To: Craig Duncan References: Cc: Internals Message-ID: <8a5d4ed8-9b5c-c262-9980-501d07351b51@gmail.com> Date: Mon, 21 Nov 2016 19:41:54 -0800 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.11; rv:45.0) Gecko/20100101 Thunderbird/45.4.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] Countable Type Hint From: smalyshev@gmail.com (Stanislav Malyshev) Hi! > Nothing prevents it? As far as I'm aware there's no current way to type > hint Countable or array. No, there's not - as there's no way to make other complex type conditions as type. You still can check for it, or just use count(). > How would one add an interface that includes Countable and arrays? You can not add interface that includes multiple types. Neither should you, that's not what interfaces are for. Inventing one-off complex type expressions for one-off cases just makes language more complex and less consistent. It's not a good direction to develop, and it serves very narrow use case which can easily be served by simple code. -- Stas Malyshev smalyshev@gmail.com