Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:85186 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 16856 invoked from network); 18 Mar 2015 12:21:11 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 18 Mar 2015 12:21:11 -0000 Authentication-Results: pb1.pair.com header.from=tpunt@hotmail.co.uk; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=tpunt@hotmail.co.uk; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain hotmail.co.uk designates 157.55.2.32 as permitted sender) X-PHP-List-Original-Sender: tpunt@hotmail.co.uk X-Host-Fingerprint: 157.55.2.32 dub004-omc3s23.hotmail.com Received: from [157.55.2.32] ([157.55.2.32:51895] helo=DUB004-OMC3S23.hotmail.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 52/15-22462-5BD69055 for ; Wed, 18 Mar 2015 07:21:11 -0500 Received: from DUB113-W65 ([157.55.2.7]) by DUB004-OMC3S23.hotmail.com over TLS secured channel with Microsoft SMTPSVC(7.5.7601.22751); Wed, 18 Mar 2015 05:21:06 -0700 X-TMN: [deCggFlEYYB4VHU1+MJ+dfG4u46K70nxd+lLWiaHhrc=] X-Originating-Email: [tpunt@hotmail.co.uk] Message-ID: To: =?iso-8859-2?B?UGF2ZWwgS291+Gls?= , Anthony Ferrara CC: "internals@lists.php.net" Date: Wed, 18 Mar 2015 12:21:06 +0000 Importance: Normal In-Reply-To: References: , Content-Type: text/plain; charset="iso-8859-2" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginalArrivalTime: 18 Mar 2015 12:21:06.0845 (UTC) FILETIME=[026C94D0:01D06176] Subject: RE: [PHP-DEV] [RFC][Accepted] Scalar Type Declarations V0.5 From: tpunt@hotmail.co.uk (Thomas Punt) Hey Pavel=2C=0A= =0A= > how will these examples work btw?=0A= >=0A= > // a.php=0A= > declare(strict_types=3D1)=3B=0A= > function foo($fn) {=0A= > $fn("1")=3B=0A= > }=3B=0A= >=0A= > // b.php=0A= > require 'a.php'=3B=0A= > foo(function (int $a) { return $a * 2=3B })=3B=0A= =0A= Result: catchable fatal error=0A= Reason: invocation context is in strict mode=0A= =0A= =0A= > // c.php=0A= > function foo($fn) {=0A= > $fn("1")=3B=0A= > }=3B=0A= >=0A= > // d.php=0A= > declare(strict_types=3D1)=3B=0A= > require 'c.php'=3B=0A= > foo(function (int $a) { return $a * 2=3B })=3B=0A= =0A= Result: no error=0A= Reason: invocation context is in weak mode=0A= =0A= > I can't find this in the RFC. I'd intuitively expect error in the=0A= > first example and the second one to work OK.=0A= =0A= Correct :)=0A= =0A= -Tom=0A= =0A= =