Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

PHP Exceptions

<?php
function divide($dividend, $divisor) {
  if($divisor == 0) {
    throw new Exception("Division by zero");
  }
  return $dividend / $divisor;
}

echo divide(5, 0);
?>
Source by laraveldaily.com #
 
PREVIOUS NEXT
Tagged: #PHP #Exceptions
ADD COMMENT
Topic
Name
3+5 =