Review and look forward to the development of PHP in 2023!
Introduction: Starting as a personal project in the mid-1990s, PHP has grown into one of the most popular web development languages, serving small and medium-sized developers. Supporting everything from blogs to large enterprise applications.
PHP This language has experienced amazing iterative changes in the past 30 years. Over the past 10 years, PHP has changed in ways we couldn't have imagined.
Every New Year I will write an article about the current situation of PHP, looking back and looking forward to the future. Let's start now!
PHP Foundation
In the past, I usually started with a summary of the latest PHP version. However, this time I want to focus on PHP Foundation first.
It has been more than a year since the PHP Foundation was established. It consists of a team of 10 volunteers plus 6 developers. Get paid to work on the PHP language.
Last year, I wrote this:
Now that Nikita (a kernel developer) has left, I am a little worried. But he's definitely not the only one able to work on core PHP, he's done a lot of work on PHP 8.0 and 8.1 over the past few years.
I hope the PHP Foundation can catch up soon and have enough core developers free to work on PHP within the next year.
PHP 8.2 is already in development, although not many RFCs have been drafted yet.
I wouldn’t be wrong to think that 2022 will not be the most exciting year for PHP, but rather a year of increased stability.
I think it's fair to say that the PHP Foundation is now functioning properly. They recently released their 2022 report, which shows a pretty impressive set of numbers:
$580,000 raised in 2022
Foundation 6 developers will be paid for work on the PHP core
Foundation members completed nearly half of the commits in php-src
They created 8 new RFCs, only one of which failed
I think the PHP Foundation is one of the best things to happen to PHP. I hope they improve the language further in 2023. If you work for a company that uses PHP, I highly recommend you consider donating some.
PHP 8.2
Let’s talk about using PHP 8.2. It's often considered a smaller version by developers, but it actually has a lot of nice features.
Here are a few examples:
ReadOnly class (ReadOnly):
readonly class PostData { public function __construct( public string $title, public string $author, public string $body, public DateTimeImmutable $createdAt, public PostState $state, ) {} }
New random generator:
$rng = $is_production ? new Random\Engine\Secure() : new Random\Engine\Mt19937(1234); $randomizer = new Random\Randomizer($rng); $randomizer->shuffleString('foobar');
True and false independent of null:
function alwaysFalse(): false { return false; }
Disjunctive normal form type:
function generateSlug((HasTitle&HasId)|null $post) { /* … */ } 编辑参数: function connect( string $user, #[\SensitiveParameter] string $password ) { // … }
Of course, there are more, worth exploring.
Consider how crazy PHP has grown over the years. I did some comparisons and the differences are clearly shown below:
Ecosystem
Like every year, I should mention Packagist, which is PHP’s package manager, so far this year it lists 361,000 packages, 60,000 more than last year:
Well, by the way, recently Packagist passed the milestone of processing over 50 billion installations. Congratulations Packagist!I just checked and Packagist’s current installation volume is 74,492,061,634 times. That’s 24 billion installs in a year and 2 billion monthly installs. To sum up: the PHP ecosystem is growing rapidly. Twice a year, I publish version statistics. In these posts, I analyze PHP version usage across the community based on data from Packagist. I'd like to share the chart from that post again: a timeline from 2013 to the present, showing the usage history of each version.
This data beautifully visualizes the division within the PHP community: one part keeps pace with modern PHP, while the other part is helplessly left behind.
When it comes to upgrading, I want to mention one tool in particular: Rector.
Rector is a free automation tool that helps upgrade your PHP code base. All it requires is a small amount of configuration and it does a lot of the work for you.
I recently used it to update my community-driven content aggregator, Aggregate to PHP 8.2, and it was really fun and easy to use.
After posting my version stats post, several people told me that they hadn't updated yet and were stuck on PHP 7.*, and I asked them why? They told me it was just too much manual labor. Interestingly, no one has even tried to use tools like Rector to help them...
I firmly believe that a "programming language" is more than just a compiler: it plays an equal role in defining a "programming language" Tools and ecosystem, I really think a lot of people, projects, and businesses would benefit if they looked into using an automation tool like Rector.
Since I’m talking about the ecosystem, I can’t help but mention the two largest frameworks for PHP: Laravel and Symfony.
Laravel has grown tremendously over the past few years. They now employ 8 full-time developers to develop the framework and its ecosystem. On top of that, JetBrains’ Development Survey reports that 67% of PHP developers use Laravel.
While Symfony may be less popular as a framework today compared to Laravel, it is still one of the most mature and stable frameworks in the PHP community. It's more commonly used for enterprise application development, but its standalone components are popular throughout the PHP ecosystem - Laravel also has some dependencies on Symfony components, so it's not surprising that many Symfony packages make it onto Packagist's top packages list No surprise.
I should also mention WordPress. To be honest, I have a love-hate relationship with WordPress. As a user, WordPress is great. It's so simple to install and use, and I think it's earned every ounce of popularity over the years. As a developer, though, WordPress makes me sad. The inability to keep up with modern and secure PHP versions casts a pall over the entire PHP community.
Currently, WordPress only provides beta support for PHP 8.0. Now, to be clear: PHP 8.0 was released in 2020 and reached end of life 3 years later - and WordPress doesn't support it yet... Of course, not properly supporting newer PHP versions is There are reasons, and it should be up to the user to decide whether they are correct. My personal opinion is that the decision to insist on backwards compatibility like WordPress is primarily business driven: a large part of WordPress is the commercial part, and a large part of their customer base runs older PHP versions. It's a vicious cycle, with both sides hindering each other and, to a certain extent, hindering the development of the entire PHP community.
On the other hand, we should recognize the fact that after almost 20 years, not many software projects are as popular and relevant as WordPress, so maybe their strategy regarding backwards compatibility is correct ?
Super EpisodeFinally, I can’t help but mention my long-term dream for PHP.
I'm writing it now, and I hope it will one day become a reality: a superset of PHP, with proper IDE and static analyzer support.
There are many reasons why I hope it happens. You can read and listen to them if you want, but I really hope it becomes a reality. It will be some time before we see a widely accepted and supported superset in 2023, but some small steps have already begun. I'll definitely be keeping an eye on PXP, it will push things in a more right direction.
To sum up, I feel that all developers will love 2023! One final note, just in case you're new here, I'm Brent, a developer evangelist at JetBrains.
Note: The original English address is: https://stitcher.io/blog/php-in-2023

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics











JWT is an open standard based on JSON, used to securely transmit information between parties, mainly for identity authentication and information exchange. 1. JWT consists of three parts: Header, Payload and Signature. 2. The working principle of JWT includes three steps: generating JWT, verifying JWT and parsing Payload. 3. When using JWT for authentication in PHP, JWT can be generated and verified, and user role and permission information can be included in advanced usage. 4. Common errors include signature verification failure, token expiration, and payload oversized. Debugging skills include using debugging tools and logging. 5. Performance optimization and best practices include using appropriate signature algorithms, setting validity periods reasonably,

A string is a sequence of characters, including letters, numbers, and symbols. This tutorial will learn how to calculate the number of vowels in a given string in PHP using different methods. The vowels in English are a, e, i, o, u, and they can be uppercase or lowercase. What is a vowel? Vowels are alphabetic characters that represent a specific pronunciation. There are five vowels in English, including uppercase and lowercase: a, e, i, o, u Example 1 Input: String = "Tutorialspoint" Output: 6 explain The vowels in the string "Tutorialspoint" are u, o, i, a, o, i. There are 6 yuan in total

Static binding (static::) implements late static binding (LSB) in PHP, allowing calling classes to be referenced in static contexts rather than defining classes. 1) The parsing process is performed at runtime, 2) Look up the call class in the inheritance relationship, 3) It may bring performance overhead.

