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.
It was! I'll fix it. My bad.
We're a place where coders share, stay up-to-date and grow their careers.
We strive for transparency and don't collect excess data.