Fun little story. My host recently contacted everyone to tell us that the PHP 7 version on the servers which were recently upgraded to 7.2 (5.6 is also available and is still the default) was rolled back to 7.1. Apparently a lot of sites were breaking including WordPress plugins, Magento and others. Continue reading “PHP 7.2 Rollback”
Category: PHP
Bite Sized Code Refactoring – Redundant DB Connections
I maintain and work on a number of legacy code applications. One of them has earned itself some refactoring. So I’ll try to share some of the changes I’ve been making to improve it. Today, a problem that’s bothered me for a while: the DB class connects to the database even if no queries are being used.
I should be thankful that this legacy app doesn’t have a bunch of mysqli_* calls all over the place. Back when I wrote it I at least had the presence of mind to wrap SQL functions in an abstraction class. So this change was quite easy to make.
Continue reading “Bite Sized Code Refactoring – Redundant DB Connections”
PHP7 Type Hinting And Docblocks
Among the awesome improvements brought to us by PHP7, comes type hinting. An addition to PHP which might be controversial among developers who love PHP’s dynamic typing. PHP isn’t losing its flexibility. On the contrary, we are now gaining yet another way to express our intentions in our code. Continue reading “PHP7 Type Hinting And Docblocks”