【发布时间】:2017-03-05 19:21:16
【问题描述】:
如何在 PHP 5.1.6 上运行此代码
$tz = new DateTimeZone($obj['timezone']);
不升级我的 PHP 版本?
或者有其他选择吗?
我收到了这个错误
PHP 致命错误:找不到类“DateTimeZone”
谢谢
【问题讨论】:
-
它在 5.1.6 版本中不受支持,但在 (PHP 5 >= 5.2.0, PHP 7) 中支持
-
你为什么运行 5.1?我能否知道您托管此内容的 URL,因为我可以想象在 10 多年前停止安全更新( 2006 年 8 月 24 日)? On the bright side there's "only" 118 vunerabilities and 12 exploits
标签: php