Deprecations in PHP 7.2

      2 Comments on Deprecations in PHP 7.2

The only constant is change.
– Heraclitus of Ephesus

PHP is a living language and as such, as some things are added, others are removed. Since PHP adheres to the best practice of Semantic Versioning, nothing will be going away in PHP 7.2, but some things will be marked as “Deprecated” so that developers can start removing them from their code and finding better ways to get the job done.

PHP 7.2 brings us a new list of things that will be eventually going away. The complete list, as well as explinations and voting can be found at “PHP RFC: Deprecations for PHP 7.2” Here’s the rundown.

  • __autoload
  • $php_errormsg
  • create_function()
  • mbstring.func_overload
  • (unset) cast
  • parse_str() without second argument
  • gmp_random()
  • each()
  • assert() with string argument
  • $errcontext argument of error handler

Of all the ones being voted on, only each() seems like it may not pass. The rest are all unanimous or with one or two no votes.

So it’s time to fire up your favorite IDE (or grep) and start looking for these. Again, they will not go away when PHP 7.2 is released. However, you are being put on notice that they will go away when 8 is released so you might as well identify them and start working on a fix.


About Cal Evans

Many moons ago, at the tender age of 14, Cal touched his first computer. (We're using the term "computer" loosely here, it was a TRS-80 Model 1) Since then his life has never been the same. He graduated from TRS-80s to Commodores and eventually to IBM PCs.   For the past 10 years, Cal has worked with PHP and MySQL on Linux OSX, and when necessary, Windows. He has built on a variety of projects ranging in size from simple web pages to multi-million dollar web applications. When not banging his head on his monitor, attempting a blood sacrifice to get a particular piece of code working, he enjoys building and managing development teams using his widely imitated but never patented management style of "management by wandering around". Cal is happily married to wife 1.33, the lovely and talented Kathy. Together they have 2 kids who were both bright enough not to pursue a career in IT. Cal blogs at and is the founder and host of Nomad PHP