Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:100857 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 37750 invoked from network); 10 Oct 2017 16:45:16 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 10 Oct 2017 16:45:16 -0000 Authentication-Results: pb1.pair.com header.from=lists@rhsoft.net; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=lists@rhsoft.net; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain rhsoft.net designates 91.118.73.15 as permitted sender) X-PHP-List-Original-Sender: lists@rhsoft.net X-Host-Fingerprint: 91.118.73.15 mail.thelounge.net Received: from [91.118.73.15] ([91.118.73.15:43579] helo=mail.thelounge.net) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 00/3A-49033-A19FCD95 for ; Tue, 10 Oct 2017 12:45:15 -0400 Received: from srv-rhsoft.rhsoft.net (Authenticated sender: h.reindl@thelounge.net) by mail.thelounge.net (THELOUNGE MTA) with ESMTPSA id 3yBNJR03LNzXMQ for ; Tue, 10 Oct 2017 18:45:10 +0200 (CEST) To: PHP Internals References: <9a3f15dd-5dfc-144b-cc5f-66f689c33f53@php.net> Message-ID: Date: Tue, 10 Oct 2017 18:45:10 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.3.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: de-CH Content-Transfer-Encoding: 8bit Subject: Re: [PHP-DEV] Re: Strict type declarations not enforced for Reflection API invocation From: lists@rhsoft.net ("lists@rhsoft.net") Am 10.10.2017 um 18:41 schrieb Niklas Keller: > 2017-10-10 17:10 GMT+02:00 lists@rhsoft.net > >: > > > Am 10.10.2017 um 16:57 schrieb Christoph M. Becker: > > On 10.10.2017 at 15:41, Sebastian Bergmann wrote: > > I consider this a serious bug that leads to unexpected, > confusing problems > such as > https://github.com/sebastianbergmann/phpunit/issues/2796#issuecomment-335180273 > . > > I understand Nikita's point of view (see > https://github.com/php/php-src/pull/2837#issuecomment-335405067 > ) > that > changing this behavior (aka. fixing this bug) can be > considered a > "non-trivial backwards compatibility break". Therefore I > would like to > bring this issue to the attention of this list with this mail. > > > This is most certainly not an *implementation* bug.  The RFC which > introduced strict typing[1] states: > > | By default, all PHP files are in weak type-checking mode. > > > yes but the file in question has strict-types enabled > declare(strict_types=1); > > > Yes, but `array_map` also uses weak types for the callback, like any > other internal function call. > > But `call_user_func` is also special-cased, maybe we should do the same > with the reflection calls. > > All in all, two typing modes were a bad idea to begin with, mostly > because nobody payed attention to callbacks the two typing modes are perfect and when you converted a 15 years old codebase to strcit-ytpes and type-hints everywehere you know why - first you start with typehints and you can't do that strict or you will burn out and give up but when i define strict types in a PHP file everything but code in includes has to be strict typed inherited