"extends" applies to the class definition, making the child class definition doing the extending inherit all the non-private properties/methods of the parent class definition. But they are still two separate class definitions: instantiating the child class as an object does not give it any special access to a object instantiated from the parent class; they are still two separate objects and know know more about each other than would, say, a MySQLi object and a SimpleXml object.
Perhaps what you want to do ("perhaps" since I don't know the underlying design requirements here) is:
include_once ('user.class.php');
include_once ('community.class.php');
$community = new community();
$community->id = 2;
echo $community->name ();