PHP Exception Constructor
ဥပမာ
<?php
...
throw new Exception("Division by zero", 1);
...
?>
အဓိပ္ပါယ်နှင့် အသုံးပြုမှု
Constructor ကို Exception()
Exception object တစ်ခုဖန်တီးပြီး ၎င်း၏ ဂုဏ်သတ္တိအချို့ကို သတ်မှတ်ရန် အသုံးပြုသည်။
အထားအသို
new Exception(message, code, previous)
ကန့်သတ်တန်ဖိုးများ
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 |
ဆက်စပ်စာမျက်နှာများ
ကျွန်ုပ်တို့၏ PHP Exceptions အခန်း တွင် Exceptions များအကြောင်း ပိုမိုဖတ်ရှုပါ ။
❮ PHP ခြွင်းချက် အကိုးအကား