topical media & game development

talk show tell print

professional-php-01-testcats.php / php



  <?php
  require_once('class.Cheetah.php');
  
    function petTheKitty(Cat objCat) {
      if(objCat->maxSpeed < 5) {
        objCat->purr();
      } else {
         print "Can't pet the kitty - it's moving at " .
               objCat->maxSpeed . " kilometers per hour!";
      }
    }
  
    objCheetah = new Cheetah();
    petTheKitty(objCheetah);
  
    objCat = new Cat();
    petTheKitty(objCat);
  ?>
  


(C) Æliens 20/2/2008

You may not copy or print any of this material without explicit permission of the author or the publisher. In case of other copyright issues, contact the author.