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

-10%

CPU
CPU
3 Epyc Cores
RAM
RAM
2 GB
Space
Space
25 GB NVMe
Bandwidth
Bandwidth
Unlimited
wKVM-NVMe 2048 Windows

9.9 /mo

/mo

Billed annually

-10%

CPU
CPU
6 Epyc Cores
RAM
RAM
16 GB
Space
Space
150 GB NVMe
Bandwidth
Bandwidth
Unlimited
KVM-NVMe 16384 Linux

50.49 /mo

/mo

Billed annually

-4.8%

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

10.26 /mo

/mo

Billed annually

-10%

CPU
CPU
6 Xeon Cores
RAM
RAM
16 GB
Space
Space
150 GB SSD
Bandwidth
Bandwidth
Unlimited
KVM-SSD 16384 Linux

49.99 /mo

/mo

Billed annually

-10%

CPU
CPU
8 Epyc Cores
RAM
RAM
32 GB
Space
Space
200 GB NVMe
Bandwidth
Bandwidth
Unlimited
KVM-NVMe 32768 Linux

70.49 /mo

/mo

Billed annually

-10%

CPU
CPU
6 Epyc Cores
RAM
RAM
16 GB
Space
Space
150 GB NVMe
Bandwidth
Bandwidth
Unlimited
Keitaro KVM 16384
OS
CentOS
Software
Software
Keitaro

55.54 /mo

/mo

Billed annually

-15.3%

CPU
CPU
4 Xeon Cores
RAM
RAM
2 GB
Space
Space
75 GB SSD
Bandwidth
Bandwidth
40 Mbps
DDoS Protected SSD-wKVM 2048 Windows

54 /mo

/mo

Billed annually

-15.4%

CPU
CPU
4 Xeon Cores
RAM
RAM
4 GB
Space
Space
100 GB SSD
Bandwidth
Bandwidth
60 Mbps
DDoS Protected SSD-wKVM 4096 Windows

73 /mo

/mo

Billed annually

-10%

CPU
CPU
6 Xeon Cores
RAM
RAM
8 GB
Space
Space
200 GB HDD
Bandwidth
Bandwidth
300 Gb
KVM-HDD HK 8192 Linux

20.43 /mo

/mo

Billed annually

-21.5%

CPU
CPU
2 Xeon Cores
RAM
RAM
2 GB
Space
Space
75 GB SSD
Bandwidth
Bandwidth
300 GB
wKVM-SSD 2048 HK Windows

26 /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.