[PHP-DEV] "Fighting about analogies"

2019-10-11 Thread Mike Schinkel
> On Oct 11, 2019, at 1:44 PM, Larry Garfield wrote: > > Could y'all please go fight about analogies in another thread, rather than > one that was explicitly trying to get away from that silliness? Much obliged. Done! :-) > On Oct 10, 2019, at 1:03 PM, Chase Peeler wrote: > > Mike - I

Re: [PHP-DEV] Warning for "confusable" types

2019-10-11 Thread Larry Garfield
On Fri, Oct 11, 2019, at 1:46 PM, Bishop Bettini wrote: > On Fri, Oct 11, 2019 at 1:47 PM Larry Garfield > wrote: > > > On Fri, Oct 11, 2019, at 8:54 AM, Nikita Popov wrote: > > > Hi internals, > > > > > > Something I've seen play out a couple of times: Newbies try to use > > > something like

Re: [PHP-DEV] Warning for "confusable" types

2019-10-11 Thread Stanislav Malyshev
Hi! > Something I've seen play out a couple of times: Newbies try to use > something like "integer" or "resource" as a type, and then get a confusing > error message along the lines of "must be an instance of resource, resource > given". Maybe we should just change the error message to this?

Re: [PHP-DEV] exit() via exception

2019-10-11 Thread Stanislav Malyshev
Hi! > For me, one of the most annoying things about this is that we can't perform > proper leak checks on code using PhpUnit, because it will always exit() at > the end, which will result in "expected" memory leaks. Is that something that might be fixed in phpunit? I am not familiar with this

Re: [PHP-DEV] Warning for "confusable" types

2019-10-11 Thread Bishop Bettini
On Fri, Oct 11, 2019 at 1:47 PM Larry Garfield wrote: > On Fri, Oct 11, 2019, at 8:54 AM, Nikita Popov wrote: > > Hi internals, > > > > Something I've seen play out a couple of times: Newbies try to use > > something like "integer" or "resource" as a type, and then get a > confusing > > error

Re: [PHP-DEV] exit() via exception

2019-10-11 Thread Olumide Samson
I'm thinking exit() shouldn't be catchable to maintain status quo, and it should be focused on the reason it was suggested(Unwinding stacks and cleaning up memories instead of longjmp'ing to shutdown). If there's any need to catch it's exception, that can be handled later through maybe a RFC

Re: [PHP-DEV] exit() via exception

2019-10-11 Thread Bishop Bettini
On Fri, Oct 11, 2019 at 10:11 AM Nikita Popov wrote: > On Fri, Oct 11, 2019 at 3:47 PM Marcio Almada > wrote: > > > Em sex, 11 de out de 2019 às 08:05, Nikita Popov > > escreveu: > > > > > Currently exit() is implemented using bailout and unclean shutdown, > which > > > means that we're going

Re: [PHP-DEV] Warning for "confusable" types

2019-10-11 Thread Olumide Samson
On Fri, Oct 11, 2019, 6:47 PM Larry Garfield wrote: > On Fri, Oct 11, 2019, at 8:54 AM, Nikita Popov wrote: > > Hi internals, > > > > Something I've seen play out a couple of times: Newbies try to use > > something like "integer" or "resource" as a type, and then get a > confusing > > error

Re: [PHP-DEV] Internals "camps"

2019-10-11 Thread Walter Parker
Sure, sorry about that. I'm done with the silliness as we at an impasse. Walter On Fri, Oct 11, 2019 at 10:45 AM Larry Garfield wrote: > > On Fri, Oct 11, 2019, at 1:53 AM, Stephen Reay wrote: > > > > > > > On 11 Oct 2019, at 13:42, Walter Parker wrote: > > > > > > > > > > > > On Thu, Oct

Re: [PHP-DEV] Warning for "confusable" types

2019-10-11 Thread Larry Garfield
On Fri, Oct 11, 2019, at 8:54 AM, Nikita Popov wrote: > Hi internals, > > Something I've seen play out a couple of times: Newbies try to use > something like "integer" or "resource" as a type, and then get a confusing > error message along the lines of "must be an instance of resource, resource >

Re: [PHP-DEV] Internals "camps"

2019-10-11 Thread Larry Garfield
On Fri, Oct 11, 2019, at 1:53 AM, Stephen Reay wrote: > > > > On 11 Oct 2019, at 13:42, Walter Parker wrote: > > > > > > > > On Thu, Oct 10, 2019 at 11:11 PM Stephen Reay > > wrote: > > > > > > > On 11 Oct 2019, at 12:40, Walter Parker wrote: > > > > > > G > > > > > > On Thu, Oct

Re: [PHP-DEV] exit() via exception

2019-10-11 Thread Aaron Piotrowski
> On Oct 11, 2019, at 10:21 AM, Nikita Popov > wrote: > >> Hi! >> >> So maybe it narrows down to: >> >> Is there an essencial attempt to improve `exit()` handling from the >> userland perspective or should the focus be solely on solving the >> memory management

Re: [PHP-DEV] [VOTE] Reclassifying engine warnings

2019-10-11 Thread Claude Pache
> Le 11 oct. 2019 à 11:12, Olumide Samson a écrit : > > On Fri, Oct 11, 2019, 9:29 AM Benjamin Morel > wrote: > >>> >>> As people have expressed interest in hearing about direct technical >>> benefits that these kinds of changes have ... let me give you an example >>> that came up

Re: [PHP-DEV] exit() via exception

2019-10-11 Thread Bruce Weirdan
On Fri, Oct 11, 2019 at 2:43 PM Andreas Hennings wrote: > What other use cases exist for exit()? Setting exit code for cli scripts. -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP-DEV] exit() via exception

