Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:100860 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 70405 invoked from network); 11 Oct 2017 05:53:42 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 11 Oct 2017 05:53:42 -0000 Authentication-Results: pb1.pair.com smtp.mail=sebastian@php.net; spf=unknown; sender-id=unknown Authentication-Results: pb1.pair.com header.from=sebastian@php.net; sender-id=unknown Received-SPF: unknown (pb1.pair.com: domain php.net does not designate 188.94.27.5 as permitted sender) X-PHP-List-Original-Sender: sebastian@php.net X-Host-Fingerprint: 188.94.27.5 scarlet.netpirates.net Received: from [188.94.27.5] ([188.94.27.5:52068] helo=scarlet.netpirates.net) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id E5/5C-49033-2E1BDD95 for ; Wed, 11 Oct 2017 01:53:40 -0400 Received: (qmail 22002 invoked by uid 89); 11 Oct 2017 05:53:36 -0000 Received: by simscan 1.4.0 ppid: 21994, pid: 21997, t: 0.0478s scanners: attach: 1.4.0 clamav: 0.99.1/m:/d:20700 Received: from unknown (HELO ?192.168.178.41?) (php@sebastian-bergmann.de@93.226.205.166) by scarlet.netpirates.net with ESMTPA; 11 Oct 2017 05:53:36 -0000 To: internals@lists.php.net References: <9a3f15dd-5dfc-144b-cc5f-66f689c33f53@php.net> Reply-To: internals@lists.php.net Message-ID: <92c2d539-7912-4d2c-fdae-894a7330c382@php.net> Date: Wed, 11 Oct 2017 07:53:40 +0200 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.3.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] Strict type declarations not enforced for Reflection API invocation From: sebastian@php.net (Sebastian Bergmann) Am 10.10.2017 um 18:53 schrieb Nikita Popov: > The problem are not internal function calls, the problem are callbacks. In > fact, the proposed fix does not actually fix the problem you encountered in > PHPUnit, as it is going to use the strictness mode at the reflection > call-site, not the strictness mode used by the file defining the data > provider. I was aware of that (I only saw the pull request but did not look at it), thanks for clarifying. > I believe that the proper way to fix this is to handle dynamic function > invocations differently from direct invocations. Direct invocations should > use the strictness level of the call-site, while dynamic invocations should > use the strictness level of the declaration-site. This means that the > internal array_map and a userland reimplementation will behave consistent. > It also means that PHPUnit will be able to respect the strictness level of > file defining the data provider, etc. I've seen a number of complaints > about our handling of callbacks wrt strict_types, so I think it's > worthwhile to at least consider making such a change. I think this makes sense. Is this something that can be achieved for PHP 7.2 or does it have to wait for PHP 7.3?