Magento – how to debug large object in Magento 2 without var_dump

debugmagento2PHPxdebug

I usually var_dump($object->getData()); in my module to see what data it contains. Because of the injection dependencies , it looks like I can't do that anymore.

When I try it, nothing is printed out, which is likely because the amount of data connected to it is too large???

Can someone suggest an easy way to debug an object in Magento 2?

Thank you

Best Answer

Xdebug is the way to go. You can use Phpstorm in conjunction with Xdebug to pause execution of the code at designated break points and explore ALL data. I use it on Magento 2 every day.

In fact, I made a series of videos on how to install and configure

PhpStorm & Xdebug: Installation & Configuration

I hope this helps to get you going in the right direction!

Related Topic