BACK

What is PHP Used For in 2020? A quick explanation for beginners.

Let’s talk about what is PHP used for and what we can do with it in 2020. Also, what’s the future of this programming language? And is PHP really dying?

However, before getting into detail, let’s make sure we know what is PHP in the first place.

What is PHP?

PHP is a general-purpose programming language initially created for web development by Rasmus Lerdorf in 1994. It was used purely in server-side scripting along with HTML, CSS, and Javascript.

The PHP acronym stands for Hypertext Preprocessor. However, initially, it was called Personal Home Page back in the old days. This is how PHP looks like today:

<!DOCTYPE html>
<html>
    <head>
        <title>Example</title>
    </head>
    <body>
        <?php

            echo "Hello World!";

        ?>
    </body>
</html>

History and Future of PHP

The current version is 7.4.

PHP 8.0 is planned to be released on Q4 2020 or Q1 2021, which will probably have the following new features:

  • just in time compilation
  • fatal error for an incompatible method signature
  • consistent type errors for internal functions
  • arrays starting with a negative index
VersionRelease Date Description
1.01995-06-08 Called Personal Home Page Tools
2.01997-11-01Standalone language
3.01998-06-06Multiple developers joined PHP
4.02000-05-22Two-stage parse/execute tag-parsing
5.02004-07-13New object model
6.0Abandoned version
7.02015-12-03Performance improvements, type declarations, scalar type declarations, modern exceptions
7.42019-11-28Typed properties 2.0, weak references, reflection for references
8.02021 Q1?

Why use PHP?

Back in the days, PHP was getting a lot of hard criticism due to its flaws like poor performance and lack of OOP features. However, PHP has fixed most of the past issues. Why use PHP:

  • Huge performance bump after PHP 7.0 version
  • Powerful frameworks like Laravel, Symfony and Yii2
  • Package manager – Composer
  • Huge and active community
  • Fully-realized OOP
  • Easy to learn

How to run PHP?

It is possible to run a PHP script without any server or browser. Running PHP in a command-line might be useful if you need to execute a regular task in your computer using CRON ( on Linux ) or Task Scheduler ( on Windows ). For example – you can collect all of your invoices from Gmail and store it inside your computer.

To do these kinds of tasks, you need to install the PHP parser into your computer. You can find PHP parser for Windows right here – https://windows.php.net/download/.

PHP command-line tool ( CLI )

However, if you are planning to use PHP for website development, you will need a server with a technology stack like WAMP, AMPPS, or XAMPP.

#WindowsMacLinux
Tech. StackWAMPXAMPPAMPPS
Stands forWindows, Apache, MySQL and PHP Cross-Platform, Apache, MariaDB, PHP and Perl Apache, MySQL, PHP, Python and Softaculous 
Downloadwampserver.comapachefriends.org ampps.com

Is PHP Popular?

As you can see from the Google Trends – Python is experiencing huge popularity right now due to artificial intelligence and machine-learning advancements, however, it is not a very popular programming language for web development like PHP.

PHP vs Python vs Ruby vs ASP.NET vs Java

Even though PHP fame is fading, according to Google Trends, you should not be afraid, because it will not retreat from the web development world anytime soon. 

According to w3techs.com, PHP is used by 79.0% of all the websites for server-side programming, and there’s no close competitor.

2019 PHP statistics from w3techs.com
2019 PHP statistics from w3techs.com

What is PHP Used For?

Even though the main focus is server-side programming like collecting form data, sending or receiving cookies, and generating dynamic content, however nowadays it can do much more:

  • Desktop Applications ( PHP-GTK )
  • Database Applications
  • Command-line scripting
  • Machine-learning ( PHP-ML )
  • Server-side scripting

Even though making a desktop application or doing some machine-learning in PHP might be not practical, it is nice to know that there’s a way to do it.

For making desktop applications in PHP, check this PHP-GTK, and for machine-learning, there’s a library called PHP-ML.

Most popular PHP projects that you probably have heard of:

  • Facebook – social network
  • Yahoo! – search engine
  • Wikipedia – encyclopedia
  • WordPress – content management system
  • Flickr – photo-sharing service

Conclusion

You are probably asking yourself, should you pick this language? Well, it’s not an easy answer, and it all depends upon your goals and what you want to do. It might not be a good fit for a desktop application ( pick C# ) development or machine-learning ( pick Python ). However, I can confidently tell you that if you are planning to connect your career with web development, then PHP programming-language is the right choice.

If you would like to learn more about the history of PHP there’s a great presentation made by one of the initial PHP creators – 25 Years of PHP (by the Creator of PHP):

25 Years of PHP (by the Creator of PHP)

Good luck!

References

Newsletter

Get my content to your inbox every Monday. I promise, no spam included!

.

Leave a Reply

Your email address will not be published. Required fields are marked *