Re: [PHP-DEV] Discussion: Object-scoped RNG

2021-05-12 Thread Bob Magic
> - Do you think that PHP needs an object-scoped random number > > implementation? And why? if this means each object can maintain its own seed i dont know why php or many other languages dont have this truely. been doing game dev recently and i needed an rng system that does not involve messing

Re: [PHP-DEV] Disable interactive mode (-a) if readline not available

2021-05-12 Thread Rowan Tommins
On 12/05/2021 17:21, Levi Morrison via internals wrote: The interactive shell requires libedit or readline support, which this build does not have. Run php without -a to get an interactive mode instead. Unless I'm missing something, the default CLI mode (php without -a) is "interact

Re: [PHP-DEV] Discussion: Object-scoped RNG

2021-05-12 Thread Rowan Tommins
On 12/05/2021 15:39, Go Kudo wrote: I haven't decided whether to include it in the next RFC, but we think we need to deprecate all functions that use RNGs with global state (shuffle(), array_rand(), str_shuffle()) in the future. I don't understand why that would be necessary or helpful. The ma

Re: [PHP-DEV] [RFC] Partial function application

2021-05-12 Thread Nicolas Grekas
> > > > > This makes me wonder: can we create a partial programmatically? > Wouldn't > > > > that be needed for some use cases? > > > > Partial::createFromCallable($callable, the-args)? > > > > > > > > Nicolas > > > > > > I cannot think of a use case where that would be needed. Since you can > > >

Re: [PHP-DEV] Discussion: Object-scoped RNG

2021-05-12 Thread Alexandru Pătrănescu
On Wed, May 12, 2021 at 6:43 PM Christian Schneider wrote: > Am 11.05.2021 um 23:20 schrieb Larry Garfield : > > 3) Perhaps it should be named RandomSequence or similar? It's not truly > generating random numbers. It's generating a repeatable but difficult to > produce sequence off of a seed va

Re: [PHP-DEV] Disable interactive mode (-a) if readline not available

2021-05-12 Thread Levi Morrison via internals
On Wed, May 12, 2021 at 10:13 AM David Gebler wrote: > > On Wed, 12 May 2021, 09:13 Nikita Popov, wrote: > > > > > I think we would be better off disabling -a completely if readline is not > > available, and exit with a helpful error message. I've opened > > https://github.com/php/php-src/pull/69

Re: [PHP-DEV] [RFC] Partial function application

2021-05-12 Thread Larry Garfield
On Wed, May 12, 2021, at 4:51 AM, Nicolas Grekas wrote: > > > This makes me wonder: can we create a partial programmatically? Wouldn't > > > that be needed for some use cases? > > > Partial::createFromCallable($callable, the-args)? > > > > > > Nicolas > > > > I cannot think of a use case where tha

Re: [PHP-DEV] Disable interactive mode (-a) if readline not available

2021-05-12 Thread David Gebler
On Wed, 12 May 2021, 09:13 Nikita Popov, wrote: > > I think we would be better off disabling -a completely if readline is not > available, and exit with a helpful error message. I've opened > https://github.com/php/php-src/pull/6976 to that effect. Does that sound > reasonable? > > Regards, > Nik

Re: [PHP-DEV] Discussion: Object-scoped RNG

2021-05-12 Thread Christian Schneider
Am 11.05.2021 um 23:20 schrieb Larry Garfield : > 3) Perhaps it should be named RandomSequence or similar? It's not truly > generating random numbers. It's generating a repeatable but difficult to > produce sequence off of a seed value. That's not the same thing as > random_int() et al. > >

Re: [PHP-DEV] Disable interactive mode (-a) if readline not available