2019-10-11 Thread Nikita Popov
On Fri, Oct 11, 2019 at 5:13 PM Marcio Almada wrote: > Hi! > > > > I don't believe atexit applies to os._exit(). In any case, I agree that > > > this is something we're currently missing -- we should probably add a > > > pcntl_exit() for this purpose. It should be noted though that this is > > >

[PHP-DEV] Re: Migration tooling and the cumulative cost of purely syntactical deprecations

2019-10-11 Thread Mark Randall
On 11/10/2019 11:25, Nikita Popov wrote: Purely syntactical deprecations, such as the recently discussed case of backticks, but also the already accepted deprecations of the "alternative array access syntax" and the (real) cast, can be performed automatically and with perfect reliability. I

Re: [PHP-DEV] exit() via exception

2019-10-11 Thread Marcio Almada
Hi! > > I don't believe atexit applies to os._exit(). In any case, I agree that > > this is something we're currently missing -- we should probably add a > > pcntl_exit() for this purpose. It should be noted though that this is > > really very different from exit(), which is still quite graceful

Re: [PHP-DEV] exit() via exception

2019-10-11 Thread Aaron Piotrowski
> On Oct 11, 2019, at 9:11 AM, Nikita Popov wrote: > > On Fri, Oct 11, 2019 at 3:47 PM Marcio Almada wrote: > >> Em sex, 11 de out de 2019 às 08:05, Nikita Popov >> escreveu: >>> >>> Hi, >>> >> >> Hello :) >> >>> Currently exit() is implemented using bailout and unclean shutdown, which

Re: [PHP-DEV] exit() via exception

2019-10-11 Thread Nikita Popov
On Fri, Oct 11, 2019 at 3:47 PM Marcio Almada wrote: > Em sex, 11 de out de 2019 às 08:05, Nikita Popov > escreveu: > > > > Hi, > > > > Hello :) > > > Currently exit() is implemented using bailout and unclean shutdown, which > > means that we're going to perform a longjmp back to the top-level

Re: [PHP-DEV] exit() via exception

2019-10-11 Thread Marcio Almada
> I have one simple suggestion: Introduce `EngineShutdown -> Throwable`, > bind `exit|die` to it but disallow > `catch(\EngineShutdown $e)` at compile time. This would allow keeping > backwards compatibility to > scenario 2 without messing with our current exception hierarchy. > > > Nikita >

[PHP-DEV] Warning for "confusable" types

2019-10-11 Thread Nikita Popov
Hi internals, Something I've seen play out a couple of times: Newbies try to use something like "integer" or "resource" as a type, and then get a confusing error message along the lines of "must be an instance of resource, resource given". I would like to throw a compiler warning in this case,

Re: [PHP-DEV] exit() via exception

2019-10-11 Thread Marcio Almada
Em sex, 11 de out de 2019 às 08:05, Nikita Popov escreveu: > > Hi, > Hello :) > Currently exit() is implemented using bailout and unclean shutdown, which > means that we're going to perform a longjmp back to the top-level scope and > let the memory manager clean up all the memory it knows

Re: [PHP-DEV] exit() via exception

2019-10-11 Thread Claude Pache
> Le 11 oct. 2019 à 13:05, Nikita Popov a écrit : > > I'm mainly wondering how exactly we'd go about integrating this in the > existing exception hierarchy. Assuming that it is desirable to allow people > to actually catch this exception, my first thought would be along these > lines: > >

Re: [PHP-DEV] exit() via exception

2019-10-11 Thread Sebastian Bergmann
Am 11.10.2019 um 13:05 schrieb Nikita Popov: Depending on the implementation, we could also allow code to actually catch this exception, which may be useful for testing scenarios, as well as long-running daemons. This sounds interesting :) Anyone have thoughts on this matter? I think

Re: [PHP-DEV] Re: exit() via exception

2019-10-11 Thread Andreas Hennings
What about a new keyword in addition to "catch"? (exact keyword would be up for discussion) try { } catchExit ($exit) { } Or, how far would we get if we do not make this catchable, and (perhaps) not run any "finally" block? Could this already solve some of the technical problems, without

[PHP-DEV] Re: exit() via exception

2019-10-11 Thread Mark Randall
On 11/10/2019 12:05, Nikita Popov wrote: This does mean though that existing code using catch(Throwable) is going to catch exit()s as well. This can be avoided by introducing *yet another* super-class/interface above Throwable, which is something I'd rather avoid. If it is caught, could the

