user10000748
user10000748

Reputation:

Fatal error: Can't use function return value in write context error

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

Upvotes: 1

Views: 438

Answers (1)

The Alpha
The Alpha

Reputation: 146191

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.

Upvotes: 1

Related Questions