Throwing an Exception : throw « Statement « PHP
- PHP
- Statement
- throw
Throwing an Exception
<?php
class ThrowExample {
public function makeError() {
throw new Exception("This is an example Exception");
}
}
$inst = new ThrowExample();
$inst->makeError();
?>
Related examples in the same category