| ▲ | Cthulhu_ 4 hours ago | |||||||
And a pipe operator, which is also being discussed in a number of other languages. | ||||||||
| ▲ | senfiaj 2 hours ago | parent [-] | |||||||
It seems that pipe operator was introduced largely because PHP arrays and strings don't have "methods". You can't write something in "OOP" style: "some_string"->str_replace("some", "replacement")->strtoupper(). With PHPs array / string procedural way writing such chains is much bulkier. Pipe operator will somewhat reduce the boilerplate, but the native "OOP" style is still much better. Although there is a proposal for adding "methods" but I don't remember the link. I'm not a blind PHP hater, but it seems like PHP community members sometimes celebrate new PHP features when their equivalents have been there for many years in other programming languages. https://waspdev.com/articles/2025-06-12/my-honest-opinion-ab... | ||||||||
| ||||||||