DEV Community

Discussion on: I Want Scalar Objects in PHP

Collapse
 
alchermd profile image
John Alcher • Edited
var_dump($hello.replace('Matt', 'Bob')); // Hello Bob!

Using the dot notation only for these scalar objects would be horrible IMO. Better stick with the -> operator.

Quick edit: I realized that maybe just a typo on your part lol.

Collapse
 
mattsparks profile image
Matt Sparks

It was! I'll fix it. My bad.