@@ -5817,6 +5817,12 @@ ZEND_METHOD(ReflectionProperty, getValue)
5817
5817
RETURN_THROWS ();
5818
5818
}
5819
5819
5820
+ /* TODO: Should this always use intern->ce? */
5821
+ if (!instanceof_function (Z_OBJCE_P (object ), ref -> prop ? ref -> prop -> ce : intern -> ce )) {
5822
+ _DO_THROW ("Given object is not an instance of the class this property was declared in" );
5823
+ RETURN_THROWS ();
5824
+ }
5825
+
5820
5826
if (ref -> cache_slot [0 ] == Z_OBJCE_P (object )) {
5821
5827
uintptr_t prop_offset = (uintptr_t ) ref -> cache_slot [1 ];
5822
5828
@@ -5826,12 +5832,6 @@ ZEND_METHOD(ReflectionProperty, getValue)
5826
5832
RETURN_COPY_DEREF (retval );
5827
5833
}
5828
5834
}
5829
- } else {
5830
- /* TODO: Should this always use intern->ce? */
5831
- if (!instanceof_function (Z_OBJCE_P (object ), ref -> prop ? ref -> prop -> ce : intern -> ce )) {
5832
- _DO_THROW ("Given object is not an instance of the class this property was declared in" );
5833
- RETURN_THROWS ();
5834
- }
5835
5835
}
5836
5836
5837
5837
zend_class_entry * old_scope = EG (fake_scope );
@@ -5926,6 +5926,11 @@ ZEND_METHOD(ReflectionProperty, getRawValue)
5926
5926
5927
5927
GET_REFLECTION_OBJECT_PTR (ref );
5928
5928
5929
+ if (!instanceof_function (Z_OBJCE_P (object ), intern -> ce )) {
5930
+ _DO_THROW ("Given object is not an instance of the class this property was declared in" );
5931
+ RETURN_THROWS ();
5932
+ }
5933
+
5929
5934
if (ref -> cache_slot [0 ] == Z_OBJCE_P (object )) {
5930
5935
uintptr_t prop_offset = (uintptr_t ) ref -> cache_slot [1 ];
5931
5936
@@ -5935,11 +5940,6 @@ ZEND_METHOD(ReflectionProperty, getRawValue)
5935
5940
RETURN_COPY_DEREF (retval );
5936
5941
}
5937
5942
}
5938
- } else {
5939
- if (!instanceof_function (Z_OBJCE_P (object ), intern -> ce )) {
5940
- _DO_THROW ("Given object is not an instance of the class this property was declared in" );
5941
- RETURN_THROWS ();
5942
- }
5943
5943
}
5944
5944
5945
5945
zend_property_info * prop = reflection_property_get_effective_prop (ref ,
@@ -6209,19 +6209,19 @@ ZEND_METHOD(ReflectionProperty, isInitialized)
6209
6209
RETURN_THROWS ();
6210
6210
}
6211
6211
6212
+ /* TODO: Should this always use intern->ce? */
6213
+ if (!instanceof_function (Z_OBJCE_P (object ), ref -> prop ? ref -> prop -> ce : intern -> ce )) {
6214
+ _DO_THROW ("Given object is not an instance of the class this property was declared in" );
6215
+ RETURN_THROWS ();
6216
+ }
6217
+
6212
6218
if (ref -> cache_slot [0 ] == Z_OBJCE_P (object )) {
6213
6219
uintptr_t prop_offset = (uintptr_t ) ref -> cache_slot [1 ];
6214
6220
6215
6221
if (EXPECTED (IS_VALID_PROPERTY_OFFSET (prop_offset ))) {
6216
6222
zval * value = OBJ_PROP (Z_OBJ_P (object ), prop_offset );
6217
6223
RETURN_BOOL (Z_TYPE_INFO_P (value ) != IS_UNDEF );
6218
6224
}
6219
- } else {
6220
- /* TODO: Should this always use intern->ce? */
6221
- if (!instanceof_function (Z_OBJCE_P (object ), ref -> prop ? ref -> prop -> ce : intern -> ce )) {
6222
- _DO_THROW ("Given object is not an instance of the class this property was declared in" );
6223
- RETURN_THROWS ();
6224
- }
6225
6225
}
6226
6226
6227
6227
old_scope = EG (fake_scope );
0 commit comments