Simple way to debug an object or variable in Typo3 Latest version is:
\TYPO3\CMS\Extbase\Utility\DebuggerUtility::var_dump($object);
Note: This works only with version 4.7 and higher
Similarly in case of Neos in order to print an object we use below code:
\TYPO3\FLOW3\var_dump($object);