2021-05-12 Thread Aaron Piotrowski
> On May 12, 2021, at 3:12 AM, Nikita Popov wrote: > > Hi internals, > > If the readline extension is enabled, PHP provides an interactive shell > under -a. If it is not enabled, it falls back to an "interactive mode" > (yes, the difference between "interactive shell" and "interactive mode" is

Re: [PHP-DEV] Discussion: Object-scoped RNG

2021-05-12 Thread Levi Morrison via internals
On Wed, May 12, 2021 at 8:58 AM Nikita Popov wrote: > > On Wed, May 12, 2021 at 4:51 PM Levi Morrison via internals > wrote: >> >> > Also, I am happy to see that Nikita's rules for namespace assignment to >> > extensions have been approved. I'm going to use the `RNG` namespace. >> >> Just to be

Re: [PHP-DEV] Discussion: Object-scoped RNG

2021-05-12 Thread Nikita Popov
On Wed, May 12, 2021 at 4:51 PM Levi Morrison via internals < internals@lists.php.net> wrote: > > Also, I am happy to see that Nikita's rules for namespace assignment to > extensions have been approved. I'm going to use the `RNG` namespace. > > Just to be clear, you can only use `RNG` as a namespa

Re: [PHP-DEV] Discussion: Object-scoped RNG

2021-05-12 Thread Go Kudo
Sorry about that. I thought I had indicated that I was getting rid of bc-break and carving out functionality for the `ext/rng` extension in the context of reverting to an ORNG-like class-based implementation. 2021年5月12日(水) 23:51 Levi Morrison : > > Also, I am happy to see that Nikita's rules for

Re: [PHP-DEV] Discussion: Object-scoped RNG

2021-05-12 Thread Levi Morrison via internals
> Also, I am happy to see that Nikita's rules for namespace assignment to > extensions have been approved. I'm going to use the `RNG` namespace. Just to be clear, you can only use `RNG` as a namespace if the extension is named `ext/rng`. You cannot add namespaced things to `standard` nor `SPL` no

Re: [PHP-DEV] Discussion: Object-scoped RNG

2021-05-12 Thread Go Kudo
> 1) Get rid of all of the functions. Object-scoped means... you just have an object with methods on it. That's it. Yes. The previous proposal was a complete mess. We will change it to be based on the ORNG extension that we originally planned. https://github.com/zeriyoshi/php-ext-orng > 2) Don't

Re: [PHP-DEV] Discussion: Object-scoped RNG

2021-05-12 Thread Go Kudo
I would like to change the proposal to one based on the original proposal (pecl orng) instead of the confusing RFC proposal. https://github.com/zeriyoshi/php-ext-orng But, I am a bit skeptical about bc-break. It is possible to implement it without destroying the current behavior, but keeping the o

Re: [PHP-DEV] Disable interactive mode (-a) if readline not available

