Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- class SuaraHewan
- {
- public $suara;
- public function tipe()
- {
- $suara = $this->suara;
- switch ($suara)
- {
- case 'padi': return 'Omnivora';
- case 'Ayam': return 'Karnivora';
- case 'Rumput': return 'Herbivora';
- }
- }
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement