> Because test's var1 is private. > > test->var1 isn't accessible by class testing, so the assignment you're > doing in testing's constructor is assigning "Pizza Delivery" to > testing->var1 instead. > > When you call $test2->get_var1() you're calling the parent's get_var1() > method, which prints out the parent's var1 property. (which hasn't been > touched.) > > Change test's var1 to protected and it'll work. >
-- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php