Specific data types and tools for hitting type.
Composer (https://getcomposer.org/) and (https://packagist.org/)
composer require helionogueir/typeboxing
Parse object to array
use stdClass;
use helionogueir\typeBoxing\parse\ObjectToArray;
$Object = new stdClass();
$Object->d1 = new stdClass();
$Object->d1->d2 = null;
$array = (new ObjectToArray())->parse($Object);
PHPUnit (https://phpunit.de/)
phpunit -c ./typeboxing/tests/unit.xml