In PHP7 custom object fields need to be declared first in the structures as apposed to being last in PHP5.
This also means casting zend_object is no longer possible and rather then calling zend_object_store_get_object() and cast the result, we need to do a quick XtOffsetOf dance.