跳转到主要内容

tostring

Error::__toString

String representation of the error

ENTITY

public

string

Error::__toString

Returns the string representation of the error.

ENTITY ENTITY

ENTITY

Returns the string representation of the error.

ENTITY

Error::__toString example

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

    

ENTITY

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

ENTITY

Throwable::__toString