2021-05-12 Thread Bob Weinand
> Am 12.05.2021 um 10:12 schrieb Nikita Popov : > > Hi internals, > > If the readline extension is enabled, PHP provides an interactive shell > under -a. If it is not enabled, it falls back to an "interactive mode" > (yes, the difference between "interactive shell" and "interactive mode" is > imp

[PHP-DEV] Re: Disable interactive mode (-a) if readline not available

2021-05-12 Thread Nikita Popov
On Wed, May 12, 2021 at 3:42 PM Christoph M. Becker wrote: > On 12.05.2021 at 10:12, Nikita Popov wrote: > > > I think we would be better off disabling -a completely if readline is not > > available, and exit with a helpful error message. I've opened > > https://github.com/php/php-src/pull/6976 t

[PHP-DEV] Re: Disable interactive mode (-a) if readline not available

2021-05-12 Thread Christoph M. Becker
On 12.05.2021 at 10:12, Nikita Popov wrote: > I think we would be better off disabling -a completely if readline is not > available, and exit with a helpful error message. I've opened > https://github.com/php/php-src/pull/6976 to that effect. Does that sound > reasonable? I'm in favor of dropping

Re: [PHP-DEV] Disable interactive mode (-a) if readline not available

2021-05-12 Thread Moritz Friedrich
> Am 12.05.2021 um 10:12 schrieb Nikita Popov : > > Hi internals, > > If the readline extension is enabled, PHP provides an interactive shell > under -a. If it is not enabled, it falls back to an "interactive mode" > (yes, the difference between "interactive shell" and "interactive mode" is > i

Re: [PHP-DEV] Trait constants

2021-05-12 Thread Stephen Reay
> On 12 May 2021, at 16:44, Nikita Popov wrote: > > On Wed, May 12, 2021 at 11:38 AM Guilliam Xavier > > wrote: > >> >> >> On Sun, Jun 28, 2020 at 2:34 PM Nikita Popov wrote: >> >>> On Sat, Jun 27, 2020 at 3:53 PM Stephen Reay >>> wrote: >>> Hi, >>

Re: [PHP-DEV] Disable interactive mode (-a) if readline not available

2021-05-12 Thread Nikita Popov
On Wed, May 12, 2021 at 11:44 AM Michelangelo van Dam wrote: > > > > On 12 May 2021, at 11:39, Pierre wrote: > > > > Le 12/05/2021 à 11:29, Joe Watkins a écrit : > >> Morning Nikita, > >> > >> +1 on the change to cli. > >> > >> It can't really be a default extension right now because readline >

Re: [PHP-DEV] [RFC] Partial function application

2021-05-12 Thread Nicolas Grekas
> > > > BTW, ideally, partial functions should not increase the depth of the > > > > stacktrace at all. Do they? > > > > > > > > Nicolas > > > > > > They currently do, since they work by creating a Closure-esque object > > > called Partial with an __invoke() method. However, if you partial the > s

Re: [PHP-DEV] Disable interactive mode (-a) if readline not available

2021-05-12 Thread Joe Watkins
Morning, Still I think heavy use has to be the exception, especially heavy use where readline is not available (because it's questionably useful). Cheers Joe On Wed, 12 May 2021 at 11:39, Pierre wrote: > Le 12/05/2021 à 11:29, Joe Watkins a écrit : > > Morning Nikita, > > > > +1 on the change

Re: [PHP-DEV] Trait constants

2021-05-12 Thread Nikita Popov
On Wed, May 12, 2021 at 11:38 AM Guilliam Xavier wrote: > > > On Sun, Jun 28, 2020 at 2:34 PM Nikita Popov wrote: > >> On Sat, Jun 27, 2020 at 3:53 PM Stephen Reay >> wrote: >> >> > Hi, >> > >> > It’s always struck me as slightly odd that traits don’t support >> constants >> > the way classes a

Re: [PHP-DEV] Disable interactive mode (-a) if readline not available

2021-05-12 Thread Michelangelo van Dam
> On 12 May 2021, at 11:39, Pierre wrote: > > Le 12/05/2021 à 11:29, Joe Watkins a écrit : >> Morning Nikita, >> >> +1 on the change to cli. >> >> It can't really be a default extension right now because readline license >> is not compatible: >> >> https://github.com/php/php-src/pull/3823 >

Re: [PHP-DEV] Disable interactive mode (-a) if readline not available

2021-05-12 Thread Pierre
Le 12/05/2021 à 11:29, Joe Watkins a écrit : Morning Nikita, +1 on the change to cli. It can't really be a default extension right now because readline license is not compatible: https://github.com/php/php-src/pull/3823 Even without the license problem, I'm not convinced of the value of addin

Re: [PHP-DEV] Trait constants

2021-05-12 Thread Guilliam Xavier
On Sun, Jun 28, 2020 at 2:34 PM Nikita Popov wrote: > On Sat, Jun 27, 2020 at 3:53 PM Stephen Reay > wrote: > > > Hi, > > > > It’s always struck me as slightly odd that traits don’t support constants > > the way classes and interfaces do. > > I tried to find an explanation of the lack of support

Re: [PHP-DEV] Disable interactive mode (-a) if readline not available

2021-05-12 Thread Joe Watkins
Morning Nikita, +1 on the change to cli. It can't really be a default extension right now because readline license is not compatible: https://github.com/php/php-src/pull/3823 Even without the license problem, I'm not convinced of the value of adding the dependency: Because of this long standing

[PHP-DEV] Forget debug_print_backtrace() like exception backtraces

2021-05-12 Thread Nikita Popov
Hi internals, For historical reasons, debug_print_backtrace() and exceptions implemented their own logic for formatting backtraces. I don't think there's any particular reason to have different output from both, so I've put up https://github.com/php/php-src/pull/6977 to use the much more widely us

Re: [PHP-DEV] Disable interactive mode (-a) if readline not available

2021-05-12 Thread Nikita Popov
On Wed, May 12, 2021 at 10:37 AM Moritz Friedrich wrote: > > > Am 12.05.2021 um 10:12 schrieb Nikita Popov : > > > > Hi internals, > > > > If the readline extension is enabled, PHP provides an interactive shell > > under -a. If it is not enabled, it falls back to an "interactive mode" > > (yes, t

[PHP-DEV] Disable interactive mode (-a) if readline not available

2021-05-12 Thread Nikita Popov
Hi internals, If the readline extension is enabled, PHP provides an interactive shell under -a. If it is not enabled, it falls back to an "interactive mode" (yes, the difference between "interactive shell" and "interactive mode" is important here). The interactive mode is simply an stdin input, wh