Tuesday, 25 September 2018

throw exception in php 7

<?php
echo 'Current PHP version: ' . phpversion();
try {
    $num=1;
    echo $num;
    if($num) {
    throw new Exception("This is an exception");
    }
} catch(Throwable $e) {

    echo $e->getFile();
}

?>

No comments:

Post a Comment