0

Xdebug seems to ignore PHP magic method __debugInfo() in user defined classes when using var_dump().

This is especially unhandy when injecting dependencies (with dependencies, with dependencies...).

Is there a setting for Xdebug's var_dump() so it works with __debugInfo() as expected? Or a workaround in PHP maybe? I could not find anything.

1 Answer 1

1

Xdebug's philosophy is to show data as it exists in objects, to aid debugging. Having all the properties shown, and not just the ones that __debugInfo() returns follows this convention.

There is a workaround for step debugging, but not for the overloaded var_dump(). You can turn off Xdebug's "Development Tools" however, by not including develop in the xdebug.mode php.ini setting.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.