Re: [PHP-DEV] [RFC] [Discussion] Support object type in BCMath

2024-04-02 Thread Saki Takamachi
PS: Yep, this is pretty much Jordan's library idea. Saki

Re: [PHP-DEV] [RFC] [Discussion] Support object type in BCMath

2024-04-02 Thread Saki Takamachi
Hi Jordan, > The issue is that, presumably, this method will be used within the operator > overload portion of the class entry in C. If it is allowed to be overridden, > then this RFC is sort of providing a stealth operator overload to PHP > developers. As much as I am for operator overloads

Re: [PHP-DEV] [RFC] [Discussion] Support object type in BCMath

2024-04-02 Thread Jordan LeDoux
On Tue, Apr 2, 2024 at 5:05 PM Jordan LeDoux wrote: > > > On Tue, Apr 2, 2024 at 4:50 PM Saki Takamachi wrote: > >> >> The two use cases at issue here are when the div and pow's exponent are >> negative values. So how about allowing only these two methods to optionally >> set `$scale` and

Re: [PHP-DEV] [RFC] [Discussion] Support object type in BCMath

2024-04-02 Thread Jordan LeDoux
On Tue, Apr 2, 2024 at 4:50 PM Saki Takamachi wrote: > > The two use cases at issue here are when the div and pow's exponent are > negative values. So how about allowing only these two methods to optionally > set `$scale` and `$roundMode` ? > > - The constructor takes only `$num` and always uses

Re: [PHP-DEV] [RFC] [Discussion] Support object type in BCMath

2024-04-02 Thread Saki Takamachi
Hi Barney, Jordan, > I think that's a sufficiently different data type that it should be a > different class (if required), and probably a separate RFC, and for now it's > better to stay closer to the existing BCMath API. > > Developers should be prepared to accept that an arbitrary precision

Re: [PHP-DEV] [RFC][Concept] Data classes (a.k.a. structs)

