Menu

Post image 1
Post image 2
1 / 2
0

What’s New in PHP 8.5

DEV Community·Stevie G·19 days ago
#JuAANQcc
#why#php#before#example#fullscreen#useful
Reading 0:00
15s threshold

PHP 8.5 is here, and while it may not feel quite as dramatic as PHP 8.4’s property hooks and asymmetric visibility, it brings some excellent quality-of-life improvements for everyday PHP developers. This release focuses on cleaner code, safer APIs, better debugging, improved URL handling, and small but useful syntax improvements. In this article, we’ll look at the most important PHP 8.5 features with simple examples. 1. The New Pipe Operator One of the biggest additions in PHP 8.5 is the new pipe operator: |> . The pipe operator lets you pass the result of one expression into the next function, making transformation code easier to read from left to right. Before PHP 8.5 $title = ' PHP 8.5 Released ' ; $slug = strtolower ( str_replace ( '.' , '' , str_replace ( ' ' , '-' , trim ( $title ) ) ) ); echo $slug ; Enter fullscreen mode Exit fullscreen mode PHP 8.5 $title = ' PHP 8.5 Released ' ; $slug = $title |> trim ( ...…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.

Read More