Dominik Chrástecký - Blog
I’m a developer and an architect with ~10 years of experience. My languages of choice are PHP (Symfony), C#, Go and Typescript. With a tiny bit of Java and C++ here and there. I often write open source libraries, you can find my work on my GitHub. I started this blog for 3 reasons: I’ve wanted to start a blog for the last 15 years but never had time, I wanted a personal place where I can share whatever’s on my mind, and I wanted to create something that uses ActivityPub.
- 22 Posts
- 9 Comments
Dominik Chrástecký - Blog@chrastecky.devOPMto
Programming@chrastecky.dev•Fun with PHP: Changing Readonly Properties and Other Shenanigans
1·1 year agoUpdated the article, thanks! Wouldn’t really say that’s a stupid addon, though, the expected way to use readonly properties from other languages is assign the value directly (impossible in PHP) or inside the constructor (or other mechanisms that are only available during object creation, like C# initializers etc.).
Dominik Chrástecký - Blog@chrastecky.devOPMto
Programming@chrastecky.dev•New in PHP 8.5: The Pipe Operator
1·1 year agoOh, right, that didn’t occur to me. Well, guess I got used to it eventually. But yeah, the
already does way too many things in PHP.
Dominik Chrástecký - Blog@chrastecky.devOPMto
Programming@chrastecky.dev•New in PHP 8.5: The Pipe Operator
1·1 year agoI would’ve preferred
?, butis fine, IMO.
Dominik Chrástecký - Blog@chrastecky.devOPMto
Programming@chrastecky.dev•New in PHP 8.5: Asymmetric Visibility for Static Properties
1·1 year agoI like it as well, recently had one use case where it would have been the best solution, sadly php-cs-fixer chokes on that so I had to do it with property hooks.
Dominik Chrástecký - Blog@chrastecky.devOPMto
Programming@chrastecky.dev•New in PHP 8.5: Marking Return Values as Important
2·1 year agoSame, but given how seriously they take BC breaks, I don’t really see it happening. Well, at least we have mature tooling to avoid having horrible code in production code-bases.
Dominik Chrástecký - Blog@chrastecky.devOPMto
Programming@chrastecky.dev•New in PHP 8.5: Marking Return Values as Important
3·1 year agoWell, that’s historical, if PHP was being designed today, I think a lot of the things would look very different. As everything since version 7.x, this is a step in the right direction of making the language modern and safer to use.
Like, this is still PHP, both of these are equally valid:
<?php function hello(string $name): string { return "Hello, {$name}!"; } function hello($name) { return "Hello, $name!"; }So anything that makes it possible to write a good, clean code is a great addition, IMO.
Dominik Chrástecký - Blog@chrastecky.devOPMto
Programming@chrastecky.dev•Transpiling PHP for older versions
1·2 years agoHmm, that build number would definitely be better! I tried adding another level (like 1.0.0.84) but that didn’t work. I’ll try it with the build numbers.
I wrote a GitHub workflow that transpiles it on release and tags each transpiled version, then pushes those tags to the repo. Packagist automatically fetches tags, so it gets them automatically.
For example, the tag v2.7.082.
Dominik Chrástecký - Blog@chrastecky.devOPMto
Gaming@chrastecky.dev•Persistent packages on Steam Deck using Nix
1·2 years agoYou mean the blog post I wrote myself and published on my ActivityPub enabled blog? That kind of “spam bot”?


I’d argue there’s no reason ever to actually use it in production. This is such a horrible hack that it has no place outside dicking around for fun.