PHP 8.5: New Features and Exciting Changes You Need to Know

watch 1m, 40s
views 2

14:44, 20.11.2025

Article Content
arrow

  • Pipe Operator: Streamlining Your Code
  • New Attributes and Enhancements for Better Code Control
  • Modernizing the PHP Ecosystem

PHP 8.5 has just been released, bringing new features and some compatibility-breaking changes. If you’re a PHP developer, this update is something you won’t want to miss. Let’s take a closer look at the new tools and improvements in this version.

Pipe Operator: Streamlining Your Code

One of the most anticipated additions is the new pipe operator (|>). This allows you to pass values directly from one function to another without the need for intermediate variables or assignments. If you’ve ever wanted cleaner and more readable code, this feature is a game-changer. The pipe operator makes it easy to chain functions, enhancing your workflow by passing output directly into the next function. If a function takes a single argument, you can use the ...syntax to pass values directly. For functions with multiple arguments, closures help you manage how values are assigned.

New Attributes and Enhancements for Better Code Control

PHP 8.5 introduces the #[NoDiscard] attribute, ensuring that the return values of certain functions are always used. If a value is ignored, you’ll get a warning, which can help prevent unexpected issues in your code. Additionally, you can now use closures and first-class callables in constant expressions—this was not allowed in earlier versions. Marking these closures as static ensures that they don’t reference external variables, keeping your code more predictable and manageable.

Modernizing the PHP Ecosystem

Other updates include useful functions like array_first() and array_last() for easily accessing the first and last elements of an array. The addition of a URI module simplifies URL parsing, and the Exif module now supports HEIF and HEIC image formats. These changes, along with other minor improvements, bring PHP closer to modern web development needs.

As you explore PHP 8.5, keep in mind that several outdated features have been deprecated. The removal of support for certain syntax and functions will push developers to adopt cleaner, more efficient coding practices. This release is another step forward for PHP, making it a more powerful and flexible language for your projects.

Share

Was this article helpful to you?

VPS popular offers

-16.3%

CPU
CPU
4 Xeon Cores
RAM
RAM
2 GB
Space
Space
30 GB SSD
Bandwidth
Bandwidth
40 Mbps
DDoS Protected SSD-KVM 2048 Linux

48 /mo

/mo

Billed annually

-10%

CPU
CPU
4 Xeon Cores
RAM
RAM
8 GB
Space
Space
100 GB SSD
Bandwidth
Bandwidth
Unlimited
10Ge-KVM-SSD 8192 Linux

115.5 /mo

/mo

Billed annually

-8.1%

CPU
CPU
4 Epyc Cores
RAM
RAM
4 GB
Space
Space
50 GB NVMe
Bandwidth
Bandwidth
Unlimited
wKVM-NVMe 4096 Windows

31.9 /mo

/mo

Billed annually

-10%

CPU
CPU
2 Epyc Cores
RAM
RAM
1 GB
Space
Space
10 GB NVMe
Bandwidth
Bandwidth
Unlimited
KVM-NVMe 1024 Linux

7.2 /mo

/mo

Billed annually

-10%

CPU
CPU
4 Xeon Cores
RAM
RAM
2 GB
Space
Space
30 GB SSD
Bandwidth
Bandwidth
Unlimited
KVM-SSD 2048 Linux

8.3 /mo

/mo

Billed annually

-7.4%

CPU
CPU
4 Xeon Cores
RAM
RAM
4 GB
Space
Space
100 GB SSD
Bandwidth
Bandwidth
Unlimited
wKVM-SSD 4096 Windows

23.1 /mo

/mo

Billed annually

-10%

CPU
CPU
3 Xeon Cores
RAM
RAM
1 GB
Space
Space
20 GB SSD
Bandwidth
Bandwidth
Unlimited
KVM-SSD 1024 Linux

6.6 /mo

/mo

Billed annually

-20.8%

CPU
CPU
6 Xeon Cores
RAM
RAM
16 GB
Space
Space
150 GB SSD
Bandwidth
Bandwidth
10 TB
wKVM-SSD 16384 Metered Windows

100 /mo

/mo

Billed annually

-4.7%

CPU
CPU
3 Xeon Cores
RAM
RAM
1 GB
Space
Space
40 GB HDD
Bandwidth
Bandwidth
300 Gb
wKVM-HDD HK 1024 Windows

10.38 /mo

/mo

Billed annually

-10%

CPU
CPU
3 Xeon Cores
RAM
RAM
1 GB
Space
Space
40 GB HDD
Bandwidth
Bandwidth
300 Gb
KVM-HDD HK 1024 Linux

4.99 /mo

/mo

Billed annually

Other articles on this topic

cookie

Accept cookies & privacy policy?

We use cookies to ensure that we give you the best experience on our website. If you continue without changing your settings, we'll assume that you are happy to receive all cookies on the HostZealot website.