[php] How to resolve "must be an instance of string, string given" prior to PHP 7?

I think typecasting on php on inside block, String on PHP is not object as I know:

<?php
function phpwtf($s) {
    $s = (string) $s;
    echo "$s\n";
}
phpwtf("Type hinting is da bomb");