PHP 8.5: What’s New and Changed (Upcoming Features & Deprecations)

PHP 8.5 is shaping up to be a feature-rich update that improves developer experience, debugging, and localization support. If you're using PHP 8.x already, these new additions will feel like thoughtful upgrades. Let’s break down what’s new, changed, and deprecated in PHP 8.5.

PHP 8.5: What’s New and Changed (Upcoming Features & Deprecations) Image

Expected Release Date: November 20, 2025
Current Status: In Alpha (8.5.0alpha1)
Perfect For: PHP developers eager to explore modern features and prepare codebases for the future.


New Features in PHP 8.5

1. Pipe Operator (|>)

A long-awaited feature, the pipe operator allows for functional-style programming by passing the result of one expression directly into the next function:

$value
    |> strtolower($$)
    |> trim($$);

✅ Improves readability and enables cleaner pipelines of transformations.


2. New curl_multi_get_handles() Function

Now you can retrieve all handles associated with a curl_multi session—making advanced HTTP requests and debugging easier.

$multi = curl_multi_init();
// add handles... $handles = curl_multi_get_handles($multi);

3. New PHP_BUILD_DATE Constant

Provides the build timestamp of the PHP binary:

echo PHP_BUILD_DATE;

🔍 Useful for debugging, testing, or ensuring you're running the right compiled version.


4. get_exception_handler() and get_error_handler() Functions

Finally, PHP developers can inspect currently set handlers programmatically.

$exceptionHandler = get_exception_handler();
$errorHandler = get_error_handler();

Helpful for debugging frameworks, custom error loggers, and exception flows.


5. Stack Trace for Fatal Errors

One of the biggest pain points in PHP is not knowing where a fatal error happened.
With PHP 8.5, fatal errors now come with stack traces, helping developers trace issues like:

  • Memory exhaustion
  • Maximum execution time
  • Non-recoverable errors

🛠 Debug faster. Sleep better.


6. New locale_is_right_to_left() Function & Locale::isRightToLeft() Method

Working with RTL (Right-to-Left) languages like Arabic or Hebrew? You can now detect RTL locales easily:

if (locale_is_right_to_left('ar')) {
    echo "RTL layout needed";
}

 Great for multilingual and internationalized applications.


7. New array_first() and array_last() Functions

No more writing custom logic to fetch the first or last element:

$first = array_first([10, 20, 30]); // 10 $last = array_last([10, 20, 30]);  // 30 

Clean and concise functional programming support continues.


8. CLI: php --ini=diff

Run this in your terminal:

php --ini=diff

It will show only modified INI settings, making it easier to track what’s changed from the defaults.


9. New IntlListFormatter Class

Improves international list formatting using the ICU library.

$formatter = new IntlListFormatter('en', IntlListFormatter::TYPE_CONJUNCTION);
echo $formatter->format(['Red', 'Green', 'Blue']); // "Red, Green, and Blue" 

💬 More human-friendly output for multilingual UIs.


Deprecations in PHP 8.5

MHASH_* Constants

All MHASH_* constants are now deprecated.

⛔ This includes constants like MHASH_MD5, MHASH_SHA1, etc.
✅ You should migrate to the hash() API with algorithms like 'sha256'.

// Instead of mhash(MHASH_SHA1, $data);

// Use hash('sha1', $data);

Wrapping Up

PHP 8.5 introduces clean, modern improvements while deprecating legacy parts of the language. If you're building robust apps, APIs, or enterprise-grade platforms, these updates will help you write cleaner, safer, and more maintainable code.

📌 Want to stay ahead? Start testing your app with the PHP 8.5 alpha build, especially if you use mhash, complex locales, or functional array operations.


Related Tools:

Tags

PHP

Do you Like?