2024-04-02 Thread Ilija Tovilo
Hi Rowan On Tue, Apr 2, 2024 at 10:10 PM Rowan Tommins [IMSoP] wrote: > > On 02/04/2024 01:17, Ilija Tovilo wrote: > > I'd like to introduce an idea I've played around with for a couple of > weeks: Data classes, sometimes called structs in other languages (e.g. > Swift and C#). > > I'm not sure

Re: [PHP-DEV] [RFC][Concept] Data classes (a.k.a. structs)

2024-04-02 Thread Ilija Tovilo
Hi Niels On Tue, Apr 2, 2024 at 8:16 PM Niels Dossche wrote: > > On 02/04/2024 02:17, Ilija Tovilo wrote: > > Hi everyone! > > > > I'd like to introduce an idea I've played around with for a couple of > > weeks: Data classes, sometimes called structs in other languages (e.g. > > Swift and C#). >

Re: [PHP-DEV] Requiring GPG Commit Signing

2024-04-02 Thread Ilija Tovilo
On Tue, Apr 2, 2024 at 9:43 PM Rowan Tommins [IMSoP] wrote: > > Similarly, if you discover a compromised key or signing account, you can look > for uses of that key or account, which might be a tiny number from a non-core > contributor; if you discover a compromised account pushing unsigned

Re: [PHP-DEV] [RFC][Concept] Data classes (a.k.a. structs)

2024-04-02 Thread Larry Garfield
On Tue, Apr 2, 2024, at 6:04 PM, Ilija Tovilo wrote: >> What would be the reason not to? As you indicated in another reply, the >> main reason some languages don't is to avoid large stack copies, but PHP >> doesn't have large stack copies for objects anyway so that's a non-issue. >> >> I've

Re: [PHP-DEV] [RFC][Concept] Data classes (a.k.a. structs)

2024-04-02 Thread Deleu
On Tue, Apr 2, 2024 at 1:47 PM Larry Garfield wrote: > > * Data classes protect from interior mutability. More concretely, > > mutating nested data objects stored in a `readonly` property is not > > legal, whereas it would be if they were ordinary objects. > > * In the future, it should be

Re: [PHP-DEV] First time contributor (DateTime::setDate PR)

2024-04-02 Thread Bilge
On 02/04/2024 14:14, Derick Rethans wrote: Hi, On Sun, 31 Mar 2024, Bilge wrote: About the PR: I sometimes find it would be useful to only update part of the date. The PR makes all parameters to DateTime(Immutable)::setDate

Re: [PHP-DEV] [RFC][Concept] Data classes (a.k.a. structs)

2024-04-02 Thread Rowan Tommins [IMSoP]
On 02/04/2024 01:17, Ilija Tovilo wrote: I'd like to introduce an idea I've played around with for a couple of weeks: Data classes, sometimes called structs in other languages (e.g. Swift and C#). Hi Ilija, I'm really interested to see how this develops. A couple of thoughts that

Re: [PHP-DEV] Requiring GPG Commit Signing

2024-04-02 Thread Jakub Zelenka
On Tue, Apr 2, 2024 at 8:45 PM Rowan Tommins [IMSoP] wrote: > On 02/04/2024 20:02, Ilija Tovilo wrote: > > But, does it matter? I'm not sure we look at some commits closer than > others, based on its author. It's true that it might be easier to > identify malicious commits if they all come from

Re: [PHP-DEV] Requiring GPG Commit Signing

2024-04-02 Thread Rowan Tommins [IMSoP]
On 02/04/2024 20:02, Ilija Tovilo wrote: But, does it matter? I'm not sure we look at some commits closer than others, based on its author. It's true that it might be easier to identify malicious commits if they all come from the same user, but it wouldn't prevent them. It's like the

Re: [PHP-DEV] [RFC][Concept] Data classes (a.k.a. structs)

2024-04-02 Thread Rob Landers
On Tue, Apr 2, 2024, at 20:51, Bruce Weirdan wrote: > On Tue, Apr 2, 2024 at 8:05 PM Ilija Tovilo wrote: > > > Equality for data objects is based on data, rather than the object > > handle. > > I believe equality should always consider the type of the object. > > ```php > new

Re: [PHP-DEV] Requiring GPG Commit Signing

2024-04-02 Thread Ilija Tovilo
Hi Rowan On Tue, Apr 2, 2024 at 8:48 PM Rowan Tommins [IMSoP] wrote: > > In fact, you don't need to compromise anybody's key: you could socially > engineer a situation where you have push access to the repository, or break > the security in some other way. As I understand it, this is exactly

Re: [PHP-DEV] [RFC][Concept] Data classes (a.k.a. structs)

2024-04-02 Thread Bruce Weirdan
On Tue, Apr 2, 2024 at 8:05 PM Ilija Tovilo wrote: > Equality for data objects is based on data, rather than the object > handle. I believe equality should always consider the type of the object. ```php new Problem(size:'big') === new Universe(size:'big') && new Problem(size:'big') === new

Re: [PHP-DEV] Requiring GPG Commit Signing

2024-04-02 Thread Rowan Tommins [IMSoP]
On 02/04/2024 18:27, Ilija Tovilo wrote: If your GitHub account is compromised, [...] the attacker may simply register their own gpg key in your account, with the commits appearing as verified. If your ssh key is compromised instead, and you use ssh to sign your commits, the attacker may sign

Re: [PHP-DEV] Consider removing autogenerated files from tarballs

2024-04-02 Thread Jakub Zelenka
Hi, On Tue, Apr 2, 2024 at 7:14 PM Stanislav Malyshev wrote: > Hi! > > That is something PHP is missing atm, no one can verify the build process >> for releases. >> > > Yes that's what I was suggesting. This should be done by RM. In that way, > the RM becomes more someone that verifies the

Re: [PHP-DEV] [RFC][Concept] Data classes (a.k.a. structs)

2024-04-02 Thread Niels Dossche
On 02/04/2024 02:17, Ilija Tovilo wrote: > Hi everyone! > > I'd like to introduce an idea I've played around with for a couple of > weeks: Data classes, sometimes called structs in other languages (e.g. > Swift and C#). > > In a nutshell, data classes are classes with value semantics. >

Re: [PHP-DEV] Consider removing autogenerated files from tarballs

2024-04-02 Thread Stanislav Malyshev
Hi! That is something PHP is missing atm, no one can verify the build process for releases. Yes that's what I was suggesting. This should be done by RM. In that way, the RM becomes more someone that verifies the build and not the actual person that provides the build. I'm not

Re: [PHP-DEV] [RFC][Concept] Data classes (a.k.a. structs)

2024-04-02 Thread Ilija Tovilo
Hi Larry On Tue, Apr 2, 2024 at 5:31 PM Larry Garfield wrote: > > On Tue, Apr 2, 2024, at 12:17 AM, Ilija Tovilo wrote: > > Hi everyone! > > > > I'd like to introduce an idea I've played around with for a couple of > > weeks: Data classes, sometimes called structs in other languages (e.g. > >

Re: [PHP-DEV] Requiring GPG Commit Signing

2024-04-02 Thread Larry Garfield
On Tue, Apr 2, 2024, at 5:27 PM, Ilija Tovilo wrote: > Hi Derick > > On Tue, Apr 2, 2024 at 4:15 PM Derick Rethans wrote: >> >> What do y'all think about requiring GPG signed commits for the php-src >> repository? > > Let me repost my internal response for visibility. > > I'm currently struggling

Re: [PHP-DEV] [RFC] [Discussion] Support object type in BCMath

2024-04-02 Thread Jordan LeDoux
On Tue, Apr 2, 2024 at 10:24 AM Jordan LeDoux wrote: > > > On Tue, Apr 2, 2024 at 3:12 AM Lynn wrote: > >> >> I'm inexperienced when it comes to maths and the precision here, but I do >> have some experience when it comes to what the business I work for wants. >> I've implemented BCMath in a

Re: [PHP-DEV] Requiring GPG Commit Signing

2024-04-02 Thread Ilija Tovilo
Hi Derick On Tue, Apr 2, 2024 at 4:15 PM Derick Rethans wrote: > > What do y'all think about requiring GPG signed commits for the php-src > repository? Let me repost my internal response for visibility. I'm currently struggling to understand what kind of attack signing commits prevents. If

Re: [PHP-DEV] [RFC] [Discussion] Support object type in BCMath

2024-04-02 Thread Jordan LeDoux
On Tue, Apr 2, 2024 at 3:12 AM Lynn wrote: > > I'm inexperienced when it comes to maths and the precision here, but I do > have some experience when it comes to what the business I work for wants. > I've implemented BCMath in a couple of places where this kind of precision > is necessary, and I

Re: [PHP-DEV] Requiring GPG Commit Signing

2024-04-02 Thread Jakub Zelenka
On Tue, Apr 2, 2024 at 5:05 PM John Coggeshall wrote: > > So if we want to make sure that something like XY doesn't happen, we > have to add some additional restrictions to those GPG keys. > > > Looks like all those geeky colleagues of ours back in the day having > key-signing parties at

Re: [PHP-DEV] [RFC][Concept] Data classes (a.k.a. structs)

2024-04-02 Thread Robert Landers
On Tue, Apr 2, 2024 at 2:20 AM Ilija Tovilo wrote: > > Hi everyone! > > I'd like to introduce an idea I've played around with for a couple of > weeks: Data classes, sometimes called structs in other languages (e.g. > Swift and C#). > > In a nutshell, data classes are classes with value semantics.

Re: [PHP-DEV] Requiring GPG Commit Signing

2024-04-02 Thread John Coggeshall
> So if we want to make sure that something like XY doesn't happen, we > have to add some additional restrictions to those GPG keys. > Looks like all those geeky colleagues of ours back in the day having key-signing parties at conferences were on to something, maybe.. Let's be clear about

Re: [PHP-DEV] Requiring GPG Commit Signing

2024-04-02 Thread Bilge
On 02/04/2024 15:55, Calvin Buckley wrote: On Apr 2, 2024, at 11:15 AM, Derick Rethans wrote: What do y'all think about requiring GPG signed commits for the php-src repository? I had a look, and this is also something we can enforce through GitHub as well (by using branch protections). Would

Re: [PHP-DEV] Requiring GPG Commit Signing

2024-04-02 Thread Andreas Heigl
Hey List, Hey Derick Am 02.04.24 um 16:15 schrieb Derick Rethans: Hi, What do y'all think about requiring GPG signed commits for the php-src repository? In general I think it is a good idea to do GPG signed commits. But in terms of security the idea is to be able to authenticate a user. But

Re: [PHP-DEV] Requiring GPG Commit Signing

2024-04-02 Thread Niels Dossche
On 02/04/2024 16:15, Derick Rethans wrote: > Hi, > > What do y'all think about requiring GPG signed commits for the php-src > repository? > > I had a look, and this is also something we can enforce through GitHub > as well (by using branch protections). > > cheers, > Derick > > I'm in

Re: [PHP-DEV] [RFC][Concept] Data classes (a.k.a. structs)

2024-04-02 Thread Larry Garfield
On Tue, Apr 2, 2024, at 12:17 AM, Ilija Tovilo wrote: > Hi everyone! > > I'd like to introduce an idea I've played around with for a couple of > weeks: Data classes, sometimes called structs in other languages (e.g. > Swift and C#). *gets popcorn* > In a nutshell, data classes are classes with

Re: [PHP-DEV] Requiring GPG Commit Signing

2024-04-02 Thread Arnaud Le Blanc
On Tue, Apr 2, 2024 at 4:16 PM Derick Rethans wrote: > What do y'all think about requiring GPG signed commits for the php-src > repository? > +1

Re: [PHP-DEV] Requiring GPG Commit Signing

2024-04-02 Thread Derick Rethans
On Tue, 2 Apr 2024, Calvin Buckley wrote: > On Apr 2, 2024, at 11:15 AM, Derick Rethans wrote: > > > > What do y'all think about requiring GPG signed commits for the php-src > > repository? > > > > I had a look, and this is also something we can enforce through GitHub > > as well (by using

Re: [PHP-DEV] Requiring GPG Commit Signing

2024-04-02 Thread Calvin Buckley
On Apr 2, 2024, at 11:15 AM, Derick Rethans wrote: > > What do y'all think about requiring GPG signed commits for the php-src > repository? > > I had a look, and this is also something we can enforce through GitHub > as well (by using branch protections). Would this affect only direct pushes

Re: [PHP-DEV] Requiring GPG Commit Signing

2024-04-02 Thread Rowan Tommins [IMSoP]
On Tue, 2 Apr 2024, at 15:15, Derick Rethans wrote: > Hi, > > What do y'all think about requiring GPG signed commits for the php-src > repository? I actually thought this was already required since the github move (and the events that led to it) 3 years ago. It was certainly discussed:

Re: [PHP-DEV] Consider removing autogenerated files from tarballs

2024-04-02 Thread Olle Härstedt
internals+unsubscr...@lists.php.net - 550 5.7.1 Looks like spam to me. Can't unsub...? Den tis 2 apr. 2024 kl 16:46 skrev Jakub Zelenka : > On Tue, Apr 2, 2024 at 3:35 PM tag Knife wrote: > >> >> On Tue, 2 Apr 2024 at 14:53, Jakub Zelenka wrote: >> >>> We will still need RM to sign the build

Re: [PHP-DEV] Requiring GPG Commit Signing

2024-04-02 Thread Ayesh Karunaratne
> > Hi, > > What do y'all think about requiring GPG signed commits for the php-src > repository? > > I had a look, and this is also something we can enforce through GitHub > as well (by using branch protections). > > cheers, > Derick > > > -- > https://derickrethans.nl | https://xdebug.org |

Re: [PHP-DEV] Requiring GPG Commit Signing

2024-04-02 Thread David CARLIER
No problem with this, I apply this since couple of days. Cheers. On Tue, 2 Apr 2024 at 15:37, Jakub Zelenka wrote: > On Tue, Apr 2, 2024 at 3:36 PM Jakub Zelenka wrote: > >> On Tue, Apr 2, 2024 at 3:17 PM Derick Rethans wrote: >> >>> Hi, >>> >>> What do y'all think about requiring GPG signed

Re: [PHP-DEV] Consider removing autogenerated files from tarballs

2024-04-02 Thread Jakub Zelenka
On Tue, Apr 2, 2024 at 3:35 PM tag Knife wrote: > > On Tue, 2 Apr 2024 at 14:53, Jakub Zelenka wrote: > >> We will still need RM to sign the build so ideally we should make it >> reproducible so RM can verify that CI produced expected build and then sign >> it and just upload the signatures

Re: [PHP-DEV] Requiring GPG Commit Signing

2024-04-02 Thread Jakub Zelenka
On Tue, Apr 2, 2024 at 3:36 PM Jakub Zelenka wrote: > On Tue, Apr 2, 2024 at 3:17 PM Derick Rethans wrote: > >> Hi, >> >> What do y'all think about requiring GPG signed commits for the php-src >> repository? >> >> > +1, most of the devs already do that. I CC'd few of the regular devs that >

Re: [PHP-DEV] Requiring GPG Commit Signing

2024-04-02 Thread Jakub Zelenka
On Tue, Apr 2, 2024 at 3:17 PM Derick Rethans wrote: > Hi, > > What do y'all think about requiring GPG signed commits for the php-src > repository? > > +1, most of the devs already do that. I CC'd few of the regular devs that don't sign commits (taken from the latest history) so they are aware

Re: [PHP-DEV] Consider removing autogenerated files from tarballs

2024-04-02 Thread tag Knife
On Tue, 2 Apr 2024 at 14:53, Jakub Zelenka wrote: > We will still need RM to sign the build so ideally we should make it > reproducible so RM can verify that CI produced expected build and then sign > it and just upload the signatures (not sure if we actually need signature > uploaded or if they

Re: [PHP-DEV] Requiring GPG Commit Signing

2024-04-02 Thread Sebastian Bergmann
Am 02.04.2024 um 16:15 schrieb Derick Rethans: What do y'all think about requiring GPG signed commits for the php-src repository? +1

[PHP-DEV] [VOTE] PHP 8.4 Release Managers

2024-04-02 Thread Jakub Zelenka
Hi all, In the role of "Veteran" release manager, Eric Mann [0], the PHP 8.3 release manager, has volunteered to mentor two rookies, so there will be two seats up for grabs. For those two rookie seats, we’ve got three eager candidates for your consideration [1-4]. Voting is now open on

[PHP-DEV] Requiring GPG Commit Signing

2024-04-02 Thread Derick Rethans
Hi, What do y'all think about requiring GPG signed commits for the php-src repository? I had a look, and this is also something we can enforce through GitHub as well (by using branch protections). cheers, Derick -- https://derickrethans.nl | https://xdebug.org | https://dram.io Author of

Re: [PHP-DEV] Consider removing autogenerated files from tarballs

2024-04-02 Thread Jakub Zelenka
Hi, On Tue, Apr 2, 2024 at 2:36 PM Derick Rethans wrote: > On Sat, 30 Mar 2024, Jakub Zelenka wrote: > > > On Sat, Mar 30, 2024 at 7:08 AM Marco Pivetta > wrote: > > > > > > I understand that the XZ project had signed releases too: that still > > > means that downstream consumers would need to

Re: [PHP-DEV] [RFC] [Discussion] Support object type in BCMath

2024-04-02 Thread Barney Laurance
On 2024-04-02 12:26, Saki Takamachi wrote: Also, an idea occurred to me while reading your comments. The current assumption is that a Number always holds a single value. How if we made it so that it held two values? They are the numerator and the denominator. Then we'd have a rational

Re: [PHP-DEV] Consider removing autogenerated files from tarballs

2024-04-02 Thread Derick Rethans
On Sat, 30 Mar 2024, Jakub Zelenka wrote: > On Sat, Mar 30, 2024 at 7:08 AM Marco Pivetta wrote: > > > > I understand that the XZ project had signed releases too: that still > > means that downstream consumers would need to trust the release > > managers anyway, and reproduce the whole chain

Re: [PHP-DEV] [RFC] [Discussion] Support object type in BCMath

2024-04-02 Thread Derick Rethans
On Fri, 29 Mar 2024, Jordan LeDoux wrote: > On Wed, Mar 27, 2024 at 12:08 AM Aleksander Machniak wrote: > > > On 27.03.2024 01:03, Saki Takamachi wrote: > > >> $num = new BcNum('1.23', 2); > > >> $result = $num + '1.23456'; > > >> $result->value; // '2.46456' > > >> $result->scale; // ?? > > >

Re: [PHP-DEV] First time contributor (DateTime::setDate PR)

2024-04-02 Thread Derick Rethans
Hi, On Sun, 31 Mar 2024, Bilge wrote: > About the PR: I sometimes find it would be useful to only update part of the > date. The PR makes all parameters to DateTime(Immutable)::setDate > optional in a > backwards-compatible manner

[PHP-DEV] unsubscribe

2024-04-02 Thread Joao Pedro Paula Pannain Souza

Re: [PHP-DEV] [RFC] [Discussion] Support object type in BCMath

2024-04-02 Thread Saki Takamachi
Hi Jordan, Lynn, > Something like the signature for `getNumber()` in this example would be a > decent solution. Operations which have ambiguous scale (of which truly only > div is in the BCMath library) should *require* scale in the method that calls > the calculation, however for consistency

Re: [PHP-DEV] [RFC] [Discussion] Support object type in BCMath

2024-04-02 Thread Lynn
On Tue, Apr 2, 2024 at 11:17 AM Jordan LeDoux wrote: > > > On Sat, Mar 30, 2024 at 5:09 PM Saki Takamachi wrote: > >> Hi Jordan, >> >> Your opinion may be reasonable given the original BCMath calculation >> order. That is, do you intend code like this? >> >> Signature: >> ``` >> // public

Re: [PHP-DEV] [RFC][Concept] Data classes (a.k.a. structs)

2024-04-02 Thread Ilija Tovilo
Hi Alexander On Tue, Apr 2, 2024 at 4:53 AM Alexander Pravdin wrote: > > On Tue, Apr 2, 2024 at 9:18 AM Ilija Tovilo wrote: > > > > I'd like to introduce an idea I've played around with for a couple of > > weeks: Data classes, sometimes called structs in other languages (e.g. > > Swift and C#).

Re: [PHP-DEV] [RFC] [Discussion] Support object type in BCMath

2024-04-02 Thread Jordan LeDoux
On Sat, Mar 30, 2024 at 5:09 PM Saki Takamachi wrote: > Hi Jordan, > > Your opinion may be reasonable given the original BCMath calculation > order. That is, do you intend code like this? > > Signature: > ``` > // public function __construct(string|int $number) > // public function

Re: [PHP-DEV] [RFC][Concept] Data classes (a.k.a. structs)

2024-04-02 Thread Ilija Tovilo
Hi Marco On Tue, Apr 2, 2024 at 2:56 AM Deleu wrote: > > > > On Mon, Apr 1, 2024 at 9:20 PM Ilija Tovilo wrote: >> >> I'd like to introduce an idea I've played around with for a couple of >> weeks: Data classes, sometimes called structs in other languages (e.g. >> Swift and C#). >> >> snip >>

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

2024-04-02 Thread Marc Bennewitz
Hi internals, On 17.03.24 13:23, Marc Bennewitz wrote: Hello internals, I have opened the vote for the "Rounding Integers as int" RFC: https://wiki.php.net/rfc/integer-rounding Do to Easter weekend the vote will run for two weeks and two days until Tue the 2nd of April 2024. The RFC has