Just like we do with __ToString, is there a way to define a method for casting?
$obj = (MyClass) $another_class_obj;
If casting for type hinting is all you're after, this works.
if( is_object($dum_class_u_want) && $dum_class_u_want instanceof ClassYouWant ) { // type hints working now $dum_class_u_want->is_smart_now(); }
Yep.