A PHP from the Future

As developers, we find ourselves living in exciting times. With increasing attention paid to online activities, we’re working with larger data sets (even “big data”); scalability and connectivity are more important than ever before; the very nature of privacy is being re-examined. But quietly, in the shadow of all of this, sits perhaps a more pragmatic question. How will PHP change and grow to enable us to build the future, whatever it may hold?

I Predict

Will the inconsistent string function signatures ever be normalize? I doubt it. Will PHP ever be multi-threaded? Probably not, but maybe we’ll see Promises or Lua-style coroutines. If a police box suddenly appeared and an eccentric man popped his head out and said, “Behold, I bring you a PHP from the future!”, what might we see? I predict:

  • We’ll see a version of PHP with a double-digit minor version number. It would be wonderful to have full native support for working with Unicode-encoded strings, but the dev team has all but given up on it so don’t hold your breath. With no clear changes intrusive enough to warrant a major version bump, I can easily imagine a PHP 5.10, 5.11, 5.12, …
  • We’ll see minor enhancements that mirror other programming languages. We’ve recently gained binary number literals, short array syntax, and function array referencing in PHP 5.4, and generators and finally in 5.5. Python-style array slicing would be welcome, as well as a C#-inspired get/set property syntax.
  • The ecosystem will have less frameworks, more meta-frameworks. First there were libraries, then CMS and blogging platforms, then full-featured frameworks. The monolith platform trend has peaked and we’re scaling back with micro-frameworks and meta-frameworks. Light-weight platforms that gather diverse libraries into an easily-installable bundle or package will bring us full-circle.
  • There will be a plethora of new extensions. New tools like Zephir make it easier for non-C developers to write extensions, so expect to see a fair amount of new extensions as these offerings mature. And of course, some extensions now in Pecl may make it to core and old extensions will be retired. embedded NoSQL service would compliment the SQLite extension nicely, don’t you think?
  • There will be less reliance on the Zend Engine. Most people aren’t aware of other implementations of PHP, such as Phalanger, Quercus, HHVM, and even Parrot. A future where various run-times, each optimized for a particular use case, can be swapped out as needed doesn’t seem implausible.
  • PHP will adapt. An increasing share of mobile devices, C10k, Web Sockets — yes, the way we use the Web is changing. Offerings like FastCGI/FPM, HHVM, and Ratchet are just the tip of the iceberg of what PHP needs to meet these challenges head-on. But we might find PHP in unexpected places, too. How about in routers, smart appliances, and other devices? With a built-in web server and embedded database, the *AMP stack can now be spelled just PHP. Shipping a release with a reduced set of core extensions/functions and specialized run-time could make Embedded PHP a reality.
  • PHP will thrive. Despite its warts, there aren’t any mainstream languages that come remotely close to integrating with the web stack as intimately and as flexible as PHP does. We can access incoming data directly with $_GET and $_POST, and the functionality for working with sessions and headers is baked right in. Languages like Java, Ruby, Python, et al. need special frameworks or libraries to do these things comfortably. Detractors can complain all they want, but another language won’t displace PHP any time soon unless it can integrate as smoothly.

Your Thoughts?

But disappearing blue boxes don’t exist and no one really knows what the future holds. I’ve just tried to observe the general trend of things and conservatively estimate where we could end up. Perhaps some predictions have merit; maybe some are laughable. What do you think?

I’ll leave you with one of my favorite futurology-related quotes:

The best way to predict the future is to invent it. – Alan Kay

Feel free to post your thoughts in the comments section below.

Free book: Jump Start HTML5 Basics

Grab a free copy of one our latest ebooks! Packed with hints and tips on HTML5's most powerful new features.

  • Anonymous

    awesome…..am getting the hang of functions and oop. Tech is changing with every breaking dawn!!!

  • krakjoe
  • will

    PHP is already multi-threaded. I’m using native threads as we speak.

    http://pthreads.org

    • Anonymous

      I was going to say threading would be a key to providing more power to php, did not know this already existed!

      Would be amazing if hhvm became the default engine to run php

  • Loganathan

    very true, everyday new frameworks coming

  • Pere

    JSON Variables style please PHP!

  • Anonymous

    It would be nice if something like ReactPHP http://reactphp.org/ became a core, official feature.

    One of the things that bugs me about PHP is the lack of monkey-patching (like Ruby) / duck-punching (like JS). The fact that functions are set in stone can make certain sorts of problems very difficult to solve.

    Also, it really bugs me that the majority of PHP extensions (and PHP itself) are not written in PHP. That makes it very difficult to diagnose upstream bugs, unless you’re well-versed in C. I think this is a major problem for PHP, and one that isn’t as severe in the Ruby or Node.JS communities.

  • Joe Ramsson

    PHP runs more than 70% of the web is the that it’s emerging and we can be sure to see features like multi-threading, multi-lang character comparison will be available soon. In fact, access application like OSIpage(www.osipage.com) uses PHP to serve analytic data.

    • Kevin

      Grrr!!!… we do have multithreading #pthreads

  • Bikramdeep Singh

    Wow. if this happens -> “we might find PHP in unexpected places, too. How about in routers, smart appliances, and other devices? With a built-in web server and embedded database, the *AMP stack can now be spelled just PHP. Shipping a release with a reduced set of core extensions/functions and specialized run-time could make Embedded PHP a reality.”

  • Ayman

    @author: Detractors can complain all they want, but another language won’t displace PHP any time soon unless it can integrate as smoothly.

    Google is currently building dart with the community(still in development), so it may be decent competitor to php (https://www.dartlang.org/docs/#creating-command-line-apps), but as @Joe Ramsson mentioned in his comment php has more than 70% of the web so it may take a while to spread to web server programming (not as I want it to replace php, but it may be good idea to have alternatives). What I really hope that it will replace JS (for good).

  • Anonymous

    I hope that function will disappear public getXYZ(){}; is everything we will need.

  • Anonymous

    And I hope we see a proper Garbage Collector

  • Nelson

    What about a complete and decent object model implementation?. Yeah, PHP is an hybrid language that let you mix up structurated and object-oriented paradims in the same file, but the latter is actually pretty lame. And why need special frameworks or libraries to access session and header data is a bad thing? because it’s slower?. I work with PHP (actually a work with Symfony 2.3) but its popularity is proporcional to its messy design, I hope another language take its place, I hope that language will be Python (and not for sentimental reasons).