accessMod.php

Source of accessMod.php

<!doctype html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>Use Access Modifiers</title>
</head>
<body>
  <?php
  require_once("Critter.php");
  
  $a = new Critter("Nobody");
  //this line is no longer legal:
  // print $a->name;
  
  //Use the methods instead
  $a->setName("Brayden");
  
  print "Hi, " . $a->getName() . "! <br />";
  
  ?>
  
</body>
</html>