i want 2 different objects created using the same definition based on parameters.. ie:
right now, i just have a switch statement in the getNoise method based on the parameter in the constructor, but is it possible to keep 2 seperate object definitions using the same declaration?PHP Code:$myobject = new Animal( 'dog' );
$myotherobject = new Animal( 'cat' );
// i now have to instances of same object
echo $myobject->getNoise(); // will output "mew"
echo $myotherobject->getNoise(); // will output "bark"
php v 4.3.9





Bookmarks