{"record":{"id":"718f0254293d033d","repo":"filp/whoops","slug":"expecting-callback-argument-to-be-callable","errorCode":null,"errorMessage":"Expecting callback argument to be callable","messagePattern":"Expecting callback argument to be callable","errorType":"exception","errorClass":"InvalidArgumentException","httpStatus":null,"severity":"error","filePath":"src/Whoops/Handler/PrettyPageHandler.php","lineNumber":385,"sourceCode":"\n    /**\n     * Lazily adds an entry to the list of tables displayed in the table.\n     *\n     * The supplied callback argument will be called when the error is\n     * rendered, it should produce a simple associative array. Any nested\n     * arrays will be flattened with `print_r`.\n     *\n     * @param string   $label\n     * @param callable $callback Callable returning an associative array\n     *\n     * @throws InvalidArgumentException If $callback is not callable\n     *\n     * @return static\n     */\n    public function addDataTableCallback($label, /* callable */ $callback)\n    {\n        if (!is_callable($callback)) {\n            throw new InvalidArgumentException('Expecting callback argument to be callable');\n        }\n\n        $this->extraTables[$label] = function (?\\Whoops\\Inspector\\InspectorInterface $inspector = null) use ($callback) {\n            try {\n                $result = call_user_func($callback, $inspector);\n\n                // Only return the result if it can be iterated over by foreach().\n                return is_array($result) || $result instanceof \\Traversable ? $result : [];\n            } catch (\\Exception $e) {\n                // Don't allow failure to break the rendering of the original exception.\n                return [];\n            }\n        };\n\n        return $this;\n    }\n\n    /**","sourceCodeStart":367,"sourceCodeEnd":403,"githubUrl":"https://github.com/filp/whoops/blob/fa1bc9c95a1b392fbdb8a410dbbcb1d6a030fff7/src/Whoops/Handler/PrettyPageHandler.php#L367-L403","documentation":"Error \"Expecting callback argument to be callable\" thrown in filp/whoops.","triggerScenarios":"Thrown at src/Whoops/Handler/PrettyPageHandler.php:385 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":"fa1bc9c95a1b392fbdb8a410dbbcb1d6a030fff7","analyzedAt":"2026-08-21T01:30:26.400Z","schemaVersion":2},"datasetVersion":"2026-08-21T03:17:12.404Z"}