dsizd368332 2018-06-27 15:17
浏览 216
已采纳

致命错误:无法在写入上下文错误中使用函数返回值

I got an error on my site.

Fatal error: Can't use function return value in write context in /home4/massspreadz/public_html/www.gamagesteelfurniture.lk/wp-content/plugins/booking/core/admin/wpbc-class-timeline.php on line 1258

Here is the code that is causing the error:

//FixIn: 8.1.3.34
if ( ! empty( get_bk_option( 'booking_time_format') ) ) {
    $time_show = date_i18n( str_replace( ':i', '', get_bk_option( 'booking_time_format' ) ), mktime( $tt * $tm , 0, 0 ) );
    echo ( $view_days_num < 31 ) ? $time_show : '';
} else {
    echo ( ( $view_days_num < 31 ) ? ( ( ($tt*$tm) < 10?'0':'') . ($tt*$tm) . '<sup>:00</sup>' ) : '' );
}
?></div><?php
  • 写回答

1条回答 默认 最新

  • duanpengya7074 2018-06-27 15:25
    关注

    You need to change the following line:

    if ( ! empty( get_bk_option( 'booking_time_format') ) ) {
    

    To something like this:

    $bkOption = get_bk_option( 'booking_time_format');
    
    if ( ! empty( $bkOption ) ) {
    

    Note:

    Prior to PHP 5.5, empty() only supports variables; anything else will result in a parse error. In other words, the following will not work: empty(trim($name)). Instead, use trim($name) == false.

    So, your current php version can't handle this. Read the manual for more information.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 关于#c语言#的问题:我现在在做一个墨水屏设计,2.9英寸的小屏怎么换4.2英寸大屏
  • ¥15 模糊pid与pid仿真结果几乎一样
  • ¥15 java的GUI的运用
  • ¥15 Web.config连不上数据库
  • ¥15 我想付费需要AKM公司DSP开发资料及相关开发。
  • ¥15 怎么配置广告联盟瀑布流
  • ¥15 Rstudio 保存代码闪退
  • ¥20 win系统的PYQT程序生成的数据如何放入云服务器阿里云window版?
  • ¥50 invest生境质量模块
  • ¥15 nhanes加权logistic回归,svyglm函数