When not to use PHP

There are two situations when I would not recommend PHP for use in a web application. Firstly, as already mentioned, if you desperately need all the performance you can get, you should be using C or C++. Both languages are unwieldy on the web, but they offer superior performance. Even in this situation you might want to consider simply writing your C code as extensions to PHP.

Secondly, if you are adding to a system which already has a lot of code already written in another language, then coding parts in PHP will only make your maintenance job more difficult, so you are likely to find it easiest in the long run to keep using the old language.

Author's Note: It's important for me to make the point that, although PHP is thread-safe, its libraries may not be. If you don't know what thread-safe means, you don't need to worry about it!


Want to learn PHP 7?

Hacking with PHP has been fully updated for PHP 7, and is now available as a downloadable PDF. Get over 1200 pages of hands-on PHP learning today!

If this was helpful, please take a moment to tell others about Hacking with PHP by tweeting about it!

Next chapter: Selling PHP to your boss >>

Previous chapter: When to use PHP

Jump to:


Home: Table of Contents

Copyright ©2015 Paul Hudson. Follow me: @twostraws.