CakeFest 2024: The Official CakePHP Conference

Error::__toString

(PHP 7, PHP 8)

Error::__toStringエラーの文字列表現

説明

public Error::__toString(): string

エラーの string 型の表現を返します

パラメータ

この関数にはパラメータはありません。

戻り値

エラーの string 型の表現を返します

例1 Error::__toString() の例

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

上の例の出力は、 たとえば以下のようになります。

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

参考

add a note

User Contributed Notes

There are no user contributed notes for this page.
To Top