[PHP-DEV] Re: [RFC] [Vote] Resource to object conversion

2024-01-19 Thread Máté Kocsis
Hi Everyone, I've just closed the votes with the following outcomes: - The primary vote for the described approach for converting resources to objects was accepted unanimously (30 yes, 0 no) - Primary stream resources are going to be migrated in a major version, rather in any minor or major

Re: [PHP-DEV] `PDO::FETCH_CONSTRUCTOR` fetch mode proposal

2024-01-19 Thread Lynn
On Fri, Jan 19, 2024 at 1:51 AM Alexander Pravdin wrote: > I would also suggest supporting readonly classes and creating special > attributes to help map data fields to constructor arguments. Something like > this: > > readonly class User { > public function __construct( >

Re: [PHP-DEV] Dedicated StreamBucket class

2024-01-19 Thread Jakub Zelenka
Hi, On Wed, Jan 17, 2024 at 9:14 PM Máté Kocsis wrote: > I just submitted feedback to the PR but will also mention it here as it's >> probably more an API thing. The problem that I see is that it combines two >> distinct things and create quite ugly self reference inside the proposed >>

Re: [PHP-DEV] Dedicated StreamBucket class

2024-01-19 Thread Máté Kocsis
Hi Jakub, > The only issue that I see that if you migrate the resource to object you > effectively drop that property which might be a BC break but based on the > recent RFC results it will happen in PHP 9.0 so it's not such a big issue. > I think this might be actually an opportunity to

Re: [PHP-DEV] [RFC] Add dedicated StreamBucket object

2024-01-19 Thread Kamil Tekiela
What should users replace $bucket property with in PHP 8.4? Is there an alternative or is this a deprecation without a way to solve it? If there is currently no alternative I would not deprecate it. Just remove it once it becomes useless. -- PHP Internals - PHP Runtime Development Mailing List

Re: [PHP-DEV] `PDO::FETCH_CONSTRUCTOR` fetch mode proposal

2024-01-19 Thread php
Hi Alexander, I would also suggest supporting readonly classes and creating special attributes to help map data fields to constructor arguments. Something like this: readonly class User { public function __construct( #[PDOField('user_id')] public string $userId,

[PHP-DEV] [RFC] Add dedicated StreamBucket object

2024-01-19 Thread Máté Kocsis
Hi Internals, As I have already shared my intentions in https://externals.io/message/122149, I'd like to add a dedicated object for stream buckets as opposed to the stdClass instances which are used nowadays. Please read https://wiki.php.net/rfc/dedicated_stream_bucket Regards, Máté

Re: [PHP-DEV] `PDO::FETCH_CONSTRUCTOR` fetch mode proposal

2024-01-19 Thread php
Hi Saki, Welcome to the internal mailing list! I had looked the pull request, and I'm pleased to have received your email promptly. Thank you! Now, I agree that it is often not possible to use `PDO::FETCH_CLASS` because DB column names are typically snake case and variables and properties

Re: [PHP-DEV] [RFC] [Discussion] Opt-in DOM spec-compliance

2024-01-19 Thread Gina P. Banyard
On Thursday, 18 January 2024 at 20:08, Niels Dossche wrote: > Hi Gina > > On 18/01/2024 14:05, Gina P. Banyard wrote: > > > Hello Niels, > > > > Thank you for the RFC and the thorough overview of the current state. > > > > I think converting the new aliases to proper classes which have the

Re: [PHP-DEV] Dedicated StreamBucket class

2024-01-19 Thread Sara Golemon
On Sat, Jan 13, 2024 at 1:29 AM Máté Kocsis wrote: > Recently, I realized that the stream_bucket_new() and > stream_bucket_make_writeable() functions > create stdClass instances by dynamically adding a "bucket", a "data" and a > "datalen" property to it. > I don't want to stand in the way of

Re: [PHP-DEV] `PDO::FETCH_CONSTRUCTOR` fetch mode proposal

2024-01-19 Thread Larry Garfield
On Fri, Jan 19, 2024, at 9:47 AM, Lynn wrote: > On Fri, Jan 19, 2024 at 1:51 AM Alexander Pravdin > wrote: > >> I would also suggest supporting readonly classes and creating special >> attributes to help map data fields to constructor arguments. Something like >> this: >> >> readonly class User {

Re: [PHP-DEV] BLAKE3 hash

2024-01-19 Thread tag Knife
On Fri, 19 Jan 2024 at 18:43, Hans Henrik Bergan wrote: > Can we add the BLAKE3 hash? > > Created a PR here: https://github.com/php/php-src/pull/13194 > > BLAKE3 is a very fast ("blazing fast") cryptographically secure hash. It is > the latest iteration of the BLAKE hash, which was a SHA3

[PHP-DEV] BLAKE3 hash

2024-01-19 Thread Hans Henrik Bergan
Can we add the BLAKE3 hash? Created a PR here: https://github.com/php/php-src/pull/13194 BLAKE3 is a very fast ("blazing fast") cryptographically secure hash. It is the latest iteration of the BLAKE hash, which was a SHA3 finalist~ see https://github.com/BLAKE3-team/BLAKE3 for more info on

Re: [PHP-DEV] Dedicated StreamBucket class

2024-01-19 Thread James Titcumb
On Fri, 19 Jan 2024 at 16:04, Sara Golemon wrote: > > No disrespect to all the folks (including myself) who had a part in file > I/O as it exists today, but it *IS* a hot mess. I've sketched out > redesigns with folks over the years, but I have to be honest that I don't > have the spoons to

[PHP-DEV] Wiki Access request

2024-01-19 Thread Barel
Hi My name is Carlos Granados and I have been a PHP developer for a long time, more than 15 years and I am quite interested in the PHP internals and trying to learn as much as I can about them This page in the Wiki https://wiki.php.net/internals/references has a lot of links which are outdated

Re: [PHP-DEV] BLAKE3 hash

2024-01-19 Thread Hans Henrik Bergan
Having looked into it, it seems difficult after all, I would want a new $options argument for hash_final(), and some internal changes to struct php_hash_blake3_ops, and that internal change would have to be updated for all other hashes PHP support.. I'm not up for doing that now. And I think it

Re: [PHP-DEV] BLAKE3 hash

2024-01-19 Thread Hans Henrik Bergan
>BLAKE3 has 2 default sizes Nope, only 1 canonical size, 256 bits. *BUT* BLAKE3 is XOF, it can be exactly as long as you want it to be: $ echo test | b3sum --length 5 dea2b412aa - $ echo test | b3sum --length 10 dea2b412aa90f1b43a06 - $ echo test | b3sum --length 32