Can I try/catch a warning?

前端 未结 11 1034
孤城傲影
孤城傲影 2020-11-22 01:04

I need to catch some warnings being thrown from some php native functions and then handle them.

Specifically:

array dns_get_record  ( string $hostnam         


        
11条回答
  •  迷失自我
    2020-11-22 01:37

    try checking whether it returns some boolean value then you can simply put it as a condition. I encountered this with the oci_execute(...) which was returning some violation with my unique keys.

    ex.
    oci_parse($res, "[oracle pl/sql]");
    if(oci_execute){
    ...do something
    }
    

提交回复
热议问题