Re: [PHP-DEV] Negative values in PcgOneseq128XslRr64::jump($advance)

2022-07-31 Thread Anton Smirnov
On Sun, 2022-07-31 at 19:52 +0200, Tim Düsterhus wrote: > Hi > > On 7/31/22 17:50, Anton Smirnov wrote: > > I'm writing a polyfill for ext-random and I noticed a small > > weirdness. > > PcgOneseq128XslRr64::jump() accepts negative $advance where it > > automagically becomes unsigned positive. >

Re: [PHP-DEV] Negative values in PcgOneseq128XslRr64::jump($advance)

2022-07-31 Thread Tim Düsterhus
Hi On 7/31/22 17:50, Anton Smirnov wrote: I'm writing a polyfill for ext-random and I noticed a small weirdness. PcgOneseq128XslRr64::jump() accepts negative $advance where it automagically becomes unsigned positive. Yes, this is what happens when casting a negative signed integer to an unsig

[PHP-DEV] Negative values in PcgOneseq128XslRr64::jump($advance)

2022-07-31 Thread Anton Smirnov
Hi! I'm writing a polyfill for ext-random and I noticed a small weirdness. PcgOneseq128XslRr64::jump() accepts negative $advance where it automagically becomes unsigned positive. Does it make sense or maybe it's better to throw a ValueError there? -- Anton -- PHP Internals - PHP Runtime Develop