php7 inherit the parent and the final keyword usage

php neutron class inherits the parent class parent and final keyword usage

class Person{
public function work(){
echo '96net.com.cn';
}
}

class Son{
public function work(){
echo 'aaa';
}
}

Parent parent class method override

parent::work()

If the parent class method set final subclass can not override, will complain, but not subclass this method is invoked

Guess you like

Origin blog.51cto.com/13959155/2458981