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?
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
|1.0||1995-06-08||Called Personal Home Page Tools|
|3.0||1998-06-06||Multiple developers joined PHP|
|4.0||2000-05-22||Two-stage parse/execute tag-parsing|
|5.0||2004-07-13||New object model|
|7.0||2015-12-03||Performance improvements, type declarations, scalar type declarations, modern exceptions|
|7.4||2019-11-28||Typed properties 2.0, weak references, reflection for references|
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/.
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.
|Stands for||Windows, Apache, MySQL and PHP||Cross-Platform, Apache, MariaDB, PHP and Perl||Apache, MySQL, PHP, Python and Softaculous|
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.
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.
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.
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
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):