+ zend_class_entry *ce = zend_lookup_class(ser->annotations.object_class);
+ if (!ce || !(ce->ce_flags & ZEND_ACC_ENUM)) {
+ zend_throw_exception_ex(spl_ce_RuntimeException, IERR_INVALID_TOKEN,
+ "Not a valid enum: %s", ser->annotations.object_class->val);
+ return;
+ }
+ if (!zend_hash_exists(CE_CONSTANTS_TABLE(ce), zs_case)) {
+ zend_throw_exception_ex(spl_ce_RuntimeException, IERR_INVALID_TOKEN,
+ "Not a valid enum case: %s::%s", ser->annotations.object_class->val, zs_case->val);
+ return;
+ }
+ RETVAL_OBJ_COPY(zend_enum_get_case(ce, zs_case));
+ zend_hash_next_index_insert(ser->ids, return_value);
+ zend_string_release(zs_case);
+}
+
+static inline void php_ion_unserialize_object_iface(php_ion_unserializer *ser, zval *return_value)
+{
+ zend_class_entry *ce = zend_lookup_class(ser->annotations.object_class);