Example 1: $math = new Math; $balance = 12.30; $deposit = 1.70; $total = $math->sum($balance, $deposit); if ($total === 14) echo 'Ok'; else echo 'Fail';