042_tf_hermann_titan-framework-and-php7-what-to-expect-aheadAs we have started going through insurmountable amounts of pull requests, (and we do admit we have been lax in the past, sorry!) one topic and issue caught our eyes: PHP7 Compatibility.

According to that issue in Awesome Support, Titan Framework isn’t working as expected in PHP7, which was later raised in our Git issues for TF.

The first symptom of PHP7 problems came from one plugin that used Titan Framework: Awesome Support. There were several symptoms found (1, 2, and 3and the fix we had to make for it.

Of course, this was the overall result: our upcoming version of Titan Framework should now work well with PHP7. Good news right?

“But wait, that means we can now throw out legacy codes and make use of all the new features, right?”


Believe it or not, PHP 5.2 is still in use in many webservers, and that’s despite it reaching EOL (end of life) sometime ago. Case on point, if we choose to throw out PHP 5.2 compatibility, we’d be alienating users and cause PHP issues. This is something that was raised when we ran into a problem with our SCSS library.

PHP7’s influence in the workflow

Questions like “Why does PHP7 matter?” and “What should we expect from it?” cannot be helped but asked. Thankfully, an article by Digital Ocean should shed light, including compatibility issues that could be troublesome.

In hindsight, the article speaks of the following:

  1. Strict enforcement of PHP coding standards. (Wrong PHP header tags and multiple default values in switch will cause fatal errors)
  2. Removed deprecated functions. (like all mysql_* functions, split and ereg_* functions)
  3. Implementation of Uniform Variable Syntax, which could make some functions behave differently across PHP versions.
  4. New operators and functions.
  5. Enforcement of specified variable types.

The role of Titan Framework

That is something you should put into consideration when you work with frameworks like this, especially if you’re a plugin or theme author.

Of course, it goes without saying that ignoring PHP 7 is a bad idea too. Future security issues and no forward compatibility would eventually lead us being left in the dust in the years to come.

Titan Framework, therefore, plays a delicate balancing act: supporting the future and the past as well.

The specific balancing act we have to do here is that: All PHP codes should work in either versions without any problem. No deprecated code, but no codes that can’t be parsed in older versions. Fortunately, with the nature of PHP, there’s always a workaround for that sort of thing.

Leave a Reply