Advertisement
Guest User

Untitled

a guest
Dec 6th, 2020
29
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.41 KB | None | 0 0
  1. class ParentClass {
  2. protected function method1(): string {
  3. return $this->protectedMethod1();
  4. }
  5.  
  6. protected function protectedMethod1(): string {
  7. return 'parent';
  8. }
  9. }
  10.  
  11. class ChildClass extends ParentClass {
  12. protected function method1(): string {
  13. return parent::method1();
  14. }
  15.  
  16. protected function protectedMethod1(): string {
  17. return 'child';
  18. }
  19. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement