src/Exception.php
public function toString($val)
    {
        if (is_object($val) && !$val instanceof \Closure) {
            if (isset($val->_trackableTrait)) {
                return get_class($val).' ('.$val->name.')';
            }

            return 'Object '.get_class($val);
        }

        return json_encode($val);
    }
public function toString($val)
    {
        if (is_object($val) && !$val instanceof \Closure) {
            if (isset($val->_trackableTrait)) {
                return get_class($val).' ('.$val->name.')';
            }

            return 'Object '.get_class($val);
        }

        return json_encode($val);
    }
public function toString ( $ val ) { if ( is_object ( $ val ) && ! $ val instanceof \ Closure ) { if ( isset ( $ val -> _trackableTrait ) ) { return get_class ( $ val ) . ' (' . $ val -> name . ')' ; } return 'Object ' . get_class ( $ val ) ; } return json_encode ( $ val ) ; }
Safely converts some value to string.

@param mixed $val

@return string
Safely converts some value to string .