Property Hooks RFC for PHP 8.4

A couple of days ago, I wrote about PHP 8.4 and what to expect. Well, I should have wait a bit longer to include big news: the Property Hooks RFC passed the vote and will likely get added to PHP 8.4. With an overwhelming 34 to 1 “yes” – which is clearly above the required … read more …

PHP 8.4: Release Date and Features, April 2024

PHP 8.4 is poised to introduce a range of new features and updates that are designed to improve security, enhance functionality, and provide developers with new tools to manage and process data more efficiently. PHP 8.4 is expected to be released in November 2024. According to the Preparation Tasks list, the schedule is as follows: … read more …

Laminas Framework Series: Mezzio vs. MVC

In the fourth post of the Laminas Framework Series I want to compare middlewares using Mezzio and the MVC framework by Laminas. The Laminas Framework, despite its relatively new, it is derived as a full-fledged derivative and successor to the Zend Framework, firmly anchoring it in the context of PHP-centric enterprise software development. Mezzio, once … read more …

Static Source Code: Why You Should Avoid it

If you regularly read my blog, you will know I am a strong advocate of object oriented programming and principles like S.O.L.I.D. This means in contrary, static code in whatever form or purpose is incompatible with the way how I structure my software projects. In this post, I will give a quick summary about static … read more …

Readonly Classes in PHP: A Useful Addition to Readonly Properties

Last year around this time, I asked the question whether readonly properties replace getters. I gave a short overview about “best practices” on object oriented programming, summarized the idea of immutable objects and demonstrated how readonly properties helps writing better and more robust code with PHP, before I finalized the blog with my opinion how … read more …

fsync Unlocked: PHP & Advanced Memory Synchronization

Back in 2021, PHP released version 8.1 and a very important feature that I want to address here: fsync and fdatasync. It always catches me off guard when such fundamental features are introduced into the language at such a late stage: fsync is a native operating system function and the only thing that needs to … read more …

What’s new in PHP 8.3

TL;DR: PHP 8.3 will be released on November 23, 2023. It will add typed class constants, a new helper function json_validate to check json payloads and some minor improvements for Randomizer class, reading ini configuration and more. The PHP team will release the new minor version of PHP to the end of this month. The … read more …

Laminas Framework Series: Middleware in Mezzio and MVC

The second post of “Laminas Framework Series” compares Mezzio and the framework based on “Model-View-Controller” (short: MVC). The Laminas Framework is for its own is relatively new, but since it is an entire fork and a continuation of the Zend Framework, it has very deep roots in the enterprise software development with PHP. Mezzio – … read more …

PHP 8: Making the Choice Between “switch” and “match”

In the constantly changing landscape of PHP, version 8 brought with it an innovative feature: the match expression. Many see it as a streamlined and more effective counterpart to the traditional switch. Let’s explore their distinctions. The traditional switch goes something like this: With PHP 8, the equivalent match looks far more compact: At a … read more …

Towards Powerful PHP Applications: WeakMaps and Their Practical Usage

PHP introduces WeakMap datastructure with version 8.0. This new data structures is capable of containing objects while simultaneously enabling them to be cleared via garbage collection once not needed anymore. WeakMap is a evolution of weak references added with PHP 7.4 and enables the development of collections of references that can be subjected to garbage … read more …