Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:85181 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 5151 invoked from network); 18 Mar 2015 11:12:14 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 18 Mar 2015 11:12:14 -0000 Authentication-Results: pb1.pair.com smtp.mail=patrick.allaert@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=patrickallaert@php.net; sender-id=unknown Received-SPF: pass (pb1.pair.com: domain gmail.com designates 74.125.82.46 as permitted sender) X-PHP-List-Original-Sender: patrick.allaert@gmail.com X-Host-Fingerprint: 74.125.82.46 mail-wg0-f46.google.com Received: from [74.125.82.46] ([74.125.82.46:35011] helo=mail-wg0-f46.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id D2/D2-22462-B8D59055 for ; Wed, 18 Mar 2015 06:12:12 -0500 Received: by wgdm6 with SMTP id m6so32122256wgd.2 for ; Wed, 18 Mar 2015 04:12:08 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-type; bh=Y0CeJPt4izbJM9Dq50TMpHTcVXRquksBy4G2eygb8Wk=; b=HIsM/J+bwNv8JvVSoRxml5ovFOXiZ4fdrYPvOp/qdJZQ5CFMr+HU7OY9/nCtE5cLfB /J5aN/kvfYBr8dXGclHbszvmnQg4ejeTmhMAIhfZnixUYYaLFCo+ewX/0Vj8dzVzC5Us EYKxW7gOF7TrQCmUb+npybjPdOSS11Rcv/u/xLPobGK1OiBySYJnsnQrFY58dRrl5GkI vB9DtLPhHHr5ZplUsQ1fJH5MTGZdiKTe+vudmP/uEERmv9kLtWDgzuT5iE+4Vq+s+L10 ju9DOs7q+uwnQFreDaAFE7jdz++0hQ0ihsuEt2Mb8d3ZuRdgaIPOyq/H+8EsLMgX4Xq3 eGag== X-Received: by 10.180.208.107 with SMTP id md11mr6118170wic.10.1426677128650; Wed, 18 Mar 2015 04:12:08 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: Date: Wed, 18 Mar 2015 11:12:07 +0000 Message-ID: To: =?UTF-8?Q?Pavel_Kou=C5=99il?= , Anthony Ferrara Cc: "internals@lists.php.net" Content-Type: multipart/alternative; boundary=001a11c3898e76652905118e276e Subject: Re: [PHP-DEV] [RFC][Accepted] Scalar Type Declarations V0.5 From: patrickallaert@php.net (Patrick ALLAERT) --001a11c3898e76652905118e276e Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Le mer. 18 mars 2015 =C3=A0 10:56, Pavel Kou=C5=99il a= =C3=A9crit : > Hello, > > how will these examples work btw? > > // a.php > declare(strict_types=3D1); > function foo($fn) { > $fn("1"); > }; > > // b.php > require 'a.php'; > foo(function (int $a) { return $a * 2; }); > > > > // c.php > function foo($fn) { > $fn("1"); > }; > > // d.php > declare(strict_types=3D1); > require 'c.php'; > foo(function (int $a) { return $a * 2; }); > > I can't find this in the RFC. I'd intuitively expect error in the > first example and the second one to work OK. > Your intuition is correct. > But at the same time, if there will be an error in the first example, > it is IMHO a huge flaw with this RFC. :/ > Flaw vs. design choice. This is one of the reason that this aspect, amongst others, has been very debated. --001a11c3898e76652905118e276e--