Advanced Topics

This category covers advanced PHP topics such as OOP, design patterns, database, web services, and emerging technologies. Readers can learn how to leverage advanced PHP techniques to build scalable and robust web applications.

PHP Design Patterns Game: Flyweight — Defending the Kingdom Against a Goblin Horde

0
The kingdom is under attack. Hundreds of goblins are advancing toward the castle walls, and the royal defenders are preparing for battle.Some enemies are fast scouts carrying small weapons. Others are...

PHP cURL Multi: Building a Concurrent API Client Without an Async Framework

0
Modern web applications rarely depend on a single external service. A dashboard may retrieve customer information, order statistics, inventory availability, and delivery estimates from different APIs before returning a response to...

PHP Design Patterns Game: Proxy The Guardian of the Forgottern Vault

0
Welcome back to PHP Design Patterns Game. Today's adventure takes us beneath the ruins of an ancient kingdom, where a legendary treasure is protected by the Guardian of the Forgotten Vault.The...

PHP WeakMap: Caching Object Metadata Without Keeping Objects Alive

0
A cache is supposed to make an application more efficient. But a cache that retains objects indefinitely can create the opposite problem: memory consumption increases because objects that are no longer...

PHP Design Patterns Game: Bridge — The Elemental Arena

0
Welcome to the Elemental Arena. Warriors arrive carrying swords, bows and staffs. Each weapon can be enchanted with fire, ice or lightning, changing the damage it deals and the effects it...

PHP Sodium: Rotating Encryption Keys Without Losing Access to Existing Data

0
An application can encrypt sensitive database fields correctly and still face a difficult operational problem: what happens when the encryption key must change?Keys may need replacement because of an organizational policy,...

PHP Design Patterns Game: Facade — Escaping the Cursed Castle

0
Welcome back to PHP Design Patterns Game. Today, our hero enters a cursed castle. The exit is guarded by a locked gate, an ancient trap and a sleeping monster. Escaping requires...

PHP DateTimeImmutable: When Local Time Does Not Identify a Unique Moment

0
A timestamp looks precise until it is expressed as a local date and time without an offset. In many regions, daylight-saving transitions mean that a local clock can skip an hour...

PHP Design Patterns Game: Prototype — Building a Spell Laboratory from Reusable Blueprints

0
Welcome to the Spell Laboratory, a workshop where an alchemist prepares spells before sending them into battle. Each spell has a name, a damage value and a sequence of magical effects....
PHP and PostgreSQL appointment scheduling with a visual representation of overlapping intervals.

PHP + PostgreSQL: Preventing Overlapping Appointments at the Database Level

0
A scheduling application can validate a proposed appointment against every booking it currently knows about and still accept a conflicting appointment. The problem is not necessarily an incorrect overlap formula. It...