Throwing an Exception
<?php class ThrowExample { public function makeError() { throw new Exception("This is an example Exception"); } } $inst = new ThrowExample(); $inst->makeError(); ?>