note 104968 deleted from class.domainexception by thiago

From: Date: Tue, 19 Jul 2011 13:35:12 +0000
Subject: note 104968 deleted from class.domainexception by thiago
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-181697@lists.php.net to get a copy of this message
Note Submitter: johnny dot bojowkarz at gmail dot com ---- <?php function divide($dividend, $divisor) { if($divisor == 0) { throw new \DomainException( 'Zero does not belong to the domain of this functions.' ); } return $dividend / $divisor; } ?> <?php function logarithm($argument, $base) { if($base <= 0 || $base == 1) { throw new \DomainException( 'Specified base does not belong to the domain of this function.' ); } if($argument <= 0) { throw new \DomainException( 'Specified argument does not belong to the domain of this function.' ); } return log($argument, $base); } ?>

« previous php.notes (#181697) next »