Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:80470 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 8423 invoked from network); 14 Jan 2015 15:45:38 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 14 Jan 2015 15:45:38 -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 74.125.82.176 as permitted sender) X-PHP-List-Original-Sender: rowan.collins@gmail.com X-Host-Fingerprint: 74.125.82.176 mail-we0-f176.google.com Received: from [74.125.82.176] ([74.125.82.176:51947] helo=mail-we0-f176.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 2C/34-19120-22F86B45 for ; Wed, 14 Jan 2015 10:45:38 -0500 Received: by mail-we0-f176.google.com with SMTP id w61so9496188wes.7 for ; Wed, 14 Jan 2015 07:45:35 -0800 (PST) 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:subject:references :in-reply-to:content-type:content-transfer-encoding; bh=ApcxOyGDTVAt26Iylp/il3qZRpfTP0L0XAtnUzd/m1I=; b=Ujflw/o0tYdn95xmshWTLRRmabqlfRrB3YpGjqypY2F55rfq3S3QAgH+fJfeaGE97k gEsO7L5eMIFlofetGXm8/KksrJa/c2HwJcQDGuFKgiKsG7HbAez2paB45w7RX3pCDNaM zBkLIMwT+sMWi54PJIpVFZqqWNV/V0V+qEltCqlSWK2Vc87BjZ+lilnRo61hMsS9vsd6 vfe1kNU9DfxPR4JwR1TKM5S1BJl64c1MXSrGuQATskdu8UZORQWIyLBTrM1HzsqpG1M1 1JEa0UX/WDDMboCTgqTUNlo7EOj/CBoqq+qPImvJBx3/WTQB4Q34TipotIHtG+dldvin ngbA== X-Received: by 10.194.206.70 with SMTP id lm6mr8708684wjc.30.1421250334835; Wed, 14 Jan 2015 07:45:34 -0800 (PST) Received: from [192.168.0.172] ([62.189.198.114]) by mx.google.com with ESMTPSA id h13sm19154004wiw.4.2015.01.14.07.45.33 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 14 Jan 2015 07:45:33 -0800 (PST) Message-ID: <54B68F0A.4090707@gmail.com> Date: Wed, 14 Jan 2015 15:45:14 +0000 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:31.0) Gecko/20100101 Thunderbird/31.3.0 MIME-Version: 1.0 To: internals@lists.php.net References: <8DCD1B72-C81D-499E-B455-E4A042CD76E6@ajf.me> <4E2073DE-0951-498C-97BB-DDAC094F11FA@ajf.me> <54B6402B.1020401@nunninger.info> <77C73BB0-C124-47EC-81AB-ADDE6DAB1C60@ajf.me> <54B66945.2070000@nunninger.info> In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Subject: Re: [PHP-DEV] [RFC] Scalar Type Hints v0.2 From: rowan.collins@gmail.com (Rowan Collins) Andrea Faulds wrote on 14/01/2015 13:15: > Hi Thomas, > >> On 14 Jan 2015, at 13:04, Thomas Nunninger wrote: >> >> Sorry, if my mail was not clear. My point was: If I write a library in strict mode and someone else is using it from his non-strict mode, he can pass an integer to myFunc() without an error. If I use this integer in my library and hand it over to otherFunc() (in my library) this will fail as integer is not accepted for float. >> >> Or did I misunderstood the RFC and there is a casting of the integer to a float when calling myFunc()? > The value would be casted, yes. From the function author’s perspective, there’s no need to worry about strict vs. weak typing: in both cases, you get the type you asked for. > Perhaps it would be clearer if the RFC (and the documentation, if this is accepted) referred to the non-strict as something other than "weak". It makes it sound like only a weak check will be performed, and some values of the "wrong" type will be allowed through, when in reality you will always get exactly the type asked for. Maybe "coercive type-checking" would more accurately reflect the functionality? Regards, -- Rowan Collins [IMSoP]