What are the magic methods of PHP? PHP's magic methods include: 1.\_\_construct, used to initialize objects; 2.\_\_destruct, used to clean up resources; 3.\_\_call, handle non-existent method calls; 4.\_\_get, implement dynamic attribute access; 5.\_\_set, implement dynamic attribute settings. These methods are automatically called in certain situations, improving code flexibility and efficiency.

PHP and Python each have their own advantages, and choose according to project requirements. 1.PHP is suitable for web development, especially for rapid development and maintenance of websites. 2. Python is suitable for data science, machine learning and artificial intelligence, with concise syntax and suitable for beginners.

PHP is widely used in e-commerce, content management systems and API development. 1) E-commerce: used for shopping cart function and payment processing. 2) Content management system: used for dynamic content generation and user management. 3) API development: used for RESTful API development and API security. Through performance optimization and best practices, the efficiency and maintainability of PHP applications are improved.

PHP is a scripting language widely used on the server side, especially suitable for web development. 1.PHP can embed HTML, process HTTP requests and responses, and supports a variety of databases. 2.PHP is used to generate dynamic web content, process form data, access databases, etc., with strong community support and open source resources. 3. PHP is an interpreted language, and the execution process includes lexical analysis, grammatical analysis, compilation and execution. 4.PHP can be combined with MySQL for advanced applications such as user registration systems. 5. When debugging PHP, you can use functions such as error_reporting() and var_dump(). 6. Optimize PHP code to use caching mechanisms, optimize database queries and use built-in functions. 7

PHP is still dynamic and still occupies an important position in the field of modern programming. 1) PHP's simplicity and powerful community support make it widely used in web development; 2) Its flexibility and stability make it outstanding in handling web forms, database operations and file processing; 3) PHP is constantly evolving and optimizing, suitable for beginners and experienced developers.