🐘 PHP: HYPERTEXT PREPROCESSOR 🐘
🐘PHP🐘
A POPULAR general-purpose scripting language that is ESPECIALLY SUITED to web development.
Fast, flexible and PRAGMATIC, PHP powers EVERYTHING from your blog to the most popular websites in the world!
🔥 BREAKING NEWS!!! 🔥
The PHP Foundation
The PHP Foundation is a COLLECTIVE of people and organizations united in the mission to ensure the long-term prosperity of the PHP language!
🎉 CONFERENCES!!! 🎉
CRAZY STATS!!!
WHAT'S NEW IN PHP 8.5!!!
Discover the POWERFUL new features that make PHP 8.5 more EXPRESSIVE, PERFORMANT, and DEVELOPER-FRIENDLY!!!
Clone with
Support for MODIFYING PROPERTIES while cloning objects with a more CONCISE SYNTAX!!!
final readonly class PhpVersion {
    public function __construct(
        public string $version = 'PHP 8.4',
    ) {}
    
    public function withVersion(
        string $version
    ): self {
        $newObject = clone $this;
        $newObject->version = $version;
        return $newObject;
    }
}
$version = new PhpVersion();
var_dump($version->version);
// string(7) "PHP 8.4"
var_dump($version
    ->withVersion('PHP 8.5')
    ->version);
// Fatal error: Cannot modify 
// readonly property!final readonly class PhpVersion {
    public function __construct(
        public string $version = 'PHP 8.4',
    ) {}
    
    public function withVersion(
        string $version
    ): self {
        return clone($this, [
            'version' => $version,
        ]);
    }
}
$version = new PhpVersion();
var_dump($version->version);
// string(7) "PHP 8.4"
var_dump($version
    ->withVersion('PHP 8.5')
    ->version);
// string(7) "PHP 8.5" ✨
var_dump($version->version);
// string(7) "PHP 8.4"🎉 BENEFITS: This new syntax allows modifying properties during cloning without requiring additional steps, making working with readonly classes more INTUITIVE and less ERROR-PRONE!!!
Pipe Operator
The Pipe operator provides a more READABLE WAY to chain function calls by passing the result of one expression as the first argument to the next function!!!
$input = ' Some kind of string. ';
$output = strtolower(
    str_replace(['.', '/', '…'], '',
        str_replace(' ', '-', 
            trim($input)
        )
    )
);
var_dump($output);
// string(19) "some-kind-of-string"
// SO CONFUSING!!! 😵$input = ' Some kind of string. ';
$output = $input
    |> trim(...)
    |> (fn($string) => 
        str_replace(' ', '-', $string))
    |> (fn($string) => 
        str_replace(['.', '/', '…'], '', 
        $string))
    |> strtolower(...);
var_dump($output);
// string(19) "some-kind-of-string"
// SO READABLE!!! 🎉🚀 BENEFITS: The Pipe operator makes code more READABLE and easier to understand by clearly showing the data flow from one operation to the next, reducing NESTED FUNCTION CALLS!!!
New #[\NoDiscard] Attribute
The #[\NoDiscard] attribute ensures that the return value of a function is either USED or INTENTIONALLY IGNORED, helping prevent BUGS where return values are accidentally ignored!!!
function getPhpVersion(): string {
    return 'PHP 8.4';
}
getPhpVersion(); 
// No Errors - But you forgot 
// to use the return value!!! 😱
// DANGEROUS!!!#[\NoDiscard]
function getPhpVersion(): string {
    return 'PHP 8.5';
}
getPhpVersion();
// Warning: The return value of 
// function getPhpVersion() should 
// either be used or intentionally 
// ignored by casting it as (void)
// SAFE!!! 🛡️🛡️ BENEFITS: This attribute helps catch potential BUGS where function return values are accidentally ignored, improving code RELIABILITY and MAINTAINABILITY!!!
New URI Extension
RFC 3986 and WHATWG URL compliant API with new classes like Uri\Rfc3986\Uri and Uri\WhatWg\Url!!!
array_first() & array_last()
Simplified array element retrieval with new BUILT-IN FUNCTIONS for common operations!!! Finally!!!
Additional Enhancements
Property Promotion for final classes, Attributes for constants, #[\Override] for properties, and MORE!!!
PHP 8.5 IS COMING SOON!!!
Get ready for the MOST EXCITING PHP release EVER!!!
PHP.NET - THE MOST EXCITING WEBSITE ON THE INTERNET!!!
© 2025 The PHP Group • All Rights Reserved • Powered by PURE PHP ENERGY!!!