Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:75426 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 79551 invoked from network); 13 Jul 2014 16:15:23 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 13 Jul 2014 16:15:23 -0000 Authentication-Results: pb1.pair.com header.from=rowan.collins@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=rowan.collins@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.212.175 as permitted sender) X-PHP-List-Original-Sender: rowan.collins@gmail.com X-Host-Fingerprint: 209.85.212.175 mail-wi0-f175.google.com Received: from [209.85.212.175] ([209.85.212.175:38815] helo=mail-wi0-f175.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 4E/BC-16748-990B2C35 for ; Sun, 13 Jul 2014 12:15:22 -0400 Received: by mail-wi0-f175.google.com with SMTP id ho1so1431509wib.8 for ; Sun, 13 Jul 2014 09:15:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:content-type:content-transfer-encoding; bh=cH3GkZp77Xw4r8NC4KYfsvO5loFMhs3BD23eH1l+kLw=; b=j1dTjwLXjDkz1jqXWNwl0lD+hy0zIJtpG/4Fr/t/DqCm9JZN0MBg9miUbdbtSJTyKP GgGwF27qKB1B4s25acbA8LOqFekAjianpxFRawu8KGSbhtZnilz8BqJQmN2CdFPKHNP9 fYzsGjhzFf7ERSF9oJh59kjyXCB2zgWUcC2PQnemTJcx7QTE3dc9Sz6wO6NWGnyMsXUK 2y7mFTCOu9v37yLZ0xsMZ6vvYMdzRQdX2o0SWttqkp5vnDqIZfhHlUKybA5cHpleVt/j UNKQtMbHaMHoeOxSSuR0k1qNOAtuFScTa8C7mzm0KZ1lpm9r486FBGy5YeTWP3hliYLB r11A== X-Received: by 10.180.24.34 with SMTP id r2mr1418933wif.46.1405268118224; Sun, 13 Jul 2014 09:15:18 -0700 (PDT) Received: from [192.168.0.2] (cpc19-brig17-2-0-cust25.3-3.cable.virginm.net. [81.101.201.26]) by mx.google.com with ESMTPSA id ex4sm20407223wic.2.2014.07.13.09.15.16 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sun, 13 Jul 2014 09:15:17 -0700 (PDT) Message-ID: <53C2B092.6010908@gmail.com> Date: Sun, 13 Jul 2014 17:15:14 +0100 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:24.0) Gecko/20100101 Thunderbird/24.6.0 MIME-Version: 1.0 To: Jocelyn Fournier CC: internals@lists.php.net References: <08503591-EFC8-48E6-984E-FFC292C5EA5F@ajf.me> <027E65EF-C4FC-474C-92BB-D99EFADDEEED@ajf.me> <53C29EE4.3090808@gmail.com> <53C2A2F7.1000806@gmail.com> <53C2A753.2060001@gmail.com> <53C2AAF7.3060504@gmail.com> <53C2AF1D.9070801@gmail.com> In-Reply-To: <53C2AF1D.9070801@gmail.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] [RFC] Scalar Type Hinting With Casts (re-opening) From: rowan.collins@gmail.com (Rowan Collins) On 13/07/2014 17:09, Jocelyn Fournier wrote: > If "type hint" is doing exactly the same than explicit cast, it should > not fail on wants_array('abc'), but give a warning about the implicit > cast conversion. Agreed, but that's a very big "if", and is not what this RFC is proposing at all. Nor could it cleanly use the current syntax, since function foo(array $foo) is already valid, and does not perform such a cast. If you haven't already, please do read Nikita's article which has been linked several times in this thread, which discusses the different options. This proposal is closer to "strict weak type hinting" than "casting weak type hinting"; it differs in *performing* a non-lossy cast, rather than just asserting the *possibility* of one. Regards, -- Rowan Collins [IMSoP]