通过引用传递PHP中的静态字段

通过引用传递PHP中的静态字段,php,closures,pass-by-reference,static-members,Php,Closures,Pass By Reference,Static Members,我需要收集一些带有闭包的东西到一个静态字段数组中。所以我需要通过引用将其传递到闭包中。我如何做到这一点 self::$ancestors = array(); self::ancestors_each($arFields['ID'], function($section_id) use(self::&$ancestors) { $ancestors[$section_id] = true; });

我需要收集一些带有闭包的东西到一个静态字段数组中。所以我需要通过引用将其传递到闭包中。我如何做到这一点

self::$ancestors = array();
self::ancestors_each($arFields['ID'], function($section_id) use(self::&$ancestors) {
            $ancestors[$section_id] = true;
        });