About what's new on PHP 8.3 and PHP 8 design patterns. [W37]
We don't have many news this week, small Laravel and Symfony releases, and some interesting articles and tutorials.
👨💻 Launch your product idea
A Senior Developer As A Service. A fixed subscription for unlimited request. You can pause it, or cancel at any moment. A great opportunity to launch your SaaS or improve your product.
[Ad] https://developerjoy.co - Appear here
PHP
📚 Exploring the New Features and Enhancements in PHP 8.3: A Deep Dive into the Latest Updates
Json Validation: PHP 8.3 introduces a native method for validating whether a string is JSON or not. Example usage:
$json = '{ "example": "title" }'; $is_json = json_validate($json)
;Improved unserialize() Error Handling: PHP 8.3 enhances error handling in the
unserialize()
function. It provides a more consistent and predictable way to handle errors during unserialization.Fetching Class Constants Dynamically: In PHP 8.3, you can fetch class constants dynamically using variables. Example usage:
$variable = "OK"; echo StatusCodes::{$variable};
Introducing Read-Only Modifications: PHP 8.3 allows reinitialization of readonly properties within the
__clone()
magic method. This enables you to modify readonly properties during cloning.Typed Constants: Prior to PHP 8.3, constants were defined without specifying a type. PHP 8.3 introduces typed constants, allowing you to specify a type for class constants.
const int HTTP_STATUS_OK = 200;
Laravel
🆕 Laravel 10.22
A patch release yesterday and a few new features today brings us to Laravel 10.22. Here are the highlights:
Add enum support to the
in
andnotin
validation rules in #48247Introduce
requireEnv
in #48261Add ULID testing helpers in #48276
You may review the full branch diff on GitHub for a complete list of changes.
📦 Laravel Viewer 3 is out!
This amazing package now support multiple log formats, it has a log type switcher, email previews, and more minor changes. Check the package on GitHub.
Symfony
🆕 6.3 changelog:
29f427f: [Mailer] fix EsmtpTransport variable $code definition.
95153c4: [Mailer] reset $code variable each iteration for prevent wrong exception codes.
🆕 6.4 changelog:
9b2a4db: [DoctrineBridge, Messenger] always use executeStatement method.
🆕 7.0 changelog:
75119b0: [Workflow] remove GuardEvent::getContext() method without replacement.
Articles & Misc
📚 11 Design Patterns in PHP 8
Here you have a collection of 11 articles about different patterns in PHP. From the simplest and most common to some more specific ones.