Undefined class DateTime in PHPStorm

戏子无情 提交于 2021-02-07 11:30:56

问题


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

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!