Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:80533 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 63827 invoked from network); 15 Jan 2015 11:37:00 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 15 Jan 2015 11:37:00 -0000 Authentication-Results: pb1.pair.com header.from=laruence@php.net; sender-id=unknown Authentication-Results: pb1.pair.com smtp.mail=xinchen.h@zend.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain zend.com designates 209.85.217.172 as permitted sender) X-PHP-List-Original-Sender: xinchen.h@zend.com X-Host-Fingerprint: 209.85.217.172 mail-lb0-f172.google.com Received: from [209.85.217.172] ([209.85.217.172:50847] helo=mail-lb0-f172.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 56/38-14306-656A7B45 for ; Thu, 15 Jan 2015 06:36:58 -0500 Received: by mail-lb0-f172.google.com with SMTP id l4so44982lbv.3 for ; Thu, 15 Jan 2015 03:36:51 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc:content-type:content-transfer-encoding; bh=8A44uYKFobrunSrkC7JdDnqRS7UupfhveeyJwWdXNj8=; b=SGLf+5y3FNy74hUAdvs5XpG8j5pYMRXOvtUYggXVr3ksYyD4dtYHXkZCA48X6c0Iue zQ3AhjVtuFkB8+rIVwUtFIw8GlCKr7c75E5djS+cJgipRG6DhZxV5pdISpIkVGNcQrwU WFGKhCVyhPmjAWN17M2P95FURUg4rpbOqUfMz1+YHV7bkdIO06bGvPBiNaXbfJPBPfch hvKLPcKjByidtH4MHG+33jnyaKgrp/ShaXKtPsJIvkc+zcXe7tJCVy3BGTAgKyvd+iMe al9SqMXtvNHGrvtsbYaQFWcokj2LS15AMCi/9eWTECQdA0xNh6iwQ7Pq8jKJkLNht5Tb De7A== X-Gm-Message-State: ALoCoQmfCVFR47YfBzC9LdeszAdwEn2rHqA1MkdZlI3JUfmJUdcAdFGEjlnZb0mhpUMmhbx2IJGfL7D3EB/8XpaFbjli2eKVpR+VCa8nliX5b9aR0nSoF1BzdHzbjLG01+NtCmBzEPtFn4ALhfN0SeG5IzrhUt30nQ== X-Received: by 10.112.156.169 with SMTP id wf9mr9172260lbb.85.1421321811831; Thu, 15 Jan 2015 03:36:51 -0800 (PST) Received: from mail-la0-f52.google.com (mail-la0-f52.google.com. [209.85.215.52]) by mx.google.com with ESMTPSA id jg8sm514197lbc.0.2015.01.15.03.36.50 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 15 Jan 2015 03:36:50 -0800 (PST) Received: by mail-la0-f52.google.com with SMTP id hs14so13079117lab.11 for ; Thu, 15 Jan 2015 03:36:49 -0800 (PST) X-Received: by 10.152.25.129 with SMTP id c1mr9331601lag.65.1421321809524; Thu, 15 Jan 2015 03:36:49 -0800 (PST) MIME-Version: 1.0 Received: by 10.114.64.176 with HTTP; Thu, 15 Jan 2015 03:36:29 -0800 (PST) In-Reply-To: <7B5C883B-E8FE-489A-B1E2-EAD6722544C8@ajf.me> References: <8DCD1B72-C81D-499E-B455-E4A042CD76E6@ajf.me> <7B5C883B-E8FE-489A-B1E2-EAD6722544C8@ajf.me> Date: Thu, 15 Jan 2015 19:36:29 +0800 Message-ID: To: Andrea Faulds Cc: Dmitry Stogov , PHP Internals List Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: Re: [PHP-DEV] [RFC] Scalar Type Hints v0.2 From: laruence@php.net (Xinchen Hui) Hey: On Thu, Jan 15, 2015 at 6:42 AM, Andrea Faulds wrote: > Hey Dmitry, > >> On 14 Jan 2015, at 20:40, Dmitry Stogov wrote: >> >> In my opinion, version 0.1 was consistent enough. >> >> handling two different approaches just makes mess... >> >> We have internal function strlen(string $s), and it may be called with i= nteger argument e.g. strlen(123) -> 3 >> I think user functions should follow the same rules. > > This RFC does that. In the =E2=80=9Cweak=E2=80=9D mode that would continu= e work, and it would also for userland functions with scalar type hints. In= the =E2=80=9Cstrict=E2=80=9D mode that would break, and it would also brea= k for a similar userland function with a scalar type hint. sounds like a hell to me..... sorry for saying that, but I don't like the whole "declare" thing... could we please strict to v0.1, only make it first ? thanks > >> >> If some rules are "bad", lets change that rules for both internal and us= er functions. >> But it's better to do it in a separate RFC (after scalar type hinting 0.= 1 accepted), or we will stick forever. > > I=E2=80=99m not sure the weak typing approach to function parameters is b= ad per se, but a lot of developers would certainly prefer the strict typing= approach. That=E2=80=99s why the RFC allows choice: for all the people tha= t weak typing works for, good, you can keep using that. The people who want= strict typing get strict typing without forcing the people who want weak t= yping to use it. > > Thanks. > -- > Andrea Faulds > http://ajf.me/ > > > > > > -- > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: http://www.php.net/unsub.php > --=20 Xinchen Hui @Laruence http://www.laruence.com/