{"record":{"id":"2f6783915b9eacbe","repo":"nikic/PHP-Parser","slug":"can-only-dump-nodes-and-arrays","errorCode":null,"errorMessage":"Can only dump nodes and arrays.","messagePattern":"Can only dump nodes and arrays\\.","errorType":"exception","errorClass":"\\InvalidArgumentException","httpStatus":null,"severity":"error","filePath":"lib/PhpParser/NodeDumper.php","lineNumber":158,"sourceCode":"            foreach ($node as $key => $value) {\n                $this->res .= \"$this->nl    \" . $key . ': ';\n                $this->dumpRecursive($value);\n            }\n            $this->res .= \"$this->nl)\";\n        } elseif ($node instanceof Comment) {\n            $this->res .= \\str_replace(\"\\n\", $this->nl, $node->getReformattedText());\n        } elseif (\\is_string($node)) {\n            $this->res .= \\str_replace(\"\\n\", $this->nl, $node);\n        } elseif (\\is_int($node) || \\is_float($node)) {\n            $this->res .= $node;\n        } elseif (null === $node) {\n            $this->res .= 'null';\n        } elseif (false === $node) {\n            $this->res .= 'false';\n        } elseif (true === $node) {\n            $this->res .= 'true';\n        } else {\n            throw new \\InvalidArgumentException('Can only dump nodes and arrays.');\n        }\n        if ($indent) {\n            $this->nl = \\substr($this->nl, 0, -4);\n        }\n    }\n\n    protected function dumpFlags(int $flags): string {\n        $strs = [];\n        if ($flags & Modifiers::PUBLIC) {\n            $strs[] = 'PUBLIC';\n        }\n        if ($flags & Modifiers::PROTECTED) {\n            $strs[] = 'PROTECTED';\n        }\n        if ($flags & Modifiers::PRIVATE) {\n            $strs[] = 'PRIVATE';\n        }\n        if ($flags & Modifiers::ABSTRACT) {","sourceCodeStart":140,"sourceCodeEnd":176,"githubUrl":"https://github.com/nikic/PHP-Parser/blob/fbd47f7ebcbb450138d92642a0a53b72a5285dda/lib/PhpParser/NodeDumper.php#L140-L176","documentation":"Error \"Can only dump nodes and arrays.\" thrown in nikic/PHP-Parser.","triggerScenarios":"Thrown at lib/PhpParser/NodeDumper.php:158 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"fbd47f7ebcbb450138d92642a0a53b72a5285dda","analyzedAt":"2026-08-17T03:58:32.123Z","schemaVersion":2},"datasetVersion":"2026-08-17T04:17:16.089Z"}