Re: [PHP-DEV] [VOTE] Improve unserialize() error handling

2022-10-15 Thread Tim Düsterhus
Hi Resending the message without attachments, because the mailing list rejected the original due to exceeding 3 bytes: ezmlm-reject: fatal: Sorry, I don't accept messages larger than 3 bytes (#5.2.3) You can find the attachments at:

Re: [PHP-DEV] Casting array to any class

2022-10-15 Thread Larry Garfield
On Sat, Oct 15, 2022, at 6:18 AM, Gianni Gentile wrote: > Hi, > > in my every day experience, using custom DTO classes and different API, > I often write code to instantiate my objects from associative arrays. > > What are your thoughts on introduce the `(AnyType)` cast to instantiate > objects

Re: [PHP-DEV] [VOTE] Improve unserialize() error handling

2022-10-15 Thread juan carlos morales
El sáb., 15 de octubre de 2022 11:02, juan carlos morales < dev.juan.mora...@gmail.com> escribió: > As far as I read... Everyone is right. All agree is BC break change, but > this is being considered to be part of PHP 9.0, so if what We get is a > better PHP then We must move forward, and

Re: [PHP-DEV] Casting array to any class

2022-10-15 Thread Dan Ackroyd
On Sat, 15 Oct 2022 at 13:14, Gianni Gentile wrote: > > What are your thoughts on introduce the `(AnyType)` cast to instantiate > objects from associative array (or object properties also)? It seems a pretty bad idea. In particular, it makes for hard to maintain code as it doesn't give a place

Re: [PHP-DEV] Casting array to any class

2022-10-15 Thread Thomas Nunninger
Hi, Am 15.10.22 um 13:18 schrieb Gianni Gentile: Hi, in my every day experience, using custom DTO classes and different API, I often write code to instantiate my objects from associative arrays. What are your thoughts on introduce the `(AnyType)` cast to instantiate objects from

Re: [PHP-DEV] [VOTE] Improve unserialize() error handling

2022-10-15 Thread juan carlos morales
As far as I read... Everyone is right. All agree is BC break change, but this is being considered to be part of PHP 9.0, so if what We get is a better PHP then We must move forward, and such steps should be done in a major version change.

[PHP-DEV] Casting array to any class

2022-10-15 Thread Gianni Gentile
Hi, in my every day experience, using custom DTO classes and different API, I often write code to instantiate my objects from associative arrays. What are your thoughts on introduce the `(AnyType)` cast to instantiate objects from associative array (or object properties also)? In my

[PHP-DEV] Casting array to any class

2022-10-15 Thread Gianni Gentile
Hi, in my every day experience, using custom DTO classes and different API, I often write code to instantiate my objects from associative arrays. What are your thoughts on introduce the `(AnyType)` cast to instantiate objects from associative array (or object properties also)? In my

Re: [PHP-DEV] [VOTE] Improve unserialize() error handling

2022-10-15 Thread Christoph M. Becker
On 15.10.2022 at 11:06, Nicolas Grekas wrote: >>> I'm therefore voting NO on the proposal. >> >> I'm not surprised by the “no” on the first vote based on the previous >> discussion. I am surprised however that you also disagree with raising >> the E_NOTICE to E_WARNING for consistency. > > Since

Re: [PHP-DEV] [VOTE] Improve unserialize() error handling

2022-10-15 Thread Marco Pivetta
Tbh, this affects a new minor and a new major, and only in an unhappy path scenario, where the current PHP API is bad. PHP 9 will introduce a hard crash: good. It's a BC break: yes, native de-serialization is one of the most unsafe parts of the language, and it requires hardening. The fact that

Re: [PHP-DEV] RFC [Discussion]: Randomizer Additions

2022-10-15 Thread Joshua Rüsweg via internals
Hi For completeness, it would be good to have nextBool() as well. I'm just wondering if that's really necessary. Generating a boolean is trivial with the nextFloat method (see example 1. Simulate a coinflip from the RFC). No, IMO. Mathematically it doesn't really make sense and talking

Re: [PHP-DEV] [VOTE] Improve unserialize() error handling

2022-10-15 Thread Nicolas Grekas
> > Not sure why I didn't think about it before but I just ran the test suite > > of Symfony after applying the patch proposed in the RFC to change the way > > exceptions are handled by unserialize. > > > > This change breaks the test suite of 5 separate components. I created > this > > gist to