I want to use the DateTime class, but PHPStorm tells me that the "Undefined class DateTime" and my PHP version is 5.5.9-1 . I am using the version of PHPStorm 2016.1 and I am working with the Yii2 framework (if this gives you any useful information). So, how can I use lint with the correct PHP classes by default?
DateTime
PHPStorm
"Undefined class DateTime"
5.5.9-1
2016.1
Yii2 framework
You need to use backslash \DateTime or add use DateTime;
\DateTime
use DateTime;