Just because WordPress still supports PHP 5.2 doesn’t mean you have to

WordPress still has a minimum PHP 5.2 requirement, which has many known security issues and reached end-of-life back in 2011. 4 years ago. A lot has changed in PHP and software development in general since then, and while WordPress should perhaps be taking more of a leadership role to push for change, it doesn’t mean we have to wait.

Digging into core, the “WordPress way” might appear to be to use global variables for most of your core objects, and to have large files with logic and HTML output interspersed rather than the logic and view separated.  I can still take the core WordPress pieces and add more reusable, modular and testable code on top of it.

Maybe I want to pull in libraries from Laravel into my plugin or theme?  I can do that.  Add or create a framework to control a more complex theme admin interface rather than a behemoth functions.php file?  No problem.  Use namespaces and variadic functions?  Sure.

Of course that doesn’t mean I should start overriding things like the Template Hierarchy, making it more difficult for developers to jump in and find the views they need to modify, but outside of those standard file conventions, the sky’s the limit.