Hacker News new | ask | show | jobs
by kugelblitz 1251 days ago
Yes, the backward compatibility is a crux on the one hand, on the other hand it has made upgrading PHP versions a breeze. In the past 6 months I updated several code bases from PHP 7 / 8.0 to PHP 8.1 / 8.2, the PHP part was easy (just the deprecated dynamic properties in 8.2 caused a wall of text in our loggers), the framework was a bit more difficult. The most problematic were the exotic packages that the clients had installed ages ago and that are not properly maintained anymore, so I have to figure out a replacement for those code modules.

Constructor property promotion is fine, I think. I think it ties in well with the readonly property.

    public function __construct(
        public readonly Company $company,
    )
    {
    }
There's just so much info & functionality + type safety crammed into there that wouldn't have been possible previously; it's really nice.