News: 1754644510

  ARM Give a man a fire and he's warm for a day, but set fire to him and he's warm for the rest of his life (Terry Pratchett, Jingo)

After 30 years PHP still evolving: Team adds pipe operator, considers generics

(2025/08/08)


The PHP team is considering adding a partial implementation of generics to the language, has confirmed that a pipe operator will be in the forthcoming 8.5 release, and has formally adopted the FrankenPHP app server into the PHP Foundation.

PHP, which originally stood for Personal Home Page, was first released by inventor Rasmus Lerdorf in June 1995. 30 years on, its usage is growing, it powers [1]more than 70 percent of websites using server-side programming (largely thanks to WordPress and other content-management systems), and the language is acquiring major new features.

Last month the PHP Foundation reported on the [2]introduction of the pipe operator in PHP 8.5, expected in November. The operator will be represented as |> and will pass the value on the left hand side to become an argument to a function on the right hand side. This can be chained to form a pipeline, enabling concise programming that is more readable than nested parentheses. The pipe operator in PHP 8.5 is similar to that in F#.

[3]

According to the post from Larry Garfield, a member of the PHP-FIG (framework interop group) core committee, the work on the pipe operator may also enable partial function applications, another common feature in functional programming languages such as F#.

[4]

[5]

The latest news is that [6]compile-time generics are under consideration, though only on interfaces and abstract classes, with a request to the community for feedback. The response so far is mixed, with a highly [7]upvoted comment that a partial implementation of generics would mean that "PHP will be stuck forever with half-baked feature that, arguably, doesn't even cover 50 percent of its usage."

It is already possible to simulate generics using [8]PHPStan or [9]Psalm , widely used static analysis tools that support templated annotations.

[10]

Another recent PHP development is that the [11]FrankenPHP application server has been adopted by the PHP Foundation, which supports PHP development, and is now [12]part of the official PHP organisation on GitHub. FrankenPHP is written in Go and combines the PHP executor with the [13]Caddy web server, achieving better performance for PHP applications as well as Caddy benefits such as automatic TLS certificates.

The initial success of PHP was driven by its simplicity as a dynamically typed language, and the fact that every web host offered it, making it a favorite for hobbyist and small business developers. PHP can still be used in an undisciplined manner, but modern PHP has added features such as steadily improved [14]strict typing and a JIT (just-in-time) compiler, available since PHP 8.0 in 2020.

[15]30 years of MySQL, the database that changed the world

[16]American coders are most likely to use AI

[17]How Java changed the development landscape entirely as code turns 30

[18]A new Lazarus arises – for the fourth time – for Pascal programming fans

PHP usage is at 18.9 percent overall and 19.1 percent for professional developers, according to a recent StackOverflow survey, fractionally up year on year. The most popular PHP framework (WordPress aside) is [19]Laravel , with 8.9 percent usage (across all technologies), up from 7.9 percent in 2024.

PHP is still not the most elegant of languages, and it suffers from the fact that many websites use old versions: [20]according to w3techs 48.1 percent of websites still use PHP 7 and over 10 percent PHP 5, for which support ended 6 years ago, though we would guess that many of these sites are tiny or abandoned.

Nevertheless, like Ruby on Rails and Python-based web frameworks, PHP may be benefiting from developers disillusioned with the notion of JavaScript or TypeScript everywhere. ®

Get our [21]Tech Resources



[1] https://w3techs.com/technologies/overview/programming_language

[2] https://thephp.foundation/blog/2025/07/11/php-85-adds-pipe-operator/

[3] https://pubads.g.doubleclick.net/gampad/jump?co=1&iu=/6978/reg_software/front&sz=300x50%7C300x100%7C300x250%7C300x251%7C300x252%7C300x600%7C300x601&tile=2&c=2aJXKtDAeBIxAZGLNCQR7dQAAAFY&t=ct%3Dns%26unitnum%3D2%26raptor%3Dcondor%26pos%3Dtop%26test%3D0

[4] https://pubads.g.doubleclick.net/gampad/jump?co=1&iu=/6978/reg_software/front&sz=300x50%7C300x100%7C300x250%7C300x251%7C300x252%7C300x600%7C300x601&tile=4&c=44aJXKtDAeBIxAZGLNCQR7dQAAAFY&t=ct%3Dns%26unitnum%3D4%26raptor%3Dfalcon%26pos%3Dmid%26test%3D0

[5] https://pubads.g.doubleclick.net/gampad/jump?co=1&iu=/6978/reg_software/front&sz=300x50%7C300x100%7C300x250%7C300x251%7C300x252%7C300x600%7C300x601&tile=3&c=33aJXKtDAeBIxAZGLNCQR7dQAAAFY&t=ct%3Dns%26unitnum%3D3%26raptor%3Deagle%26pos%3Dmid%26test%3D0

[6] https://thephp.foundation/blog/2025/08/05/compile-generics/

[7] https://www.reddit.com/r/PHP/comments/1mhe7qf/compile_time_generics_yay_or_nay/n6ww3f1/

[8] https://phpstan.org

[9] https://psalm.dev

[10] https://pubads.g.doubleclick.net/gampad/jump?co=1&iu=/6978/reg_software/front&sz=300x50%7C300x100%7C300x250%7C300x251%7C300x252%7C300x600%7C300x601&tile=4&c=44aJXKtDAeBIxAZGLNCQR7dQAAAFY&t=ct%3Dns%26unitnum%3D4%26raptor%3Dfalcon%26pos%3Dmid%26test%3D0

[11] https://devclass.com/2024/05/30/frankenphp-and-caddy-double-performance-claims-caddy-creator-but-only-some-apps-benefit/

[12] https://github.com/php/frankenphp

[13] https://caddyserver.com

[14] https://www.php.net/manual/en/language.types.declarations.php

[15] https://www.theregister.com/2025/05/06/30_years_mysql/

[16] https://www.theregister.com/2025/06/19/us_coders_lead_world_in_ai/

[17] https://www.theregister.com/2025/05/23/30_years_ago_java_arrived/

[18] https://www.theregister.com/2025/05/09/new_lazarus_4/

[19] https://laravel.com

[20] https://w3techs.com/technologies/details/pl-php

[21] https://whitepapers.theregister.com/



"PHP will be stuck forever with half-baked feature"

ovation1357

I got really excited at the prospect of PHP introducing support for ENUMs a few years back but sadly this was a big disappointment and something which is half-baked too in my opinion..

I was expecting to be able to able to define a simple ordered list like:

enum Position { FIRST, SECOND, THIRD }

And do comparisons such as:

If $position == Positions::SECOND

or

If $position > Positions::FIRST

But in reality there's no automatic enumeration and it's really just a glorified class in disguise, much like all the hacky class-based workarounds we've been using for years.

E.g.

enum Position { FIRST = 1, SECOND = 2, THIRD = 3 }

Then the ugly syntax of:

If $position == Positions::SECOND->value

I'm still craving "proper" ENUMs on a daily basis and i almost wish they simply hadn't added them rather than this half-baked hack.

In spite of this I actually rather like PHP and I think it gets a lot of very unjustified hated... The team behind it has put in immeasurable amounts of time to improve both the language and the runtime which has taken it from being purely interpreted to JIT-compiled and including a helpful level of type safety.

Over the years they've done a lot to try and get away from some of the issues that famously made people sneer at it, such as the bad old days where variables defaulted to having a global scope.

In this case I'm with the nay sayers regarding genetics. I used them extensively in a C# project years ago and they were extremely useful but i think that unless the language can support a full implementation then it's best left without them.

NOWPRINT. NOWPRINT. Clemclone, back to the shadows again.
-- The Firesign Theater