【发布时间】:2013-11-07 20:33:14
【问题描述】:
我一直在使用 SimpleImage 类进行图像处理,但它在一个特定站点上不起作用,服务器上的 PHP 版本是 5.1.6 - 所以六岁了
解析错误:语法错误,意外的':' in...
导致错误的行
$height = $height ?: $width;
$quality = $quality ?: $this->quality;
$filename = $filename ?: $this->filename;
有解决办法吗?
【问题讨论】:
-
$height = $height ? $宽度:$宽度;
-
$height = $height ? $height : $width;
标签: php ternary-operator