Re: [PHP-DEV] Migration tooling and the cumulative cost of purely syntactical deprecations

2019-10-11 Thread Andreas Hennings
On Fri, 11 Oct 2019 at 12:25, Nikita Popov wrote: > > Hi internals, > > One thing that I feel gets lost when discussion is spread over multiple > proposals is the following fact: > > Purely syntactical deprecations, such as the recently discussed case of > backticks, but also the already accepted

Re: [PHP-DEV] exit() via exception

2019-10-11 Thread Andreas Hennings
I would think that whichever code currently calls exit() is already expecting and accepting all the consequences, and assumes that this won't ever be caught. So, would it be an option to keep exit() as it is, and introduce a new syntax construction? Places where I have seen exit() were not

Re: [PHP-DEV] Re: [VOTE] Reclassifying engine warnings

2019-10-11 Thread Andreas Hennings
On Fri, 11 Oct 2019 at 10:18, Nikita Popov wrote: > > On Thu, Sep 12, 2019 at 2:17 PM Nikita Popov wrote: > > > Hi internals, > > > > I've opened the vote on //wiki.php.net/rfc/engine_warnings. > > > > There are 4 votes, all of them independent. The first 3 are for specific > > cases that were

[PHP-DEV] exit() via exception

2019-10-11 Thread Nikita Popov
Hi, Currently exit() is implemented using bailout and unclean shutdown, which means that we're going to perform a longjmp back to the top-level scope and let the memory manager clean up all the memory it knows about. Anything not allocated using ZMM is going to leak persistently. For me, one of

Re: [PHP-DEV] Migration tooling and the cumulative cost of purely syntactical deprecations

2019-10-11 Thread Lester Caine
On 11/10/2019 11:25, Nikita Popov wrote: If we provide this kind of tooling, I think that the cost/benefit calculation on deprecation changes: If we have any syntactic deprecations at all, then it basically doesn't matter how many different (syntactical) things get deprecated in one release, the

Re: [PHP-DEV] Migration tooling and the cumulative cost of purely syntactical deprecations

2019-10-11 Thread Alain D D Williams
On Fri, Oct 11, 2019 at 12:25:11PM +0200, Nikita Popov wrote: > Rather than starting a holy war over every single RFC that contains the > word "deprecation", I think we should take a look at our migration story > and possibly invest some effort into creating a "blessed" tool for this > purpose:

[PHP-DEV] Migration tooling and the cumulative cost of purely syntactical deprecations

2019-10-11 Thread Nikita Popov
Hi internals, One thing that I feel gets lost when discussion is spread over multiple proposals is the following fact: Purely syntactical deprecations, such as the recently discussed case of backticks, but also the already accepted deprecations of the "alternative array access syntax" and the

Re: [PHP-DEV] Re: [VOTE] Reclassifying engine warnings

2019-10-11 Thread Olumide Samson
On Fri, Oct 11, 2019, 9:29 AM Benjamin Morel wrote: > > > > As people have expressed interest in hearing about direct technical > > benefits that these kinds of changes have ... let me give you an example > > that came up yesterday. > > > > Too bad this example comes after the vote has been

Re: [PHP-DEV] Re: [VOTE] Reclassifying engine warnings

2019-10-11 Thread Benjamin Morel
> > As people have expressed interest in hearing about direct technical > benefits that these kinds of changes have ... let me give you an example > that came up yesterday. Too bad this example comes after the vote has been made, and failed. This would be a very strong argument in favour of

[PHP-DEV] Re: [VOTE] Reclassifying engine warnings

2019-10-11 Thread Nikita Popov
On Thu, Sep 12, 2019 at 2:17 PM Nikita Popov wrote: > Hi internals, > > I've opened the vote on //wiki.php.net/rfc/engine_warnings. > > There are 4 votes, all of them independent. The first 3 are for specific > cases that were controversial during the discussion, the last one is for > the

Re: [PHP-DEV] Internals "camps"

2019-10-11 Thread Stephen Reay
> On 11 Oct 2019, at 13:42, Walter Parker wrote: > > > > On Thu, Oct 10, 2019 at 11:11 PM Stephen Reay wrote: > > > > On 11 Oct 2019, at 12:40, Walter Parker wrote: > > > > G > > > > On Thu, Oct 10, 2019 at 10:10 PM Stephen Reay > > wrote: > > > >> > >> > >>> On 11 Oct 2019, at

Re: [PHP-DEV] Internals "camps"

2019-10-11 Thread Walter Parker
On Thu, Oct 10, 2019 at 11:11 PM Stephen Reay wrote: > > > > On 11 Oct 2019, at 12:40, Walter Parker wrote: > > > > G > > > > On Thu, Oct 10, 2019 at 10:10 PM Stephen Reay > > wrote: > > > >> > >> > >>> On 11 Oct 2019, at 02:59, Walter Parker wrote: > >>> > >>> On Thu, Oct 10, 2019 at 10:36