L
L
Lexxtor2016-04-11 20:31:14
Yii
Lexxtor, 2016-04-11 20:31:14

How is a class constructor called statically in Yii2?

I found this line:
Component::__construct($config);
https://github.com/yiisoft/yii2/blob/master/framew...
How does it work? After all, you cannot make a constructor static, and in this code it is not static, but it is called as static, and for some reason there is no error.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
DevMan, 2016-04-12
@Lexxtor

in this context, this is not a static call, but a parent method call.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question