跳转到主要内容

tostring

Exception::__toString

String representation of the exception

ENTITY

public

string

Exception::__toString

Returns the string representation of the exception.

ENTITY ENTITY

ENTITY

Returns the string representation of the exception.

ENTITY

Exception::__toString example

<?php
try {
    throw new Exception("Some error message");
} catch(Exception $e) {
    echo $e;
}
?>

    

ENTITY

exception 'Exception' with message 'Some error message' in /home/bjori/tmp/ex.php:3
Stack trace:
#0 {main}

ENTITY

Throwable::__toString