why Yii::$app instead of Yii::app ? '$' is there for a reason?

?

this is because $app is a static variable, and can be accessed via Yii :: $app while access Yii::app be used if app was a constant


...

namespace yii;

class BaseYii

{

   ...

	/**

 	* @var \yii\console\Application|\yii\web\Application the application instance

 	*/

	public static $app;

   ...

}

see php/constants.php and php/static.php

clean and clear, thank you.