Billy,
There's a lot wrong with this code. First, vincent is right, you need to have $this->isSelected when refering to the isSelected method.
Second, your IF is not inside a method. There are only two valid statements you can make inside a class definition: var and function. All other statements and functions MUST be within method functions.
Third, remove the extra two } in the isSelected method in Class B. You should have only one } at the end. The IF statement there does not have an opening { (and doesn't need one since you only have one statement executing on the conditional.
Fourth, the class definition for A needs to be after the class definition for B since A extends B, B has to be defined first.