[PHP-DEV] FFI in PHAR files

2023-09-08 Thread Vinicius Dias
I was playing around with some libraries using FFI and I wanted to share a .phar with the result, but to my surprise, it didn't work. Apparently we are not able to load shared libraries using FFI from within .phar files. Is that the expected behavior or is it a bug in the FFI extension? I have

Re: [PHP-DEV] RFC Proposal: Readonly Structs in PHP

2023-09-08 Thread Matthew Weier O'Phinney
On Fri, Sep 8, 2023, 9:15 AM Lanre Waju wrote: > Allowing Methods in Structs: > Initially, I suggested that readonly structs have no methods besides the > constructor. However, upon further consideration, I believe it may be > beneficial to allow methods in structs. Even PHP enums allow methods,

Re: [PHP-DEV] RFC Proposal: Readonly Structs in PHP

2023-09-08 Thread Lanre Waju
I really like the idea of making structs opaque in that sense, definitely going to put it to vote in the RFC. I agree with the decision to exclude methods from structs, as they are intended to be pure data types and If methods are required, classes can be used instead. I guess based on the

Re: [PHP-DEV] RFC: Increasing the default BCrypt cost

2023-09-08 Thread Alexandru Pătrănescu
On Thu, Sep 7, 2023 at 8:26 PM Tim Düsterhus wrote: > Hi > > in response to the recent "PASSWORD_DEFAULT value" thread [1], I've > created an RFC to discuss an increase of the default BCrypt costs for > `password_hash()` from the current value of 10. > > https://wiki.php.net/rfc/bcrypt_cost_2023

Re: [PHP-DEV] [RFC] [Discussion] Add 4 new rounding modes to round() function

2023-09-08 Thread Alexandru Pătrănescu
On Thu, Sep 7, 2023 at 11:10 PM Jordan LeDoux wrote: > > As someone who maintains a math library in PHP that has its own expanded > rounding implementation, I will politely disagree. Away from zero, towards > zero, towards positive infinity, and towards negative infinity are > completely and

Re: [PHP-DEV] RFC Proposal: Readonly Structs in PHP

2023-09-08 Thread someniatko
Hi internals! I think it can be useful for structured data obtained from decoding JSONs or from a relational database. However, maybe there is an even better idea, which combines the best of two worlds: the world of your structs RFC, and native PHP arrays - something like "array shapes". For

[PHP-DEV] [RFC][Draft] Match block

2023-09-08 Thread Ilija Tovilo
Hello everyone I've been working on match blocks over the last few weeks. https://wiki.php.net/rfc/match_blocks I've already shared it in R11 and got conflicting feedback, which makes me unsure on how to proceed. We have a few options. 1. Add blocks only to match, possibly adding blocks to

Re: [PHP-DEV] RFC Proposal: Readonly Structs in PHP

2023-09-08 Thread tag Knife
On Fri, 8 Sept 2023 at 14:12, Lanre Waju wrote: > Dear PHP Internals, > > I am writing to propose a new feature for PHP that introduces the > concept of structs. This feature aims to provide a more concise and > expressive way to define and work with immutable data structures. Below > is a

Re: [PHP-DEV] FFI in PHAR files

2023-09-08 Thread Bishop Bettini
On Fri, Sep 8, 2023 at 2:33 PM Vinicius Dias wrote: > I was playing around with some libraries using FFI and I wanted to > share a .phar with the result, but to my surprise, it didn't work. > > Apparently we are not able to load shared libraries using FFI from > within .phar files. > Is that the

Re: [PHP-DEV] RFC Proposal: Readonly Structs in PHP

2023-09-08 Thread David Gebler
On Fri, Sep 8, 2023 at 2:12 PM Lanre Waju wrote: > Dear PHP Internals, > > I am writing to propose a new feature for PHP that introduces the > concept of structs. This feature aims to provide a more concise and > expressive way to define and work with immutable data structures. Below > is a

Re: [PHP-DEV] FFI in PHAR files

2023-09-08 Thread Vinicius Dias
Ah, that makes total sense. I was worried I was doing something very wrong. haha Thank you very much for the detailed clarification. This doesn't seem to be a "critical" feature, but I wonder if the documentation shouldn't mention something about only "regular files" being supported. Vinicius

Re: [PHP-DEV] RFC: Increasing the default BCrypt cost

2023-09-08 Thread Hans Henrik Bergan
@Craig warning, it's very random what kind of CPU performance you get on your t2 instances, the CPUs vary greatly from modern to many years old. I know of Fortune 500 companies that have automated systems to spin up t2 instances until they randomly get "a good one", then discard the others,

[PHP-DEV] RFC Proposal: Readonly Structs in PHP

2023-09-08 Thread Lanre Waju
Dear PHP Internals, I am writing to propose a new feature for PHP that introduces the concept of structs. This feature aims to provide a more concise and expressive way to define and work with immutable data structures. Below is a detailed description of the proposed syntax, usage, and

Re: [PHP-DEV] RFC Proposal: Readonly Structs in PHP

2023-09-08 Thread Robert Landers
On Fri, Sep 8, 2023 at 3:12 PM Lanre Waju wrote: > > Dear PHP Internals, > > I am writing to propose a new feature for PHP that introduces the > concept of structs. This feature aims to provide a more concise and > expressive way to define and work with immutable data structures. Below > is a

Re: [PHP-DEV] RFC Proposal: Readonly Structs in PHP

2023-09-08 Thread Lanre Waju
If you want a new data object with slightly different values struct Data2 extends Data { {string $t, array $meta} $title; // Overwrite parent type Status $status; {int $x, int $y} $inlineAnonymous = {x: 1, y: 2}; } Regarding array functions and serialization, there are two

Re: [PHP-DEV] RFC Proposal: Readonly Structs in PHP

2023-09-08 Thread Olle Härstedt
2023-09-08 15:12 GMT+02:00, Lanre Waju : > Dear PHP Internals, > > I am writing to propose a new feature for PHP that introduces the > concept of structs. This feature aims to provide a more concise and > expressive way to define and work with immutable data structures. Below > is a detailed