$object->doThis()->doThat()->doTheOther();
$string->preg_replace("/[^A-Za-z]+/","_")->trim()->upper();
$string = preg_replace("/[^A-Za-z]+/","_", trim(upper($string)));
Or am I missing your point?