RFC

PHP < 8.4
setLanguageCode($languageCode); $this->setCountryCode($countryCode); } public function getLanguageCode(): string { return $this->languageCode; } public function setLanguageCode(string $languageCode): void { $this->languageCode = $languageCode; } public function getCountryCode(): string { return $this->countryCode; } public function setCountryCode(string $countryCode): void { $this->countryCode = strtoupper($countryCode); } public function setCombinedCode(string $combinedCode): void { [$languageCode, $countryCode] = explode('_', $combinedCode, 2); $this->setLanguageCode($languageCode); $this->setCountryCode($countryCode); } public function getCombinedCode(): string { return \sprintf("%s_%s", $this->languageCode, $this->countryCode); } } $brazilianPortuguese = new Locale('pt', 'br'); var_dump($brazilianPortuguese->getCountryCode()); // BR var_dump($brazilianPortuguese->getCombinedCode()); // pt_BR PHP ); ?>
PHP 8.4
countryCode = strtoupper($countryCode); } } public string $combinedCode { get => \sprintf("%s_%s", $this->languageCode, $this->countryCode); set (string $value) { [$this->countryCode, $this->languageCode] = explode('_', $value, 2); } } public function __construct(string $languageCode, string $countryCode) { $this->languageCode = $languageCode; $this->countryCode = $countryCode; } } $brazilianPortuguese = new Locale('pt', 'br'); var_dump($brazilianPortuguese->countryCode); // BR var_dump($brazilianPortuguese->combinedCode); // pt_BR PHP ); ?>

RFC

PHP < 8.4
version; } public function increment(): void { [$major, $minor] = explode('.', $this->version); $minor++; $this->version = "{$major}.{$minor}"; } } PHP ); ?>
PHP 8.4
version); $minor++; $this->version = "{$major}.{$minor}"; } } PHP ); ?>

RFC

PHP < 8.4
getVersion(); } public function getVersion(): string { return '8.3'; } } $phpVersion = new PhpVersion(); // No indication that the method is deprecated. echo $phpVersion->getPhpVersion(); PHP ); ?>
PHP 8.4
getVersion(); } public function getVersion(): string { return '8.4'; } } $phpVersion = new PhpVersion(); // Deprecated: Method PhpVersion::getPhpVersion() is deprecated since 8.4, use PhpVersion::getVersion() instead echo $phpVersion->getPhpVersion(); PHP ); ?>

RFC RFC

PHP < 8.4
loadHTML( <<<'HTML'
PHP 8.4 is a feature-rich release!
HTML, LIBXML_NOERROR, ); $xpath = new DOMXPath($dom); $node = $xpath->query(".//main/article[not(following-sibling::*)]")[0]; $classes = explode(" ", $node->className); // Simplified var_dump(in_array("featured", $classes)); // bool(true) PHP ); ?>
PHP 8.4
PHP 8.4 is a feature-rich release!
HTML, LIBXML_NOERROR, ); $node = $dom->querySelector('main > article:last-child'); var_dump($node->classList->contains("featured")); // bool(true) PHP ); ?>

RFC

PHP < 8.4
0); // false PHP ); ?>
PHP 8.4
$num2); // false PHP ); ?>

RFC

PHP < 8.4
PHP 8.4
str_starts_with($value, 'c'), ); var_dump($animal); // string(3) "cat" PHP ); ?>

RFC

PHP < 8.4
sqliteCreateFunction( 'prepend_php', static fn ($string) => "PHP {$string}", ); $connection->query('SELECT prepend_php(version) FROM php'); PHP ); ?>
PHP 8.4
createFunction( 'prepend_php', static fn ($string) => "PHP {$string}", ); // Does not exist on a mismatching driver. $connection->query('SELECT prepend_php(version) FROM php'); PHP ); ?>

RFC

PHP < 8.4
getVersion()); PHP ); ?>
PHP 8.4
getVersion()); PHP ); ?>