Answers for "how to catch errors in php"

PHP
5

php try catch

<?php

function test() {
    try {
        throw new Exception('foo');
    } catch (Exception $e) {
        return 'catch';
    } finally {
        return 'finally';
    }
}

echo test();
?>
Posted by: Guest on January-13-2021

Browse Popular Code Answers by Language