Re: [PHP-DEV] [RFC] [Discussion] Rounding Integers as int

2023-10-15 Thread Jakub Zelenka
Hi Marc, On Sat, Oct 14, 2023 at 1:21 AM Marc Bennewitz wrote: > Hi Jakub, > > On 13.10.23 13:25, Jakub Zelenka wrote: > > On Tue, Sep 26, 2023 at 11:39 AM Marc Bennewitz > wrote: > > > >> Hi internals > >> > >> I'd like to put a new RFC under discussion: > >> https://wiki.php.net/rfc/integer-r

[PHP-DEV] Re: DOMXPath / XSLTProcessor function callbacks

2023-10-15 Thread Frederik Bosch
Dear Niels, First of all, thanks for all your hard work already on the DOM and SimpleXML extensions. I have been following your work in PHP-SRC, great! I am the author of this XSL 2.0 Transpiler in PHP package (https://github.com/genkgo/xsl). It is indeed possible to use workarounds for closu

Re: [PHP-DEV] Better name for method Randomizer::nextFloat()

2023-10-15 Thread Tim Düsterhus
Hi On 10/15/23 02:04, tag Knife wrote: I think the major pet peeve i have is that the "Randomizer" class is encapsulating all random functions. I would like to see each randomizer have its own class, since they are under the Random namespace anyway, I believe they should be Random/StringRandomiz

Re: [PHP-DEV] Better name for method Randomizer::nextFloat()

2023-10-15 Thread Tim Düsterhus
Hi On 10/14/23 19:47, David Grudl wrote: random number in the interval 0...1, so it does the same thing as getFloat(0, 1). See https://wiki.php.net/rfc/randomizer_additions#nextfloat For the record: That is correct. B) When trying to think of a more appropriate name (e.g. `getFloat01()` ?),

Re: [PHP-DEV] Two new functions array_first() and array_last()

2023-10-15 Thread Saki Takamachi
Hi Pierre > The first two probably only make sense for a numerically indexed array I do not think so. If these are something like "reset/end without side effects", then they should work fine even not numeric indexed array. Regards. Saki -- PHP Internals - PHP Runtime Development Mailing List T

Re: [PHP-DEV] Two new functions array_first() and array_last()

2023-10-15 Thread Larry Garfield
On Sun, Oct 15, 2023, at 7:40 AM, Pierre wrote: > The first two probably only make sense for a numerically indexed array, > so I guess that array_is_list() (whatever the name is, I don't want to > bikeshed about naming) would be a good addition as well, that, in my > opinion, would be pertinen

Re: [PHP-DEV] Two new functions array_first() and array_last()

2023-10-15 Thread Pierre
Le 15/10/2023 à 01:11, Ben Ramsey a écrit : On Oct 14, 2023, at 16:30, Nikita Popov wrote: On Sat, Oct 14, 2023, at 20:00, David Grudl wrote: PHP lacks two very basic functions for working with arrays: - array_first() returning the first element of an array (or null) - array_last() returning

Re: [PHP-DEV] DOMXPath / XSLTProcessor function callbacks

2023-10-15 Thread Niels Dossche
Hi Marc On 10/15/23 12:53, Marc wrote: > Hi, > > On 14.10.23 13:54, Niels Dossche wrote: >> Hi Tim >> >> On 10/14/23 12:30, Tim Düsterhus wrote: >>> Hi >>> >>> On 10/13/23 00:39, Niels Dossche wrote: Please let me know your thoughts. >>> What does calling ->registerPHPFunctions() do when it'

Re: [PHP-DEV] Two new functions array_first() and array_last()

2023-10-15 Thread Paul Dragoonis
On Sun, 15 Oct 2023, 04:49 Saki Takamachi, wrote: > I came up with the idea of ​​using a signature like array_filter(), and > when a callback is passed, "return the first/last element that matches the > condition" and "return null if there is no match." > > The downside to this idea is the loss o

Re: [PHP-DEV] DOMXPath / XSLTProcessor function callbacks

2023-10-15 Thread Marc
Hi, On 14.10.23 13:54, Niels Dossche wrote: Hi Tim On 10/14/23 12:30, Tim Düsterhus wrote: Hi On 10/13/23 00:39, Niels Dossche wrote: Please let me know your thoughts. What does calling ->registerPHPFunctions() do when it's called more than once? Will the existing allow-list be overwritten