DEV Community

Cover image for 🐘 PHP 8.5: 10 New Features, 4 Deprecations, and Why This Release Matters to Modern PHP Developers
Bhanu Pratap
Bhanu Pratap

Posted on

🐘 PHP 8.5: 10 New Features, 4 Deprecations, and Why This Release Matters to Modern PHP Developers

After two years of steady evolution, PHP is preparing to ship another major update β€” PHP 8.5, scheduled for release in November 2025.

As someone who builds production-grade applications daily, I see PHP 8.5 as a meaningful step forward. It isn’t as disruptive as the JIT introduction in PHP 8.0, but it brings a collection of practical improvements that enhance developer experience, safety, and performance. PHP continues its journey toward becoming a more expressive and modern language β€” while still keeping the clarity and pragmatism we rely on.

Here’s my breakdown of what’s new, what’s going away, and why this release is worth paying attention to.


⚑ 1. Asynchronous Signal Handling (pcntl_async_signals)

For developers working with long-running scripts, queue workers, or background tasks, this is a welcome upgrade.

pcntl_async_signals(true);
pcntl_signal(SIGTERM, fn() => exit("Terminated safely\n"));
Enter fullscreen mode Exit fullscreen mode

Why it matters:
PHP can now handle system signals asynchronously, without manually calling pcntl_signal_dispatch() in loops. Cleaner daemon code and safer shutdowns.


🧠 2. Property Hooks (get/set)

A huge quality-of-life improvement.

class User {
    public string $name {
        get => ucfirst($this->name);
        set => $this->name = trim($value);
    }
}
Enter fullscreen mode Exit fullscreen mode

Why it matters:
You no longer need __get() or __set() for simple transformations. This makes PHP feel more modern, similar to Swift and Kotlin.


🎯 3. Compact Attribute Syntax

PHP 8.5 allows multiple attributes in a single block:

#[ORM\Column, ORM\Id, ORM\GeneratedValue]
private int $id;
Enter fullscreen mode Exit fullscreen mode

Why it matters:
Classes with many attributes (Doctrine entities, Laravel models) become cleaner and more readable.


🧩 4. Native JSON Validation with json_validate()

Finally, a safe way to validate JSON before decoding.

if (json_validate($input)) {
    $data = json_decode($input, true);
}
Enter fullscreen mode Exit fullscreen mode

Why it matters:
Useful for APIs and data-heavy applications where malformed JSON can break flow.


πŸ•“ 5. DateTimeImmutable::createFromTimestamp()

$date = DateTimeImmutable::createFromTimestamp(1730982645);
Enter fullscreen mode Exit fullscreen mode

Why it matters:
A simple, intuitive way to convert timestamps β€” something that should have existed years ago.


🐒 6. Native Lazy Object Initialization

$report = new lazy(Report('/tmp/log.txt'));
Enter fullscreen mode Exit fullscreen mode

Why it matters:
Huge performance wins for classes with heavy constructors β€” particularly in frameworks like Laravel or Symfony.


🧭 7. Smarter Enums (Traits + Static Methods)

enum Status {
    use Loggable;
    case Active;
    case Inactive;

    public static function default(): self {
        return self::Active;
    }
}
Enter fullscreen mode Exit fullscreen mode

Why it matters:
Enums now behave more like real objects with shared logic.


βœ‚οΈ 8. New String Helpers: str_join() and str_split_by()

str_join(['foo', 'bar'], '-'); // 'foo-bar'
str_split_by('abcdef', 2);     // ['ab', 'cd', 'ef']
Enter fullscreen mode Exit fullscreen mode

Why it matters:
Cleaner, more descriptive alternatives to older helpers.


πŸ” 9. Functional Array Search: array_find() and array_find_key()

$user = array_find($users, fn($u) => $u['id'] === 42);
Enter fullscreen mode Exit fullscreen mode

Why it matters:
Removes a lot of boilerplate loops. Much more expressive.


πŸš€ 10. JIT v3 & Core Performance Improvements

The JIT engine gets another upgrade:

  • ~10–15% faster CPU-heavy execution
  • Better memory usage
  • Improved FPM stability

Why it matters:
JIT is finally reliable enough for production workloads.


⚠️ Deprecations & Removals

Here are four things PHP is phasing out:

1. Dynamic Properties β€” Fully Removed

No more creating properties on the fly.

2. mbstring.func_overload β€” Removed

A legacy feature finally retired.

3. utf8_encode() and utf8_decode() β€” Deprecated

Use mb_convert_encoding() instead.

4. assert() β€” Deprecated

Safer validation practices should replace it.


🧰 Compatibility Updates

  • Requires OpenSSL 3.0+
  • Better libcurl 8+ integration
  • PHP-FPM now supports JSON log mode β€” great for observability tools like Datadog or Loki.

🧭 Final Thoughts

PHP 8.5 is not a groundbreaking release β€” and it doesn’t need to be.
What it delivers is evolutionary improvement: better performance, cleaner syntax, modern language features, and removal of outdated quirks.

As someone working daily with Laravel, APIs, and backend workflows, these updates genuinely improve the developer experience.

If you want more updates like this on Laravel, PHP, and modern backend development, feel free to follow my page.

🧑🐘 Happy coding!

Top comments (0)