S
S
SmallVerySmallResearcher2019-09-12 10:06:25
PHP
SmallVerySmallResearcher, 2019-09-12 10:06:25

How to call parent method in php?

Good afternoon! Faced with the question, how do I call the parent method, which is also called the method of the child class?

class A{
public function foo(){return 1;}
}

class B extends A(){
public function foo(){ 

/* нужно вызвать родительский foo() */

}
}

Answer the question

In order to leave comments, you need to log in

1 answer(s)
H
hack504, 2019-09-12
@SmallVerySmallResearcher

parent::foo()

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question