Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:100861 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 81085 invoked from network); 11 Oct 2017 09:03:55 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 11 Oct 2017 09:03:55 -0000 Authentication-Results: pb1.pair.com smtp.mail=mail@pmmaga.net; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=mail@pmmaga.net; sender-id=pass Received-SPF: pass (pb1.pair.com: domain pmmaga.net designates 149.210.149.73 as permitted sender) X-PHP-List-Original-Sender: mail@pmmaga.net X-Host-Fingerprint: 149.210.149.73 outbound2.mail.transip.nl Received: from [149.210.149.73] ([149.210.149.73:45952] helo=outbound2.mail.transip.nl) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 5E/FC-49033-97EDDD95 for ; Wed, 11 Oct 2017 05:03:54 -0400 Received: from submission5.mail.transip.nl (submission5.mail.transip.nl [149.210.149.125]) by outbound2.mail.transip.nl (Postfix) with ESMTP id 3yBp1f0lh5zYdWT for ; Wed, 11 Oct 2017 11:03:50 +0200 (CEST) Received: from mail-io0-f176.google.com (mail-io0-f176.google.com [209.85.223.176]) by submission5.mail.transip.nl (Postfix) with ESMTPA id 3yBp1c0WzNz7t8g for ; Wed, 11 Oct 2017 11:03:43 +0200 (CEST) Received: by mail-io0-f176.google.com with SMTP id f20so1323884ioj.9 for ; Wed, 11 Oct 2017 02:03:42 -0700 (PDT) X-Gm-Message-State: AMCzsaUgP2OzmKLkwnqoYVEZsW/W6s6bgfnxP1fxYkYop8gQllxb4vsD nKsbLAl+8vpn+ZhzAMRHh5JdKWUAdDOlRAGNYcg= X-Google-Smtp-Source: AOwi7QA6FejPTKPgbzwAL4D7PVR+0k4CPeKWzwUcbsO4jb+nVqGPt+weTGQFhGA3EXF7mj+WqKv2XiIaDIRIvT15QXE= X-Received: by 10.107.153.81 with SMTP id b78mr21695181ioe.231.1507712622357; Wed, 11 Oct 2017 02:03:42 -0700 (PDT) MIME-Version: 1.0 Received: by 10.36.108.142 with HTTP; Wed, 11 Oct 2017 02:03:21 -0700 (PDT) In-Reply-To: References: <9a3f15dd-5dfc-144b-cc5f-66f689c33f53@php.net> Date: Wed, 11 Oct 2017 10:03:21 +0100 X-Gmail-Original-Message-ID: Message-ID: To: Nikita Popov Cc: PHP internals Content-Type: multipart/alternative; boundary="001a1140f96c47749d055b41b372" X-Scanned-By: ClueGetter at submission5.mail.transip.nl DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; s=transip-a; d=pmmaga.net; t=1507712629; h=from:reply-to:subject:to: cc:references:in-reply-to:date:mime-version:content-type; bh=JqrzhwGnj7OAo4pOoS6zJPgjcjl95gTK3FAHXlCJIcY=; b=C0MbsLiQWmVYPwuglVajEL3xh3v4RVngFoqIuTyJ0gUTve+74ffBM40E7/BcATYWB5rPmQ GevKyZFMrrKHpNzO3WA1aMbdhg4WwLC5xt4BHQv7nZ2upjLUesuawSMAvU9etXXOLAlvCP P/oifkqHEpdULr0kk1SFEZGcwoat/cwaZpAjPrzPutgJgiBmmvs/E7E1DE5dvr+8MehM+y v0ffy8B5XEbiBt0Jm1JYxUS7nDa/xRgO10Zn0QO/CPjOIN9m6/+ir2MC5QWfAxixgGsH1D I1Ox3OZriiQHJUiGyjLhu9WhqRVuSRWcBE0AD7ng7UXDlIIlCvEhbl8ldHPX3A== X-Report-Abuse-To: abuse@transip.nl Subject: Re: [PHP-DEV] Strict type declarations not enforced for Reflection API invocation From: mail@pmmaga.net (=?UTF-8?Q?Pedro_Magalh=C3=A3es?=) --001a1140f96c47749d055b41b372 Content-Type: text/plain; charset="UTF-8" On Tue, Oct 10, 2017 at 5:53 PM, Nikita Popov wrote: > > 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. > For those that didn't have a look at the PR, my goal was to try to ensure that if we are looking for which strictness to use, we should look at the place of the closest "user" call instead of the function (user or internal) that called the current one. The reason for this problem lies in the fact that `ZEND_ARG_USES_STRICT_TYPES()` will simply look at the caller regardless of what it is. Although this is enough to allow calling functions that were defined as non-strict in a strict manner, it does cause this kind of shortcomings with callbacks. > 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. I agree that this should be about dynamic vs direct instead of user vs internal but IMHO, making the strictness vary from call-site to declaration-site depending on that may be a bit too confusing. Would it be possible/reasonable to try to find the place where the dynamic call was started? (i.e. the dataProvider, the mapped function for a userland array_map, etc...) Regards, Pedro --001a1140f96c47749d055b41b372--