SSR support in Angular makes it suitable for a whole new category of apps: content websites that need SEO and other metadata rendered directly in the HTML source instead of client-side at runtime. ...
Originally, I intended to write an article about every single change in PHP 8.5, but then I realized that some of them don’t really warrant a full post. That didn’t stop me from trying, though. ...
Ever wanted to set a closure as a default parameter value in PHP, only having to come up with workarounds? In PHP 8.5, that frustration is gone. Closures can now be constant expressions — meaning they work anywhere you’d use a literal value. ...
One of PHP's longstanding limitations is that scalar values (strings, integers, arrays, etc.) cannot have methods. As a result, deeply nested operations often end up looking cluttered and hard to read: ...
As an interpreted language, PHP has inherent performance limitations, especially when it comes to CPU-bound tasks. Go, on the other hand, is a compiled language known for its speed and efficiency. By leveraging PHP’s Foreign Function Interface (FFI), we can call Go functions from PHP via a shared C layer and achieve ...
This change is quite straightforward, so this won’t be a long article. PHP 8.5 adds support for annotating non-class, compile-time constants with attributes. Compile-time constants are those defined using the const keyword, not the define() function. ...
PHP 8.5 introduces a variety of compelling features. As a library author, I'm particularly thrilled by the addition of the built-in #[NoDiscard] attribute, enabling developers to mark a function or method's return value as important. ...
I've created Matrix bots before, and sending simple unencrypted messages is so easy it doesn't even require a library. Typically, you'd get your room ID, username, and password, then perform two HTTP requests: one for login, and one for sending the message. ...
Making Your Angular App SEO-Friendly with SSR ( chrastecky.dev )
SSR support in Angular makes it suitable for a whole new category of apps: content websites that need SEO and other metadata rendered directly in the HTML source instead of client-side at runtime. ...
New in PHP 8.5: Small Features, Big Impact ( chrastecky.dev )
Originally, I intended to write an article about every single change in PHP 8.5, but then I realized that some of them don’t really warrant a full post. That didn’t stop me from trying, though. ...
New in PHP 8.5: Closures as Constant Expressions ( chrastecky.dev )
Ever wanted to set a closure as a default parameter value in PHP, only having to come up with workarounds? In PHP 8.5, that frustration is gone. Closures can now be constant expressions — meaning they work anywhere you’d use a literal value. ...
New in PHP 8.5: The Pipe Operator ( chrastecky.dev )
One of PHP's longstanding limitations is that scalar values (strings, integers, arrays, etc.) cannot have methods. As a result, deeply nested operations often end up looking cluttered and hard to read: ...
Go Meets PHP: Enhancing Your PHP Applications with Go via FFI ( chrastecky.dev )
As an interpreted language, PHP has inherent performance limitations, especially when it comes to CPU-bound tasks. Go, on the other hand, is a compiled language known for its speed and efficiency. By leveraging PHP’s Foreign Function Interface (FFI), we can call Go functions from PHP via a shared C layer and achieve ...
New in PHP 8.5: Asymmetric Visibility for Static Properties ( chrastecky.dev )
This minor addition brings asymmetric visibility—already available for instance properties—to static properties as well. ...
New in PHP 8.5: Final Promoted Properties ( chrastecky.dev )
Starting with PHP 8.5, you'll be able to do the following: ...
New in PHP 8.5: Levenshtein Comparison for UTF-8 Strings ( chrastecky.dev )
PHP has long had a levenshtein() function, but it comes with a significant limitation: it doesn’t support UTF-8. ...
New in PHP 8.5: Attributes on Constants ( chrastecky.dev )
This change is quite straightforward, so this won’t be a long article. PHP 8.5 adds support for annotating non-class, compile-time constants with attributes. Compile-time constants are those defined using the const keyword, not the define() function. ...
New in PHP 8.5: Marking Return Values as Important ( chrastecky.dev )
PHP 8.5 introduces a variety of compelling features. As a library author, I'm particularly thrilled by the addition of the built-in #[NoDiscard] attribute, enabling developers to mark a function or method's return value as important. ...
Creating a Simple Encrypted Matrix Bot in Go ( chrastecky.dev )
I've created Matrix bots before, and sending simple unencrypted messages is so easy it doesn't even require a library. Typically, you'd get your room ID, username, and password, then perform two HTTP requests: one for login, and one for sending the message. ...
Static Typing for the AWS SDK for PHP ( chrastecky.dev )
If you just want to install it without reading the whole article, you can install it via Composer: rikudou/aws-sdk-phpstan. ...
Transpiling PHP for older versions ( chrastecky.dev )
The Problem ...
Doctrine and SQLite migrations: How to disable foreign keys in PHP 8.4 ( chrastecky.dev )
The problem ...