Looking for top PHP Developers? They are just a few clicks away.

The State of PHP Development

Aug 19, 202111 min read

Dawid Karczewski

Senior full stack developer and CTO at Ideamotive.

PHP is one of the oldest open-source programming languages. Developed over 26 years ago, PHP has evolved from a simple web page builder to become a popular scripting language for web applications and APIs. 

 

With each version release comes extensive functionalities and features that simplify and speed up software development processes. In this article, we dig deeper into the state of PHP in 2021, how it has changed since last year, and its future development. 

 

Check out the State Of Ruby On Rails Web Development At The Beginning Of 2021.

 

Table of contents:

  • The State of PHP at the beginning of 2021
  • Popular frameworks for PHP in 2021
  • New version updates for PHP in 2021
  • Future plans for PHP Development
  • Is PHP a good choice in 2021?

The State of PHP at the Beginning of 2021

One common misconception is that PHP is outdated. Some programmers see it as a dying language, which could not be further from the truth.

 

PHP remains one of the most popular programming languages in 2021. W3Techs data shows that as of January 1st, 79.1% of websites with a known server-side programming language use PHP. This figure is a slight but notable increase from the December 2020 usage statistics of 79%.

 

By June 1, 2021, about 79.2% of websites now use PHP, growing even further than its usage at the beginning of the year.

 

usage statistics of sever-side programming languages chart

 

This may be due to the introduction of additional functionalities in the most recent version— PHP 8— which was released late 2020. This version introduced improvements and new features like:

 

  • Just-In-Time (JIT) Compiler:

JIT improves PHP execution speed. However, this performance improvement is more substantial in mathematical codes rather than web application codes. The feature also opens up the possibility of moving codes from C to PHP. JIT compiler is enabled through the OPcache extension.

 

  • Weak Maps

This feature is an improvement on the previous version's Weak References. Weak Maps hold a collection of references that allows objects to be garbage-collected if there are further references. It improves performance and memory management.

 

  • Union Types 2.0 

Before PHP 8.0, only two union types were supported. They are the nullable unions using the ?Type syntax, and the array or Traversable union using the special iterable type. In this latest version, arbitrary union types are supported in function signatures and are defined using the T1|T2|... syntax. The advantages of this feature include:

  • Ease of moving type information from phpdoc into function signatures
  • Early detection of mistakes, and 
  • Fewer chances of the type information becoming outdated. 

 

  • Attributes v2

In the previous version 7.4, metadata can only be added through doc-comments. The PHP 8 introduced attributes that enable developers to add metadata to declarations in a structured way without the need to parse docblocks. Attributes are added before the declarations (functions, classes, constants, properties, methods, and parameters) they apply to. They can be declared before or after a docblock comment. 

 

Other improvements in PHP 8.0 include:

  • New Classes, Interfaces, and Functions
  • Constructor Property Promotion
  • Saner String to Number Comparisons
  • Improvements on Syntax 
  • Nullsafe Operator 
  • Match Expression v2
  • Named Arguments
  • Consistent Type Errors for Internal Functions

 

There have been some updates on PHP 8.0 this year. These are 8.0.1, 8.0.2, 8.0.3, 8.0.4(unreleased), 8.0.5, 8.0.6, and 8.0.7 released between January and June, 2021. We will discuss these version updates later on in the article. 

Popular Frameworks for PHP in 2021

There are up to 38 PHP frameworks available. Here are some of the popular frameworks in 2021:

Laravel

Laravel is a free, open-source PHP web framework with robust features and applications that simplify web development. It has a Model-View-Controller (MVC) based architecture and features like Eloquent ORM and artisan tools that enable web developers to automate repetitive coding tasks and make the development process faster. Other functions include built-in authentication, easy integration with popular email services, Blade templating engine, and many more.

