Mega Code Archive

 
Categories / Php / Class
 

Creating a new object and assigning it to a variable

<?php Class Cat {   // Constructor   function __constructor(  ) {   }   // The cat meows   function meow(  ) {     echo "Meow...";   }   // The cat eats   function eat(  ) {     echo "*eats*";   }   // The cat purrs   function purr(  ) {     echo "*Purr...*";   } } $myCat=new Cat; ?>