Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:101766 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 49704 invoked from network); 5 Feb 2018 10:17:56 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 5 Feb 2018 10:17:56 -0000 Authentication-Results: pb1.pair.com smtp.mail=ivan.enderlin@hoa-project.net; spf=permerror; sender-id=unknown Authentication-Results: pb1.pair.com header.from=ivan.enderlin@hoa-project.net; sender-id=unknown Received-SPF: error (pb1.pair.com: domain hoa-project.net from 217.70.183.194 cause and error) X-PHP-List-Original-Sender: ivan.enderlin@hoa-project.net X-Host-Fingerprint: 217.70.183.194 relay2-d.mail.gandi.net Received: from [217.70.183.194] ([217.70.183.194:44123] helo=relay2-d.mail.gandi.net) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 45/3A-49805-25F287A5 for ; Mon, 05 Feb 2018 05:17:54 -0500 X-Originating-IP: 178.211.245.124 Received: from hwhost.local (178-211-245-124.dhcp.voenergies.net [178.211.245.124]) (Authenticated sender: ivan.enderlin@hoa-project.net) by relay2-d.mail.gandi.net (Postfix) with ESMTPSA id 6ADADC5A4E; Mon, 5 Feb 2018 11:17:50 +0100 (CET) To: Wes , PHP Internals References: Message-ID: <59e48427-ce88-58fb-f802-48b7412e480d@hoa-project.net> Date: Mon, 5 Feb 2018 11:17:50 +0100 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.13; rv:58.0) Gecko/20100101 Thunderbird/58.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-US Subject: Re: [PHP-DEV] [RFC][DISCUSSION] Deprecation of fallback to root scope From: ivan.enderlin@hoa-project.net (Ivan Enderlin) Hello :-), Thank you for the RFC. I really appreciate it, for sure, but I would like to raise a concern regarding the atoum test framework [1]. atoum provides 3 mock engines, resp. for class-like entitites, functions, and constants. The function and constant mock engines are both based on the same principle, i.e. it relies on the “entity bubble look up resolution” algorithm to mock functions or constants. Typically, one might mock the `file_exists` function like this: `$this->function->file_exists = function (…) { … };`. In this case, atoum creates a new `file_exists` function in the same namespace than the system under test (if testing `A\B\C`, then atoum creates `A\B\file_exists`). It is a very convinient and beloved way to mock functions and constants. And thus, this RFC raises the following issue: *This feature is used a lot by atoum users. The RFC will destroy this feature. It's not about atoum loosing a master feature, it's more about: How users will be able to mock functions and constants after that? This is an important question*. That's a hard question to answer, I know, but in its actual form, the RFC breaks a non-negligeable part of the testing ecosystem. This is something to take into account :-). It is still possible to use moles instead of mocks to achieve the same behavior, but restricted to user-defined functions only. Moles do not allow to change the behavior of “VM-defined” functions. Regards. [1] http://atoum.org/ On 03.02.18 09:27, Wes wrote: > Hello PHPeople. I just published the RFC "Deprecation of fallback to root > scope". > > It is quite a substantial change, but as you can read in the RFC, can be a > (basically) transparent one. > I'm referring to the possibility to shim it in userland. Essentially, this > would move the feature from core to userland. > > I hope you like it. Let me know what you think. > > https://wiki.php.net/rfc/fallback-to-root-scope-deprecation >