PHP 8.3.4 Released!

Error::getCode

(PHP 7, PHP 8)

Error::getCodeHata koduyla döner

Açıklama

final public Error::getCode(): int

Hatanın kodunu döndürür.

Bağımsız Değişkenler

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

Dönen Değerler

Hata kodu bir int olarak döner.

Örnekler

Örnek 1 - Error::getCode() örneği

<?php
try {
throw new
Error("Bu bir hata iletisidir", 30);
} catch(
Error $e) {
echo
"Hatanın kodu: " . $e->getCode();
}
?>

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

Hatanın kodu: 30

Ayrıca Bakınız

add a note

User Contributed Notes

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