src/Common/Util/StringToolkit.php
public static function getAsString($var)
    {
        if ($var instanceof Exception) {
            return (string)$var;
        } elseif (is_object($var)) {
            return self::getObjectAsString($var);
        } elseif (is_array($var)) {
            return print_r($var, true);
        } elseif (is_resource($var)) {
            return (string)sprintf('resource(type=%s)', get_resource_type($var));
        } elseif (true === $var) {
            return 'true';
        } elseif (false === $var) {
            return 'false';
        } elseif (null === $var) {
            return 'null';
        }

        return (string)$var;
    }
public static function getAsString($var)
    {
        if ($var instanceof Exception) {
            return (string)$var;
        } elseif (is_object($var)) {
            return self::getObjectAsString($var);
        } elseif (is_array($var)) {
            return print_r($var, true);
        } elseif (is_resource($var)) {
            return (string)sprintf('resource(type=%s)', get_resource_type($var));
        } elseif (true === $var) {
            return 'true';
        } elseif (false === $var) {
            return 'false';
        } elseif (null === $var) {
            return 'null';
        }

        return (string)$var;
    }
public static function getAsString ( $ var ) { if ( $ var instanceof Exception ) { return ( string ) $ var ; } elseif ( is_object ( $ var ) ) { return self :: getObjectAsString ( $ var ) ; } elseif ( is_array ( $ var ) ) { return print_r ( $ var , true ) ; } elseif ( is_resource ( $ var ) ) { return ( string ) sprintf ( 'resource(type=%s)' , get_resource_type ( $ var ) ) ; } elseif ( true === $ var ) { return 'true' ; } elseif ( false === $ var ) { return 'false' ; } elseif ( null === $ var ) { return 'null' ; } return ( string ) $ var ; }
Returns a string representation for the given argument. Specifically
handles known scalars or types like exceptions and entities.

@param mixed $var object, array or string to create textual representation for

@return string for the given argument
Returns a string representation for the given argument . Specifically handles known scalars or types like exceptions and entities .