Community
Participate
Working Groups
in this code: on line 6 it complains that $inner is undefined, despite $inner literally being defined on line 6. on line 9 it believes $inner is undefined, despite being captured on line 6 for the lambda scope. screenshot: https://i.imgur.com/3daup13.png <code> <?php // You can't remove DOMNodes from a DOMNodeList as you're iterating over them in a foreach loop. // https://www.php.net/manual/en/domnode.removechild.php#90292 $domd = new DOMDocument(); $toRemove = []; $inner = function (DOMNode $domd) use (&$inner, &$toRemove) { if ($domd->hasChildNodes()) { foreach ($domd->childNodes as $child) { $inner($child); } } if ($domd instanceof DOMText) { if (0 === strlen(trim($domd->textContent))) { $toRemove[] = $domd; } } }; $inner($domd); foreach ($toRemove as $remove) { // var_dump($toRemove) & die(); $remove->parentNode->removeChild($remove); } </code>
why is this bug moved to z_archived ? per https://bugs.eclipse.org/bugs/describecomponents.cgi?product=z_Archived z_archived means "Archived Eclipse.org Projects", is PDT an EOL/archived project?