PHP has come a long way since its humble beginnings in 1995. While it was originally designed as a simple templating language, PHP has evolved into a full-featured…
In PHP, we have classes with methods inside them. Would making all your methods public be a good idea? No, because some of them should be used only by the class they're in and not anywhere else. What about class constants?
Developers like to use booleans as flags. They're a convenient way to indicate something as on/off, true/false, yes/no. But the problem is that booleans are not clear from calling code exactly what they do. For example: Does anyone in the calling scope have any idea what the defining scope is doing? Absolutely not. The flag
A few months ago, I stumbled upon a 24 years old buffer overflow in the glibc, the base library for linux programs. Despite being reachable in multiple well-known libraries or executables, it proved rarely exploitable — while it didn't provide much leeway, it required hard-to-achieve preconditions. Looking for targets lead mainly to disappointment. On PHP however, the bug shone, and proved useful in exploiting its engine in two different ways.
In my last post I talked about linking microservices together inside a single Docker network for easy communication between the services. For web developers, this poses an interesting problem: if we want to access the services from our local machines, we need to deal with the fact that we can't have multiple machines bound to
Four new array functions are likely coming to PHP 8.4 that are still in the RFC voting stage. Learn about these array_find functions and how they work.
As PHP developers, we need to know a lot of language features to make our code easy to write and maintain. Without explicitly being told about a part of the language, it’s hard to even know it exists, so today, we’re going to discuss the magic methods our classes have and how we should use […]
When creating applications with PHP, Exceptions play a vital role in handling errors and irregularities that arise during the application lifecycle. We are going to see how to use Custom Exceptions to improve our applications.
How to fix the SQLSTATE[HY000] [1524] Plugin 'mysql_native_password' is not loaded errors caused in MySQL 8.4 no longer enabling the mysql_native_password plugin by default.