Warning: include_once(/var/www/html/pmwiki-2.2.86/cookbook/soap4pmwiki/soap4pmwiki.php): failed to open stream: No such file or directory in /var/www/html/fields/dbp09/local/config.php on line 4

Warning: include_once(): Failed opening '/var/www/html/pmwiki-2.2.86/cookbook/soap4pmwiki/soap4pmwiki.php' for inclusion (include_path='.:/opt/php/lib/php') in /var/www/html/fields/dbp09/local/config.php on line 4

Warning: Cannot modify header information - headers already sent by (output started at /var/www/html/fields/dbp09/local/config.php:4) in /var/www/html/pmwiki-2.2.86/pmwiki.php on line 1250
Datenbankpraktikum SS 2009 - Main - Exceptions

Exceptions

<?php 
class Math { 
 
  function divide($x,$y) { 
    if($y==0) throw new Exception(Wer teilt denn hier durch 0?"); 
    return $x/$y; 
  } 
} 
 
$x = new Math(); 
 
try { 
  $x->divide(3,0);    
} catch (Exception $e) { 
    echo $e->getMessage(); 
    echo "\n<br />\n";
} 
?>


Page last modified on July 29, 2009, at 10:48 PM