php8.5
Home/ Manual/ rar / rararchive/ RarArchive::__toString

RarArchive::__toString

PHP function Edit on GitHub ✎

(PECL rar >= 2.0.0)

Get text representation

Description

RarArchive::__toString(): string

Provides a string representation for this RarArchive object. It currently shows the full path name of the archive volume that was opened and whether the resource is valid or was already closed through a call to RarArchive::close.

This method may be used only for debugging purposes, as there are no guarantees as to which information the result contains or how it is formatted.

Parameters Parameters

Return Values

A textual representation of this RarArchive object. The content of this representation is unspecified.

Examples

RarArchive::__toString example

php
<?php
$rar_arch = RarArchive::open('latest_winrar.rar');
echo $rar_arch."\n";
$rar_arch->close();
echo $rar_arch."\n";
?>

The above example will output something similar to:

output
RAR Archive "D:\php_rar\trunk\tests\latest_winrar.rar"
RAR Archive "D:\php_rar\trunk\tests\latest_winrar.rar" (closed)

Source: reference/rar/rararchive/tostring.xml · from the official PHP manual (php/doc-en)