Empfehlungen: Erweiterte Suche
<?php
function mathAdd($a, $b) {
return $a + $b;
}
?>
<?php
function mathAdd($a, $b) {
if(is_number($a) and is_number($b)) {
return $a + $b;
} else {
throw new MathException("The values you've passed aren't both numbers"); // ist das so grammatikalisch korrekt?
return;
}
} // mathAdd()
?>
Zurück zu Konzeption und Vorgehensweise
Mitglieder in diesem Forum: 0 Mitglieder und 0 Gäste