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

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

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 想通过pywinauto自动电机应用程序按钮,但是找不到应用程序按钮信息
  • ¥15 MATLAB中streamslice问题
  • ¥15 如何在炒股软件中,爬到我想看的日k线
  • ¥15 51单片机中C语言怎么做到下面类似的功能的函数(相关搜索:c语言)
  • ¥15 seatunnel 怎么配置Elasticsearch
  • ¥15 PSCAD安装问题 ERROR: Visual Studio 2013, 2015, 2017 or 2019 is not found in the system.
  • ¥15 (标签-MATLAB|关键词-多址)
  • ¥15 关于#MATLAB#的问题,如何解决?(相关搜索:信噪比,系统容量)
  • ¥500 52810做蓝牙接受端
  • ¥15 基于PLC的三轴机械手程序