Pros:

  • It has a moderate learning curve which makes it suitable for beginners with basic knowledge of web development, PHP, and object-oriented programming.
  • This framework has robust tools and features that allow developers to create and customize complex apps easily.
  • Laravel has built-in authentication and authorization features that ensure the development of secure, scalable apps. 
  • Its MVC architecture promotes good coding ethics and conduct.
  • Laravel has great community support and documentation. 

Cons: 

  • Installing and configuring Laravel on shared hosting can be difficult.
  • There's a lack of continuity between versions which may cause breaks when you try to update codes. 
  • It is easy to start but may be hard to master. 

Other Details

Gitstar: 65.4k+

Launched: 2011

Latest stable version: 8.16.1

Companies using Laravel: MasterCard, 9GAG, BitPanda, and Razorpay among others

Technical requirements:

  • PHP 7.3+
  • Install Composer
  • Database support for MySQL 5.7+, PostgreSQL 9.6+, SQLite 3.8.8+, SQL Server 2017+.

Symfony 

Symfony is a set of reusable PHP components and a web framework for web application development, APIs, and microservices. It is notable for its easy integration and features that; reduce repetitive tasks, eliminate strict dependencies, and improve adaptability. Symfony allows you to use full-stack customization to develop a complex application with various functionalities. Also, you can use the brick-by-brick framework to build a product using certain functionalities or install a specific brick for your desired functionality. 

Pros: 

  • It has highly flexible features that are customizable to your project requirements. 
  • Symfony was developed and sponsored by SensioLabs. This ensures the framework is stable, sustainable, and regularly updated.
  • It has excellent documentation and a large community.
  • It is mostly suited to complex enterprise projects.
  • Symfony has built-in functionality for unit testing and reporting.
  • It has easy integration features.

Cons:

  • It is not as fast as most PHP frameworks like Laravel.
  • This framework is not ideal for simple projects due to excessive configuration and dependencies.
  • It has a steep learning curve.

Other Details

Gitstar: 25.5k+

Launched: October 2005

Latest stable version: 5.2.6 released on March 21, 2021

Companies using Symfony: Typeform, Statista, Stack, Postclick, etc.

Technical requirements:

  • PHP 7.2.5+
  • Install Composer.

CodeIgniter

CodeIgniter allows developers to build dynamic apps using PHP. Although CodeIgniter supports the MVC pattern, it is optional, thereby making this framework non-restrictive. Although it has fewer features than Laravel, it is powerful and is well-known for its lightweight, easier installation, and speed. Some CodeIgniter features include security and XSS filtering, email integrations, flexible URI Routing, data encryption, Query Builder database support, and more. 

Pros:

  • CodeIgniter is easy to learn, even for PHP amateurs.
  • It has minimal installation and configuration steps.
  • It is lightweight and does not require high memory capacity.
  • CodeIgniter is best suited for small to medium-level projects.
  • It has a low learning curve and adequate available documentation
  • It is faster when compared to other PHP frameworks.

 Cons:

  • CodeIgniter has no built-in authorization and authentication features.
  • Most of the libraries are older and deprecated with no release calendar to gauge timelines for proposed improvements.
  • It has no built-in modularity features and therefore requires developers to create modules from scratch. 
  • This framework may not be suitable for developing applications with complex requirements due to a lack of robust functionalities.
  • It has no templating engine.

Other Details

Gitstar: 18.1k+

Launched: February 2006

Latest stable version: 4.1.1

Companies using CodeIgniter: SocialDog, Buffer, Accenture, Birdview, among others

Technical requirements:

  • PHP 7.3+
  • Database support for MySQL 5.1+, SQLite3, PostgreSQL, MSSQL.

Yii Framework

