Add runtime type inference verification Co-authored-by: Dmitry Stogov <dmitry@zend.com> Closes GH-12930
Add various tests for GH-10168