'PHP var_dump() in xdebug ignores __debugInfo() magical method
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.
Solution 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.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Derick |
