Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:80553 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 873 invoked from network); 15 Jan 2015 15:58:03 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 15 Jan 2015 15:58:03 -0000 Authentication-Results: pb1.pair.com header.from=kontakt@beberlei.de; sender-id=unknown Authentication-Results: pb1.pair.com smtp.mail=kontakt@beberlei.de; spf=permerror; sender-id=unknown Received-SPF: error (pb1.pair.com: domain beberlei.de from 74.125.82.181 cause and error) X-PHP-List-Original-Sender: kontakt@beberlei.de X-Host-Fingerprint: 74.125.82.181 mail-we0-f181.google.com Received: from [74.125.82.181] ([74.125.82.181:48996] helo=mail-we0-f181.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 00/BE-14306-B0DD7B45 for ; Thu, 15 Jan 2015 10:30:19 -0500 Received: by mail-we0-f181.google.com with SMTP id q58so15356007wes.12 for ; Thu, 15 Jan 2015 07:30:16 -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:date :message-id:subject:from:to:cc:content-type; bh=Xe/2jdEpBnos/mdjDFqOH01r7HhdH+knOrh/SGybiFg=; b=doQiOxphy0a1s+5J4F3ciXGJ+lmZD7ZenXfQY/JV7bGjEmCO9zzjskjppVd1LH1SHf PT6HGzYCVMES0HyL/GnzAdoFrInva+AFxHf7OTwo34RQDaQZoVyeYV5YrXa90pjBHwbH Sq8+hMdkii5IsQqY9G9aMICRETahZ6bD5vSnIvgGftP2+WIhdKbZIwV/i6yXmxMZnbe2 SpkEXr/4bznLjBbnWt3wbthFGIvHv+qy7ILVMg3IS/Ksz1eH11UN4K7SlAzxglcQEOen DmJDG27McgACJ88kak3ysu4p6S8JQLpkzqoWuQUjYjK9XmOK58twV37nBCQxLWnKSCyH sCdw== X-Gm-Message-State: ALoCoQmemptLgS48W0iyRhH+dviokrt5AcsLvB/VxhfYMGlZQ6fMDtFgu3RKsFpk/GkWZv/KwPpN MIME-Version: 1.0 X-Received: by 10.180.95.4 with SMTP id dg4mr14760732wib.61.1421335816403; Thu, 15 Jan 2015 07:30:16 -0800 (PST) Received: by 10.194.57.73 with HTTP; Thu, 15 Jan 2015 07:30:16 -0800 (PST) X-Originating-IP: [77.13.198.204] In-Reply-To: References: <8DCD1B72-C81D-499E-B455-E4A042CD76E6@ajf.me> <54B7D8AE.5090209@seld.be> Date: Thu, 15 Jan 2015 16:30:16 +0100 Message-ID: To: =?UTF-8?Q?Pavel_Kou=C5=99il?= Cc: Jordi Boggiano , PHP internals Content-Type: multipart/alternative; boundary=f46d0444028e71910c050cb2884e Subject: Re: [PHP-DEV] [RFC] Scalar Type Hints v0.2 From: kontakt@beberlei.de (Benjamin Eberlei) --f46d0444028e71910c050cb2884e Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On Thu, Jan 15, 2015 at 4:25 PM, Pavel Kou=C5=99il wro= te: > On Thu, Jan 15, 2015 at 4:11 PM, Jordi Boggiano > wrote: > > > > Reading the thread at this point shows so much confusion, it seems half > the > > people reading the spec misunderstood that the declare() line affects > > function calls only and not the API/implementation level. > > > > As much I think it was a smart idea and workaround, it is perhaps too > clever > > for its own good if nobody gets it. > > > > Anyway, as v0.2 appears to be v0.1 + declare(), why not keep those two > > options separated in the vote? > > > > a) should be add weak typing > > b) should we also add declare() for to get strict typing at call-site. > > > > If *a* passes it would be a great stepping stone towards adding *b* lat= er > > perhaps, or tweaking internal coercion rules to improve the behavior of > the > > weak types, having scalars in return hints (since return hints seem > likely > > to pass), etc. > > > > If *b* passes as well great we have a complete picture and every team c= an > > have declare() Y/N in their own coding guidelines based on preference. > > > > Yeah, while the confusion is definitely still there, I would > personally argue that definitely some people who oppose the declare() > get that it's only for calls in the file - and still don't find it > clever. > > The potential issues with this are pretty real, to be honest. Simple > things like moving a method from one class to another (let's say to > parent or descendant) and getting to another typing context may cause > unpredictable behavior if the user forgets to have declare() in both > files. > This alone is a very big argument against it imho. Next argument would be using different libraries in one file and wanting one of them to be strict the other not. I get the idea following something like "use strict;" approaches of Perl/Javascript, however AFAIK they only affect the file itself, not calls from the file to another one. > > > Pavel Kouril > > -- > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: http://www.php.net/unsub.php > > --f46d0444028e71910c050cb2884e--