You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

WordPress更新后出现Call-time pass-by-reference移除致命错误求助

Fixing "Fatal error: Call-time pass-by-reference has been removed" in WordPress

Hey there! Let's break down this error and get your site back up and running smoothly.

What's causing the error?

This issue pops up because PHP 5.4 and later versions completely removed support for call-time pass-by-reference—that’s the & you added before variables when calling a function, like &$Anno and &$Mese in your line 4. This syntax was deprecated long before PHP 5.4, so when WordPress updates (which often require newer PHP versions), old code using this outdated trick will throw this fatal error.

How to fix your code

The fix is straightforward: just remove the & symbols from the function call. Here's your corrected code snippet:

if (!empty($catid)) { 
    $Anno=0; 
    $Mese=0; 
    Pasw13_MeseAnnoCorrenti($Anno, $Mese); // Removed the & before $Anno and $Mese
    $ArchiviMesiAnno=Pasw13_ElencoAnniMesi("mesi",$catid,$Anno); 
    $ArchiviAnni=Pasw13_ElencoAnniMesi("anni",$catid,$Anno); 
    if (!empty($ArchiviMesiAnno) || !empty($ArchiviAnni)){ 

A quick check to ensure it works

For this fix to fully function, the Pasw13_MeseAnnoCorrenti function must already have reference parameters defined in its original code. That means the function should look something like this (you don’t need to change this unless it’s missing the &):

function Pasw13_MeseAnnoCorrenti(&$anno, &$mese) {
    // Function logic here that modifies $anno and $mese
}

If the function doesn’t have those & symbols in its definition, you’ll need to add them there instead—this is where PHP expects references to be declared now.

Bonus tip

While we’re at it, PHP recommends using || instead of Or for logical OR operations, as it has higher precedence and avoids potential unexpected behavior. I swapped that in the code snippet above too!

内容的提问来源于stack exchange,提问作者kowalski215

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.29 06:55:17