Yii—an acronym for "Yes It Is"—is a PHP framework that follows the MVC architecture pattern and has robust features that accelerate web development. It supports DRY (Don't Repeat Yourself) design to eliminate redundancies and improve code readability. Yii has a web-based code generator called Gii that developers can use to generate models, controllers, forms, modules, extensions, and CRUD. This framework supports layered caching schemes such as data, page, HTTP, and fragment caching to improve the performance of web applications. Other features are unit and functionality testing, security measures, error handling and logging, easy integration with other frameworks, and more. 

Pros:

  • Its lightweight and advanced caching mechanism features make it ideal for large-scale applications that require high traffic. Examples are forums, CMS, portals, and e-commerce applications. 
  • It has excellent speed and performance.
  • The framework is highly extensible, allowing developers to customize every piece of a tailor-made code.
  • It has a large active community in various channels like Slack, GitHub repository, Internet Relay Chat, discussion forum, and social media platforms.
  • It has thorough documentation covering all parts of the framework, from installation to class references and application development.
  • It offers easy integration with other frameworks like PEAR or Laminas.

Cons:

  • It is difficult for beginners to use this framework as it requires a strong understanding of object-oriented programming.
  • Many features require additional configuration and installation.
  • Although it has thorough documentation, it may be complex and hard to understand.

Other Details

Gitstar: 13.7k+

Launched: December 2008

Latest stable version: 2.0.42 released in May 2021

Companies using Yii: General, Medicus AI, Fujitsu, Web stack, etc. 

Technical requirements:

  • PHP 7+
  • Install Composer (recommended). Alternatively, use an application template 
  • SQLite, MySQL, PostgreSQL, MSSQL, or Oracle databases.

Slim Framework

Just like its name suggests, Slim is a PHP microframework for developing powerful, small-scale web applications. It is lightweight, supports all HTTP methods (GET, POST, PUT, DELETE), and has Url routing and matching features. This makes it one of the best frameworks for building a REST API. Some other functionalities include dependency injection, middleware, error handling, and PSR-7 support. 

Pros:

  • The Slim framework is lightweight and fast.
  • It has a low learning curve and is ideal for both beginners and professionals.
  • It is excellent for small projects that do not require a full-stack framework.
  • Slim allows for seamless integration with first-party and third-party components for projects with more requirements.
  • It has well-written documentation that is easy to understand.

Cons:

  • It is not suitable for large projects.
  • It has a smaller community, making it hard to find solutions.

Other Details

Gitstar: 11k+

Launched: September 2010

Latest stable version: 4.8.0 released in May 2021

Companies using Slim: PathMotion, Directus, HHey, Coderus, and more.

Technical requirements:

  • PHP 7.2+
  • Web server with URL rewriting.

Phalcon 

Phalcon is an MVC-based PHP framework implemented as a web server written in Zephir and C, making it faster than other PHP frameworks. This framework is loosely coupled and enables developers to use all or specific components in isolation depending on their project requirements. Some of its features and functionalities include dependency injection, low memory consumption, templating engine, and security features that prevent password hashing and CSRF. 

Pros:

  • Phalcon is super fast because it is compiled rather than interpreted.  
  • It requires no core files, therefore, consumes less memory space.
  • This framework is easily customizable.

Cons:

  • Installation is complex, especially on shared hosting.
  • The documentation may be difficult for beginners. 

Other Details

Gitstar: 10.4k+

Launched: November 2012

Latest stable version: 4.0.6 released in May 2020

Companies using Phalcon: Edureka, Cargo, Proshore, Rentger, and many more.

Technical requirements:

  • PHP 7.2+
  • PSR extension
  • MySQL, PostgreSQL, and SQLite.

CakePHP

CakePHP is a free, open-source PHP framework that allows developers to build web applications rapidly. This framework supports the MVC pattern making it easier to build apps using fewer codes. It offers features like class inheritance, plugins, CRUD Scaffolding, built-in validation, auto-detect, templating engine, etc, that speed up development. It also has sophisticated security features that prevent SQL injection, cross-site scripting, cross-site request forgery, form tampering, etc.

Pros:

  • It is easy to install as it only requires a web server and the framework copy.
  • CakePHP is licensed under the MIT license and has advanced security features that make it more suitable for commercial projects.
  • Developers can simultaneously work on various models as all segments are independent.
  • This framework is sponsored commercially, which ensures the availability of long-term support and stability. 
  • It is based on conventions rather than configuration, making it possible for developers to develop prototypes faster.

Cons:

  • The community is smaller, and documentation is not as comprehensive as other frameworks. This makes it hard to find solutions. 
  • Access to expert support is available but paid. 
  • It has a slower response time and less performance when used for large projects. 

Other Details

Gitstar: 8.4k+

Launched: April 2005

Latest stable version: 4.2.2 released in January 2021

Companies using CakePHP: Deloitte, Swat.io, SeatGeek, Walls.io, and many more

Technical requirements:

  • PHP 7.2+
  • HTTP server with mod_rewrite preferred. Alternatives are nginx or Microsoft IIS.
  • Install Composer
  • Database support for MySQL 5.6+, MariaDB 5.6+, PostgreSQL 9.4+, SQLite 3, and Microsoft SQL Server 2012 or higher.

popular php frameworks in 2021

New Version Updates for PHP in 2021

As we mentioned earlier, there have been some updates on the PHP 8 version in 2021. These updates are mostly minor tweaks and improvements on syntax and bugs. Here are some of the bug fixes in each version update according to the PHP changelog: 

PHP 8.0.1

Released: January 7, 2021

 

Some fixed bugs: 

  • #80393: Failure of PHP extension to build due to configuration gap with libtool
  • #72964: Unfolded white space for CC/Bcc headers
  • #77069: Loss of final block of data in stream filter  
  • #80433: AVX command unable to be disabled when using JIT
  • #79872: Unable to execute query with pending result sets
  • #80447: "Out of memory" error when running with JIT
  • #62889: LOAD DATA INFILE broken
  • #75102: `PharData` says invalid checksum for valid tar
  • Regression in valid Unique IDs in imap_savebody().

PHP 8.0.2

Released: February 4, 2021

 

Some fixed bugs: 

  • #77565: Incorrect locator detection in ZIP-based phars
  • #80376: Last day of the month causes runway cpu usage
  • #80523: Bogus parse error on >4GB source code
  • #80596: Invalid union type TypeError in anonymous classes
  • #77935: Crash in mysqlnd_fetch_stmt_row_cursor when calling an SP with a cursor
  • #76813: Access violation near NULL on source operand
  • #80521: Parameters with underscores no longer recognized
  • #80584: filter_var() considers 0x and 0X as valid hex numbers.

PHP 8.0.3

Released: March 4, 2021

 

Some fixed bugs:

  • #75850: Unclear error message wrt. __halt_compiler() w/o semicolon) (cmb)
  • #80713: SegFault when disabling ATTR_EMULATE_PREPARES and MySQL 8.0
  • #53251: bindtextdomain with null dir doesn't return old value
  • #53467: Phar unable to compress large archives
  • #78680: mysqlnd's mysql_clear_password does not transmit null-terminated password
  • #80718: ext/standard/dl.c fallback code path with syntax error
  • #80742: Opcache JIT makes some boolean logic unexpectedly be true
  • #80747: Providing RSA key size < 512 generates key that crashes PHP.

PHP 8.0.4

Not released due to malicious commits in the PHP source code repository. 

PHP 8.0.5

Released April 29, 2021

 

Some fixed bugs:

  • #80800: imap_open() fails when the flags parameter includes CL_EXPUNGE
  • #80786: PHP crashes when using JIT
  • #80817: dba_popen() may cause segfault during RSHUTDOWN
  • #80763: msgfmt_format() does not accept DateTime references
  • #51903: simplexml_load_file() doesn't use HTTP headers
  • #79812: Potential integer overflow in pcntl_exec()
  • #80024: Duplication of info about inherited socket after pool removing
  • #80839: PHP problem with JIT
  • #78719: http wrapper silently ignores long Location headers.

PHP 8.0.6

Released: May 6, 2021

 

  • #80892: PDO::PARAM_INT is treated the same as PDO::PARAM_STR.

PHP 8.0.7

Released: June 3, 2021

 

Some fixed bugs include: 

  • #80460: ODBC does not account for SQL_NO_TOTAL indicator
  • #67792: HTTP Authorization schemes are treated as case-sensitive
  •  #79100: Wrong FTP error messages
  • #44643: Bound parameters ignore explicit type definitions
  • #81037: PDO discards error message text from prepared statement
  • #81019: Cannot clone NumberFormatter after failed parse()
  • #80972:Memory exhaustion on invalid string offset
  • #80901: Info leak in ftp extension.

 

See the PHP changelog for more bug fixes on each version release. 

 

Also, read up on PHP vs. Java to find out the best choice for web development.

 

php updates in 2021

Future Plans for PHP Development  

The recent PHP 8 version brought new major features like; the Just-in-time Compiler, Constructor Properties, and Named Parameters which opened up the language to new possibilities. 

 

Currently, an incoming version 8.1 is in the works. This version will be released on November 25, 2021, according to the PHP Development Team's timeline. Here are some of the expected features in the PHP 8.1 version:

  • Fibers 

Also known as green threads, fibers in PHP 8.1 are a low-level mechanism that allows you to build interruptible functions. With this feature, you can resume and pause functions within your program in isolation. Although this proposed feature will not be purely asynchronous in this version, it opens up this possibility in future versions. 

  • Enums

Enums assign names to a collection of constant values. Before this, PHP had no built-in enum type but instead relied on a basic SPL implementation. This addition offers a more structured way to show the status of objects. It will also generally reduce errors and make it easier to read programs. 

  • Inheritance Cache Improvement

PHP classes are compiled and cached separately and then linked at runtime on each request. The incoming Inheritance cache improvement eliminates this compilation overhead by linking a set of classes just once at first request and storing them in an Opcache shared memory. 

 

Other notable features are:

  • Array unpacking with string keys
  • New never type 
  • Final class constants
  • Restrict $GLOBALS usage
  • The resource to object migrations
  • New fsync function
  • Explicit octal integer literal notation, and many more. 

Is PHP a Good Choice in 2021? 

There are several programming languages with one or more having the same functionalities, close features, and best use cases. Although most developers believe that Python and JavaScript may edge out PHP, over 6,319,253 websites currently use it. Popular companies that use PHP in their tech stack include Wikipedia, Facebook, Tumblr, WordPress, Flickr, WhatsApp, and Slack. 

 

Also, as we mentioned earlier, nearly 8 out of 10 websites with a known server-side scripting language use PHP in one form or another. This number may be higher when you consider undetected websites that may use PHP. 

 

Generally, PHP is used for building web applications but is best suited for developing a WordPress website. This is because a substantial part of the WordPress core—including its themes and plugins—is written in PHP.

 

You don't need advanced knowledge of PHP to create simple WordPress sites. However, if you want to develop WordPress plugins and themes from scratch, or make advanced customizations and changes, using PHP gives you a better chance at creating a robust application. 

 

PHP's extensive features coupled with the growing demand for the user-friendly WordPress CMS make it a good choice for web development in 2021. 

 

Additional read: Python vs. PHP: Which Technology Will Dominate The Future Of Web Development?.

Summary

The current state of PHP shows that it is far from dead or dying. Instead, yearly releases usher in features that enable developers to build robust business-critical web applications and APIs for companies.  

 

Looking for PHP developers? Contact us today. We have a vast pool of PHP and other developers in our network. We will make sure to connect you with talents perfectly fitted for your industry and company culture.

Dawid Karczewski

Dawid is a full stack developer experienced in creating Ruby on Rails and React Native apps from naught to implementation. Technological superhero, delivering amazing solutions for our clients and helping them grow.

View all author posts

Looking for talented developers to build or scale your web product?

Our vetted experts are ready to join your team.

Hire Web Developers
Newsletter 9-1
Ideamotive Newsletter
Your bi-weekly collection of hottest tech news

Looking for PHP development experts to join your team?

There are dozens of vetted PHP professionals in our talent network.