PHP 8.5 is here

Experience the next generation of PHP with enhanced performance, improved developer experience, and powerful new features.

Download the latest version of PHP 8.5 for your platform

PHP Logo

What's New in PHP 8.5

pipe-operator.php
// Before: Nested function calls
$result = array_filter(
    array_map(
        fn($x) => $x * 2,
        [1, 2, 3, 4, 5]
    ),
    fn($x) => $x > 5
);

// After: Clean pipe operator
$result = [1, 2, 3, 4, 5]
    |> array_map(fn($x) => $x * 2, $$)
    |> array_filter($$, fn($x) => $x > 5);

Pipe Operator (|>)

Transform your code into a readable, left-to-right flow. The pipe operator eliminates nested function calls and makes data transformations crystal clear.

Learn more →

Array First & Last Functions

Get the first or last element of an array without worrying about empty arrays or resetting internal pointers. Clean, safe, and intuitive.

Learn more →
array-helpers.php
$numbers = [10, 20, 30, 40, 50];

// Get first element
$first = array_first($numbers);
// Returns: 10

// Get last element
$last = array_last($numbers);
// Returns: 50

// Safe for empty arrays
$empty = array_first([]);
// Returns: null
error-handlers.php
// Get current exception handler
$handler = get_exception_handler();

if ($handler !== null) {
    echo "Handler is set";
}

// Get current error handler
$errorHandler = get_error_handler();

// Perfect for debugging and testing
assert($errorHandler !== null);

Get Exception & Error Handlers

Inspect currently registered exception and error handlers. Essential for debugging, testing, and understanding your application's error handling flow.

Learn more →

RTL Locale Detection

Automatically detect right-to-left languages for proper text rendering. Build truly international applications with ease.

Learn more →
rtl-detection.php
// Check if locale is right-to-left
$isRTL = locale_is_right_to_left('ar_AE');
// Returns: true (Arabic)

$isRTL = locale_is_right_to_left('he_IL');
// Returns: true (Hebrew)

$isRTL = locale_is_right_to_left('en_US');
// Returns: false (English)

// Also available as OOP method
Locale::isRightToLeft('ar_AE');

And much more...

  • curl_multi_get_handles() - Get all handles from a multi handle
  • PHP_BUILD_DATE - New constant for PHP build timestamp
  • Stack traces for fatal errors - Better debugging information
  • php --ini=diff - Show only non-default INI directives
  • IntlListFormatter - Format lists according to locale rules
  • max_memory_limit - Set a ceiling for memory_limit directive
View all features

Download PHP 8.5

Ready to upgrade?

Get the latest version of PHP with all the new features and improvements. Available for all major platforms and architectures.

  • Windows (x64, x86)
  • Linux (x64, ARM64)
  • macOS (Intel, Apple Silicon)
  • Source code available

Migration Guide

Upgrading from PHP 8.4

PHP 8.5 maintains excellent backward compatibility while introducing new features. Most applications will work without changes.

Join the Community

Get support, share your experience, and contribute to the PHP ecosystem.