Re: Alias stdClass to DynamicObject?

From: Date: Mon, 06 Sep 2021 21:42:23 +0000
Subject: Re: Alias stdClass to DynamicObject?
References: 1 2  Groups: php.internals 
Request: Send a blank email to internals+get-115978@lists.php.net to get a copy of this message
On 06/09/2021 18:36, Björn Larsson wrote:
In case of deprecation of stdClass I would like to point out that the benefit of replacing "new stdClass" with "new DynamicObject" in our existing code is absolutely zero. However, using DynamicObject in new code has a benefit since the intent is clearer.
Just to mildly challenge this: Why is the intent of old code any less important? Do you never hire junior developers, or those cross-training from other languages, who have to maintain that code? Do you never have days where your brain is just a bit fuzzy, and every extra meaning you have to think about is one less line of code you'll get written? But yes, for experienced PHP developers, the name is not that big a deal. Indeed, a lot of PHP developers probably never even see it. It's one of those little "paper cuts", where if we can make the fix not too painful (including deprecation messages not being too annoying), it will pay off in the long run. Regards, -- Rowan Tommins [IMSoP]

« previous php.internals (#115978) next »