微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

为什么 debug_backtrace 会抛出变量引用通知?

如何解决为什么 debug_backtrace 会抛出变量引用通知?

我有这个函数,除了它会抛出一个关于函数的第 4 行的通知通知写着“只有变量应该通过引用传递......” 我在第 4 行做错了什么? 谢谢!

//EMAIL_ADMIN
//Sends email to site admin if email testing services fail.
//Only occurs if both primary and secondary services have Failed.
//Calls no other function.
//Called by test_email function.
//***************************************************************

function email_admin($email){
    global $full_site_url;//used in links.
    global $site_title;//used in confirmation messages.
    $caller = next(debug_backtrace())['function']; //assigns calling function name to $caller.
    
    if ($caller == 'alt_test_email'){
        //used in email message to provide links for checking services.
        $primary_service = 'http://www.quickemailverification.com';//used in email message.
        $secondary_service = 'http://www.neverbounce.com';//used in email message.

        $to = get_bloginfo('admin_email');
        $subject = 'EMAIL TESTING SERVICES HAVE Failed!';
        $message = 'Both email testing services have Failed. Go to ' . $primary_service . ' and ' . $secondary_service . '.';
        dw_send_email($to,$subject,$message);//call email sending function.
    }
    
    if ($caller == 'unsubscribe'){
        $to = get_bloginfo('admin_email');
        $subject = $site_title . " unsubscribe";
        $message = $email . " has unsubscribed.";
        dw_send_email($to,$message);//call email sending function.
    }
    
    if ($caller == 'subscribe_form_display'){
        $to = get_bloginfo('admin_email');
        $subject = "New " . $site_title . " subscriber";
        $message = $email . " has subscribed to " . $site_title . ".";
        dw_send_email($to,$message);//call email sending function.
    }
}

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。