PHP 8.3.4 Released!

Exception::__toString

(PHP 5, PHP 7, PHP 8)

Exception::__toStringİstisnanın dizgesel gösterimiyle döner

Açıklama

public Exception::__toString(): string

İstisnanın string türündeki gösterimiyle döner.

Bağımsız Değişkenler

Bu işlevin bağımsız değişkeni yoktur.

Dönen Değerler

İstisnanın string türündeki gösterimiyle döner.

Örnekler

Örnek 1 - Exception::__toString() örneği

<?php
try {
throw new
Exception("Bir hata iletisi");
} catch(
Exception $e) {
echo
$e;
}
?>

Yukarıdaki örnek şuna benzer bir çıktı üretir:

exception 'Exception' with message 'Bir hata iletisi' in /home/nilgun/tmp/ex.php:3
Stack trace:
#0 {main}

Ayrıca Bakınız

add a note

User Contributed Notes

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