问题
I want to use class DateTime
but PHPStorm
says me that "Undefined class DateTime"
and my PHP version is 5.5.9-1
.
I'm using PHPStorm version 2016.1
and i'm working with Yii2 framework
(if it'll give you any useful information). So how can i use with correct lint default PHP classes?
回答1:
You need to use backslash \DateTime
or add use DateTime;
来源:https://stackoverflow.com/questions/38562376/undefined-class-datetime-in-phpstorm