src/Wrapper.php
private static function tostring($value) : string
    {
        if (!isset($value)) {
            return 'NULL';
        }
        if ($value === true) {
            return 'true';
        }
        if ($value === false) {
            return 'false';
        }
        if (is_numeric($value)) {
            return $value;
        }
        if (is_string($value)) {
            return "'$value'";
        }
        if (is_array($value)) {
            $out = '[';
            $i = 0;
            foreach ($value as $key => $entry) {
                if ($i) {
                    $out .= ', ';
                }
                $out .= $key.' => '.self::tostring($entry);
                $i++;
            }
            $out .= ']';
            return $out;
        }
        if (is_object($value)) {
            if (method_exists($value, '__toString')) {
                return "$value";
            } else {
                return get_class($value);
            }
        }
    }
private static function tostring($value) : string
    {
        if (!isset($value)) {
            return 'NULL';
        }
        if ($value === true) {
            return 'true';
        }
        if ($value === false) {
            return 'false';
        }
        if (is_numeric($value)) {
            return $value;
        }
        if (is_string($value)) {
            return "'$value'";
        }
        if (is_array($value)) {
            $out = '[';
            $i = 0;
            foreach ($value as $key => $entry) {
                if ($i) {
                    $out .= ', ';
                }
                $out .= $key.' => '.self::tostring($entry);
                $i++;
            }
            $out .= ']';
            return $out;
        }
        if (is_object($value)) {
            if (method_exists($value, '__toString')) {
                return "$value";
            } else {
                return get_class($value);
            }
        }
    }
private static function tostring ( $ value ) : string { if ( ! isset ( $ value ) ) { return 'NULL' ; } if ( $ value === true ) { return 'true' ; } if ( $ value === false ) { return 'false' ; } if ( is_numeric ( $ value ) ) { return $ value ; } if ( is_string ( $ value ) ) { return "'$value'" ; } if ( is_array ( $ value ) ) { $ out = '[' ; $ i = 0 ; foreach ( $ value as $ key => $ entry ) { if ( $ i ) { $ out .= ', ' ; } $ out .= $ key . ' => ' . self :: tostring ( $ entry ) ; $ i ++ ; } $ out .= ']' ; return $ out ; } if ( is_object ( $ value ) ) { if ( method_exists ( $ value , '__toString' ) ) { return "$value" ; } else { return get_class ( $ value ) ; } } }
Internal helper method to get an echo'able representation of a random
value for reporting and code generation.

@param mixed $value
@return string
Internal helper method to get an echo able representation of a random value for reporting and code generation .