PHP İstisna Oluşturucu
Örnek
<?php
...
throw new Exception("Division by zero", 1);
...
?>
Tanım ve Kullanım
Yapıcı Exception()
, bir İstisna nesnesi oluşturmak ve bazı özelliklerini ayarlamak için kullanılır.
Sözdizimi
new Exception(message, code, previous)
Parametre Değerleri
Parameter | Description |
---|---|
message | Optional. A string describing why the exception was thrown |
code | Optional. An integer that can be used used to easily distinguish this exception from others of the same type |
previous | Optional. If this exception was thrown in a catch block of another exception, it is recommended to pass that exception into this parameter |
İlgili Sayfalar
PHP İstisnalar Bölümümüzde İstisnalar hakkında daha fazla bilgi edinin .
❮ PHP İstisna Referansı