// the group name or your name. print_example_count($example_count++, __LINE__); $another_example = new ExampleClass('Jason'); echo $another_example . "\n"; // Let's create another instance of ExampleClass but pass in // null for for my name. print_example_count($example_count++, __LINE__); $yet_another_example = new ExampleClass(null, 'Astronauts', 'John'); echo $yet_another_example . "\n"; // Let's set the my name for the instance we just created. print_example_count($example_count++, __LINE__); $yet_another_example->my_name = 'Jason'; echo $yet_another_example . "\n"; // Let's change my group to Mission Control. Since it is protected, // we must use a setter. print_example_count($example_count++, __LINE__); $yet_another_example->setGroupName('Mission Control'); echo $yet_another_example . "\n"; // Let's change your name to Jill. We must use a setter to do that // since it is private. print_example_count($example_count++, __LINE__); $yet_another_example->setYourName('Jill'); echo $yet_another_example . "\n"; // Since my name is public, we can read it as well. print_example_count($example_count++, __LINE__); echo '$yet_another_example->my_name equals ' . $yet_another_example->my_name . "\n"; // Since group name and your name are not public, we must use getters // to read them. print_example_count($example_count++, __LINE__); echo '$yet_another_example->group_name equals ' . $yet_another_example->getGroupName() . "\n"; echo '$yet_another_example->your_name equals ' . $yet_another_example->getYourName() . "\n";