I am reading yii2’s source code right now. I found that this method yii\di\Instance::ensure something werid。
I changed the code as following:
public static function ensure($reference, $type = null, $container = null)
// I added three lines
$container = null;
// original code
I got output as :
Can anyone explain?
Just now(2016-04-12 15:20:58)，I asked Laruence about this questing in qq group. He answered me that get_calss(null) will return current scope. Then I read the php documetation , It says:
objectis omitted when inside a class, the name of that class is returned.
So, RTFM si right.