[PHP-DEV] [Discussion] Sandbox API

2024-08-05 Thread Nick Lockheart
Sand Box: A first class API that allows unit testing of code with mocks and stubs of other classes or functions, without the need to modify the class under test. This is an initial idea of how a Sand Box API could work: $oSandbox = new SPLSandBox(); $oSandbox->MockFunction('\mocks\fopen','\fop

Re: [PHP-DEV] [RFC] [VOTE] Transform exit() from a languageconstructinto a standard function

2024-08-05 Thread Christoph M. Becker
On 05.08.2024 at 21:37, Gina P. Banyard wrote: > This sounds like a uopz extension issue that is easily fixed. Most likely, yes, although still somebody has to provide a fix, and someone has to do a new release. > I am not sure why we should bend over backwards for extensions that allow to > br

Re: [PHP-DEV] [RFC] Add Directive to Make All Namespaced Function CallsGlobal

2024-08-05 Thread Rowan Tommins [IMSoP]
On 4 August 2024 13:08:22 BST, "Christoph M. Becker" wrote: >On 04.08.2024 at 13:42, Nick Lockheart wrote: > >> To that end, I have created the following RFC: >> >> https://wiki.php.net/rfc/global_function_parser_directive >> I am asking that we discuss and vote on the following question: > >Pl

Re: [PHP-DEV] [RFC] [VOTE] Transform exit() from a languageconstructinto a standard function

2024-08-05 Thread Gina P. Banyard
On Monday, 5 August 2024 at 18:30, Christoph M. Becker wrote: > On 05.08.2024 at 18:52, Tim Düsterhus wrote: > > > On 8/5/24 14:52, Christoph M. Becker wrote: > > > > > Hmm, so far I only had skimmed the RFC and the related discussions, but > > > now I checked out the suggested implementation[

Re: [PHP-DEV] [RFC] Add Directive to Make All Namespaced Function Calls Global

2024-08-05 Thread Rob Landers
On Mon, Aug 5, 2024, at 20:49, Ilija Tovilo wrote: > On Mon, Aug 5, 2024 at 3:33 PM Nick Lockheart wrote: > > > > This is a different problem that could be solved by a sandbox API. > > Not sure which case we were talking about then. ClockMock is what I've > been referencing all along. > > > >

Re: [PHP-DEV] [RFC] [VOTE] Transform exit() from a language construct into a standard function

2024-08-05 Thread Gina P. Banyard
On Monday, 5 August 2024 at 12:04, Derick Rethans wrote: > On Tue, 30 Jul 2024, Christoph M. Becker wrote: > > > On 30.07.2024 at 11:49, Gina P. Banyard wrote: > > > > > I have just opened the vote for the "Transform exit() from a > > > language construct into a standard function" RFC: > > > ht

Re: [PHP-DEV] [RFC] Transform exit() from a language construct into a standard function

2024-08-05 Thread Rob Landers
On Mon, Aug 5, 2024, at 19:03, Tim Düsterhus wrote: > >>> If there is a function call to a function with a 'never' return > >>> type, then that function will potentially throw, or exit. > >>> > >>> But that's not relevant for the analysis, as these userland > >>> functions will have their own opa

Re: [PHP-DEV] [RFC] Add Directive to Make All Namespaced Function Calls Global

2024-08-05 Thread Ilija Tovilo
On Mon, Aug 5, 2024 at 3:33 PM Nick Lockheart wrote: > > This is a different problem that could be solved by a sandbox API. Not sure which case we were talking about then. ClockMock is what I've been referencing all along. > > Well, ok. But then we're back to prefixing global calls, which > > de

Re: [PHP-DEV] [RFC] [VOTE] Transform exit() from a languageconstructinto a standard function

2024-08-05 Thread Christoph M. Becker
On 05.08.2024 at 18:52, Tim Düsterhus wrote: > On 8/5/24 14:52, Christoph M. Becker wrote: > >> Hmm, so far I only had skimmed the RFC and the related discussions, but >> now I checked out the suggested implementation[1].  Then I tried to >> build with PECL/uopz, and of course that failed because

Re: [PHP-DEV] [RFC] [VOTE] Transform exit() from a language construct into a standard function

2024-08-05 Thread Tim Düsterhus
Hi On 8/5/24 18:06, Levi Morrison wrote: After thinking about this several times over the course of discussion and again now that it's in voting, I have decided to vote no. I am in favor of this change, I just think given the concerns it's best to wait for PHP 9.0 to do it. Maybe the concerns wi

Re: [PHP-DEV] Require C11 in PHP 8.4

2024-08-05 Thread Christoph M. Becker
On 05.08.2024 at 17:42, Pierre Joye wrote: > On Mon, Aug 5, 2024, 10:03 PM Derick Rethans wrote: > >> Instead of having to deal with tickets, wouldn't be be easier if the >> compiler they used works with the features that we are using? That could >> instantly provide a link to the documentation s

Re: [PHP-DEV] [RFC] Transform exit() from a language construct into a standard function

2024-08-05 Thread Tim Düsterhus
Hi On 8/2/24 13:39, Derick Rethans wrote: It's for that, but also for path/branch analysis, as I just wrote above. Having an EXIT opcode, instead of a function call is a clean indicator that a path (and branch) ends here. With a function call, I have no idea about whether a path ends there.

Re: [PHP-DEV] [RFC] [VOTE] Transform exit() from a language constructinto a standard function

2024-08-05 Thread Tim Düsterhus
Hi On 8/5/24 14:52, Christoph M. Becker wrote: Hmm, so far I only had skimmed the RFC and the related discussions, but now I checked out the suggested implementation[1]. Then I tried to build with PECL/uopz, and of course that failed because ZEND_EXIT is no longer there. Okay, quickly drop tha

Re: [PHP-DEV] [RFC] [VOTE] Transform exit() from a language construct into a standard function

2024-08-05 Thread Tim Düsterhus
Hi On 8/5/24 13:04, Derick Rethans wrote: As userland PHP developer, I always regarded `exit` as a control flow instruction (quite similar to `break`), and as such I'm not really in favor of converting it to a proper function (especially since it is not, because the parantheses could be omitted)

[PHP-DEV] Drop support for pdo_dblib on Windows?

2024-08-05 Thread Christoph M. Becker
Hi all, a week ago I've opened a respective ticket on the php-src bugtracker[1] to ask what is going on with pdo_dblib on Windows. Apparently the extension is no longer shipped with the official Windows builds for many years (roughly dropped as of PHP 5.3 or 5.4), and I consider it unlikely that

Re: [PHP-DEV] Require C11 in PHP 8.4

2024-08-05 Thread Levi Morrison
On Sun, Aug 4, 2024 at 10:05 AM Gina P. Banyard wrote: > > > On Friday, 2 August 2024 at 14:33, Giovanni Giacobbi > wrote: > > On Thu, 1 Aug 2024 at 23:57, Ilija Tovilo wrote: >> >> [...] >> I started fixing these in a PR [1] which required more changes than >> expected. After a short discourse

Re: [PHP-DEV] Require C11 in PHP 8.4

2024-08-05 Thread Christoph M. Becker
On 05.08.2024 at 16:59, Derick Rethans wrote: > On Mon, 5 Aug 2024, Christoph M. Becker wrote: > >> In my opinion, there is no *need* to enforce this requirement. Just >> having documentation should be sufficient. Users with an old >> compilerr will notice issues (i.e. build failures), and even

Re: [PHP-DEV] [RFC] [VOTE] Transform exit() from a language construct into a standard function

2024-08-05 Thread Levi Morrison
On Tue, Jul 30, 2024 at 3:52 AM Gina P. Banyard wrote: > > Hello Internals, > > I have just opened the vote for the "Transform exit() from a language > construct into a standard function" RFC: > https://wiki.php.net/rfc/exit-as-function > > The vote will last for two weeks until the 13th of Augus

Re: [PHP-DEV] [RFC] [VOTE] Transform exit() from a language construct into a standard function

2024-08-05 Thread Larry Garfield
On Mon, Aug 5, 2024, at 6:04 AM, Derick Rethans wrote: > On Tue, 30 Jul 2024, Christoph M. Becker wrote: > >> On 30.07.2024 at 11:49, Gina P. Banyard wrote: >> >> > I have just opened the vote for the "Transform exit() from a >> > language construct into a standard function" RFC: >> > https://wi

Re: [PHP-DEV] Require C11 in PHP 8.4

2024-08-05 Thread Pierre Joye
On Mon, Aug 5, 2024, 10:03 PM Derick Rethans wrote: > Instead of having to deal with tickets, wouldn't be be easier if the > compiler they used works with the features that we are using? That could > instantly provide a link to the documentation saving all of us time. > it is significantly easi

Re: [PHP-DEV] [RFC] Asymmetric Visibility, v2

2024-08-05 Thread Larry Garfield
On Mon, Aug 5, 2024, at 7:27 AM, Vincent de Lau wrote: > From: Rob Landers > Sent: Sunday, July 21, 2024 11:21 AM > >> On Sat, Jul 20, 2024, at 23:51, Larry Garfield wrote: >> > On Sat, Jul 20, 2024, at 7:22 AM, Rodrigo Vieira wrote: >> > > Will the alternative syntax on hook not even be put to a

Re: [PHP-DEV] [Vote] Asymmetric visibility v2

2024-08-05 Thread Larry Garfield
On Mon, Aug 5, 2024, at 8:49 AM, Theodore Brown wrote: > On Fri, July 26, 2024 at 12:25 Larry Garfield wrote: > >> Voting for Asymmetric Visibility is now open. >> >> https://wiki.php.net/rfc/asymmetric-visibility-v2 > > Hi Larry and Ilija, > > Thank you for all your work on this RFC! > > One part

Re: [PHP-DEV] Require C11 in PHP 8.4

2024-08-05 Thread Derick Rethans
On Mon, 5 Aug 2024, Christoph M. Becker wrote: > On 05.08.2024 at 12:49, Derick Rethans wrote: > > > On Thu, 1 Aug 2024, Ilija Tovilo wrote: > > > >> Hence, it seems like it would be ok to bump our C compiler > >> requirement to C11. We'd like to make this change before beta 1 if > >> there are

Re: [PHP-DEV] [Vote] Asymmetric visibility v2

2024-08-05 Thread Theodore Brown
On Fri, July 26, 2024 at 12:25 Larry Garfield wrote: > Voting for Asymmetric Visibility is now open. > > https://wiki.php.net/rfc/asymmetric-visibility-v2 Hi Larry and Ilija, Thank you for all your work on this RFC! One part that doesn't make sense to me is this sentence near the end in the "R

Re: [PHP-DEV] [RFC] Add Directive to Make All Namespaced Function Calls Global

2024-08-05 Thread Nick Lockheart
> > Consider this example: > > namespace Foo; > echo time(); > > With my proposal, this would now always call the global time() > function. You were suggesting that "using local functions" would help > mitigate this, but I don't think it does. > > * The user can't add "using local functions" t

Re: [PHP-DEV] [Concept] Flip relative function lookup order (global, then local)

2024-08-05 Thread Ilija Tovilo
On Mon, Aug 5, 2024 at 1:23 PM Derick Rethans wrote: > > On Fri, 2 Aug 2024, Ilija Tovilo wrote: > > > As for providing a migration path: One approach might be to introduce > > an INI setting that performs the function lookup in both local and > > global scope at run-time, and informs the user abo

Re: [PHP-DEV] [RFC] Add Directive to Make All Namespaced Function Calls Global

2024-08-05 Thread Ilija Tovilo
On Mon, Aug 5, 2024 at 2:27 PM Nick Lockheart wrote: > > > > I'm not sure your proposal solves the mocking problem. If the engine > > is to interpret all non-fq calls as global or local, how would a > > library include your file while switching this configuration, when it > > is implemented as som

Re: [PHP-DEV] [RFC] [VOTE] Transform exit() from a language constructinto a standard function

2024-08-05 Thread Christoph M. Becker
On 05.08.2024 at 13:04, Derick Rethans wrote: > Xdebug uses exit for exactly that too. For control flow analysis. And I > also always have considered it to be a control flow instruction. > > I see no benefit in changing it to a function, especially because > there will never be a function "exit" f

Re: [PHP-DEV] [RFC] Add Directive to Make All Namespaced Function Calls Global

2024-08-05 Thread Nick Lockheart
> I'm not sure your proposal solves the mocking problem. If the engine > is to interpret all non-fq calls as global or local, how would a > library include your file while switching this configuration, when it > is implemented as some directive in the file? I'm not sure I understand this questio

RE: [PHP-DEV] [RFC] Asymmetric Visibility, v2

2024-08-05 Thread Vincent de Lau
From: Rob Landers Sent: Sunday, July 21, 2024 11:21 AM > On Sat, Jul 20, 2024, at 23:51, Larry Garfield wrote: > > On Sat, Jul 20, 2024, at 7:22 AM, Rodrigo Vieira wrote: > > > Will the alternative syntax on hook not even be put to a vote? > > It was, a year and a half ago when Aviz was first p

Re: [PHP-DEV] [RFC] Add Directive to Make All Namespaced Function Calls Global

2024-08-05 Thread Nick Lockheart
On Mon, 2024-08-05 at 12:27 +0100, Derick Rethans wrote: > On Sun, 4 Aug 2024, Nick Lockheart wrote: > > > https://wiki.php.net/rfc/global_function_parser_directive I am > > asking > > that we discuss and vote on the following question: > > > > “Should there be some way for developers to signal

Re: [PHP-DEV] Require C11 in PHP 8.4

2024-08-05 Thread Christoph M. Becker
On 05.08.2024 at 12:49, Derick Rethans wrote: > On Thu, 1 Aug 2024, Ilija Tovilo wrote: > >> Hence, it seems like it would be ok to bump our C compiler requirement >> to C11. We'd like to make this change before beta 1 if there are no >> objections. > > How would you enforce that, through configur

Re: [PHP-DEV] [RFC] Add Directive to Make All Namespaced Function Calls Global

2024-08-05 Thread Derick Rethans
On Sun, 4 Aug 2024, Nick Lockheart wrote: > https://wiki.php.net/rfc/global_function_parser_directive I am asking > that we discuss and vote on the following question: > > “Should there be some way for developers to signal to the parser at > compile time that all unqualified function names foun

Re: [PHP-DEV] [Concept] Flip relative function lookup order (global, then local)

2024-08-05 Thread Derick Rethans
On Fri, 2 Aug 2024, Ilija Tovilo wrote: > As for providing a migration path: One approach might be to introduce > an INI setting that performs the function lookup in both local and > global scope at run-time, and informs the user about the behavioral > change in the future. That INI setting wo

Re: [PHP-DEV] [RFC] Add Directive to Make All Namespaced Function Calls Global

2024-08-05 Thread Ilija Tovilo
On Mon, Aug 5, 2024 at 10:22 AM Nick Lockheart wrote: > > > Sorry, my language was not precise enough. Your proposal suggests > > making unqualified calls global when the directive is present, > > whereas my proposal suggests keeping local scope as a fallback, hence > > the two not being compatibl

Re: [PHP-DEV] Require C11 in PHP 8.4

2024-08-05 Thread Derick Rethans
On Thu, 1 Aug 2024, Ilija Tovilo wrote: > Hence, it seems like it would be ok to bump our C compiler requirement > to C11. We'd like to make this change before beta 1 if there are no > objections. How would you enforce that, through configure? FWIW, I have just tried compiling Xdebug with -std

Re: [PHP-DEV] [RFC] Add Directive to Make All Namespaced Function Calls Global

2024-08-05 Thread Nick Lockheart
> > > > I did not intend for all unqualified calls to become global, unless > > the new directive is present. > > Sorry, my language was not precise enough. Your proposal suggests > making unqualified calls global when the directive is present, > whereas my proposal suggests keeping local scope