PHP’S POSITION IN 2020

PHP is an easy to learn, object-oriented, dynamic, scripting, server-side type of programming language, which means that the code is running on the server. We cannot find there strong typing of variables, what on one side gives us more flexibility, but in the same time allows us to write unsightly and sometimes incorrect code. PHP syntax is quite simple, but some people describe it as “ugly”.

It is used mainly to create websites and web applications, all kind of forums, content manager systems and in e-commerce. However, nothing prevents you from creating a console application or even desktop app.

IS A PHP DEVELOPER NOT A PROGRAMMER?

From years there is an opinion in the developer’s community, that a PHP developer is not a programmer, but only a script writer. This opinion is based on the fact, that PHP is a scripting, interpreted (not compiled such as Java, C or C++) language. But it is still a programming language and now it is not used (like it was at the beginning) only to send forms from websites. The reason of that bad reputation of PHP programmers could be its simplicity. This is why PHP is often a first programming language for many developers. Therefore, in the internet appear so many trivial questions about programming basics, what may suggest generally a low level of knowledge and understanding of PHP developers. It is worth to mention, that they have been labeled before PHP version 5 was realeased, that is before it became a fully object-oriented language.

PHP PROS AND CONS

Pros Cons
– stable (has been developed over 20 years)

– good documentation

– big developer’s community

– simple syntax

– easy to learn

– many methods „ready to use”

– low memory requirements for scaling the application

– availability (PHP interpreter on almost every server)

– cheap hosting

– slow (little faster from ver. 7) – code is intepreted, not compiled

– big projects are difficult to maintain and develop

– problematic tracking of possible errors

– no strong typing of variables

– possibility to mix code with elements of view

– no consistent naming of functions (the situation improves with each new version)

 

HOW POPULAR IS PHP?

Data source: w3techs.com (11.08.2020)

Its popularity is evidenced by the fact that it is on the 5th place among the most common tags on the most popular website in the developer’s community – Stack Overflow (11/08/2020). PHP is a language which was created for websites. It is a clear leader on websites’ market and practically has no competition. 79% of all websites were created using this language. Certainly, this is largely due to the fact that most content management systems (CMS) are written in PHP. Among them we can find the most popular for many years, such as WordPress, as well as Magento, Drupal, Joomla, OpenCart and many others.

FRAMEWORKS

Several excellent frameworks have been developed for PHP, such as Laravel, CodeIgniter, Symfony, CakePHP, Yii and Zend Framework.

 

POPULAR SERVICES USING PHP

 

WHAT’S NEW IN LAST YEARS?

In last years definitively the biggest step forward was releasing PHP version 7. Certainly, the increase in the speed of application operation and the reduction of the demand for hardware resources are noticeable. From PHP version 5 we can indicate what type of parameters we expect in a method, but from version 7 we can also point what type we want return. Anonymous classes, an array constant and the possibility of grouping declarations also appeared in this version. Additionally, we can enforce even a more restrictive type checking by adding “declare (strict_types = 1);” in the first line of code. Other news are two new operators: „Null coalescing operator” (??) and „Spaceship operator” (<=>).

UPCOMING CHANGES IN PHP 8

PHP version 8 will be released on 26th November 2020. It will be a new major version, what means that there will be some changes which are incompatible with older versions. The good news, there are also many new features and a next significant increase of speed.

The most important news:

JIT – the code will be translated into machine code, which will definitely speed up its execution

Named arguments – we will be able to pass the arguments in any order using their names

Attributes – known as annotations in other languages

::class – in this way we will be able to retrieve the class of object

Trailing comma in parameter lists – from version 8, commas will be allowed at the end of the parameter list, for example like in JavaScript

Stringable – interface specifying variables of type “string” and all objects that implement the method “__toString ()”

And many other minor changes and news…

SUMMARY

PHP is not a go-to language and you should be aware of that. So when is it worth reaching for it? In addition to the most common applications mentioned at the very beginning, it is also worth considering its use in “startup” projects. The availability and low price of hosting that supports this language definitely speak for it. There is no shortage of PHP programmers on the market. It is also worth mentioning that many large-scale projects started to be written in PHP. One of them is the previously mentioned largest social networking site in the world – Facebook. So if you are faced with choosing a programming language for your startup, it’s worth considering whether it should be PHP.

AMB’S TECH INSIGHTS – AN ARTICLE BY GRZEGORZ

Grzesiek is a Senior PHP Engineer at AMB. In 2014 he started to work at AMB Software during his information technology studies at the University of Zielona Góra and quickly became a professional PHP engineer developing backend solutions for international clients.

Since two years Grzegorz is developing his skills in latest frontend technologies like ReactJS and VueJS, so that today he is involved in fullstack projects based on PHP, Symfony and JavaScript (ReactJS & VueJS).

DO YOU NEED HELP WITH WEB DEVELOPMENT? CONTACT US ATCONSULTING@AMBSOFT.DE

Our Latest Amb News

This site is registered on wpml.org as a development site. Switch to a production site key to remove this banner.