This happens when using php extension. thrift_protocol_write_binary will check Z_TYPE_P of spec and expects to be array (IS_ARRAY). However, PHP7 will set it as reference (IS_REFERENCE).
Proposed solution is to dereference using ZVAL_DEREF before checking types (attached). Alternative would be to mark struct type classes as final, but that break compatibility.