@@ -2210,23 +2210,29 @@ static uint32_t zend_convert_type_declaration_mask(uint32_t type_mask) {
2210
2210
return result_mask ;
2211
2211
}
2212
2212
2213
- ZEND_API uint32_t zend_fetch_arg_info_type (const zend_script * script , zend_arg_info * arg_info , zend_class_entry * * pce )
2213
+ static uint32_t zend_convert_type (const zend_script * script , zend_type type , zend_class_entry * * pce )
2214
2214
{
2215
- uint32_t tmp ;
2215
+ if (pce ) {
2216
+ * pce = NULL ;
2217
+ }
2216
2218
2217
- * pce = NULL ;
2218
- if (!ZEND_TYPE_IS_SET (arg_info -> type )) {
2219
+ if (!ZEND_TYPE_IS_SET (type )) {
2219
2220
return MAY_BE_ANY |MAY_BE_ARRAY_KEY_ANY |MAY_BE_ARRAY_OF_ANY |MAY_BE_ARRAY_OF_REF |MAY_BE_RC1 |MAY_BE_RCN ;
2220
2221
}
2221
2222
2222
- tmp = zend_convert_type_declaration_mask (ZEND_TYPE_PURE_MASK (arg_info -> type ));
2223
- if (ZEND_TYPE_HAS_CLASS (arg_info -> type )) {
2223
+ uint32_t tmp = zend_convert_type_declaration_mask (ZEND_TYPE_PURE_MASK (type ));
2224
+ if (ZEND_TYPE_HAS_CLASS (type )) {
2224
2225
tmp |= MAY_BE_OBJECT ;
2225
- /* As we only have space to store one CE, we use a plain object type for class unions. */
2226
- if (ZEND_TYPE_HAS_NAME (arg_info -> type )) {
2227
- zend_string * lcname = zend_string_tolower (ZEND_TYPE_NAME (arg_info -> type ));
2228
- * pce = zend_optimizer_get_class_entry (script , lcname );
2229
- zend_string_release_ex (lcname , 0 );
2226
+ if (pce ) {
2227
+ /* As we only have space to store one CE,
2228
+ * we use a plain object type for class unions. */
2229
+ if (ZEND_TYPE_HAS_CE (type )) {
2230
+ * pce = ZEND_TYPE_CE (type );
2231
+ } else if (ZEND_TYPE_HAS_NAME (type )) {
2232
+ zend_string * lcname = zend_string_tolower (ZEND_TYPE_NAME (type ));
2233
+ * pce = zend_optimizer_get_class_entry (script , lcname );
2234
+ zend_string_release_ex (lcname , 0 );
2235
+ }
2230
2236
}
2231
2237
}
2232
2238
if (tmp & (MAY_BE_STRING |MAY_BE_ARRAY |MAY_BE_OBJECT |MAY_BE_RESOURCE )) {
@@ -2235,6 +2241,11 @@ ZEND_API uint32_t zend_fetch_arg_info_type(const zend_script *script, zend_arg_i
2235
2241
return tmp ;
2236
2242
}
2237
2243
2244
+ ZEND_API uint32_t zend_fetch_arg_info_type (const zend_script * script , zend_arg_info * arg_info , zend_class_entry * * pce )
2245
+ {
2246
+ return zend_convert_type (script , arg_info -> type , pce );
2247
+ }
2248
+
2238
2249
static zend_property_info * lookup_prop_info (zend_class_entry * ce , zend_string * name , zend_class_entry * scope ) {
2239
2250
zend_property_info * prop_info ;
2240
2251
@@ -2323,29 +2334,14 @@ static zend_property_info *zend_fetch_static_prop_info(const zend_script *script
2323
2334
2324
2335
static uint32_t zend_fetch_prop_type (const zend_script * script , zend_property_info * prop_info , zend_class_entry * * pce )
2325
2336
{
2326
- if (pce ) {
2327
- * pce = NULL ;
2328
- }
2329
- if (prop_info && ZEND_TYPE_IS_SET (prop_info -> type )) {
2330
- uint32_t type = zend_convert_type_declaration_mask (ZEND_TYPE_PURE_MASK (prop_info -> type ));
2331
- if (ZEND_TYPE_HAS_CLASS (prop_info -> type )) {
2332
- type |= MAY_BE_OBJECT ;
2333
- if (pce ) {
2334
- if (ZEND_TYPE_HAS_CE (prop_info -> type )) {
2335
- * pce = ZEND_TYPE_CE (prop_info -> type );
2336
- } else if (ZEND_TYPE_HAS_NAME (prop_info -> type )) {
2337
- zend_string * lcname = zend_string_tolower (ZEND_TYPE_NAME (prop_info -> type ));
2338
- * pce = zend_optimizer_get_class_entry (script , lcname );
2339
- zend_string_release (lcname );
2340
- }
2341
- }
2337
+ if (!prop_info ) {
2338
+ if (pce ) {
2339
+ * pce = NULL ;
2342
2340
}
2343
- if (type & (MAY_BE_STRING |MAY_BE_ARRAY |MAY_BE_OBJECT |MAY_BE_RESOURCE )) {
2344
- type |= MAY_BE_RC1 | MAY_BE_RCN ;
2345
- }
2346
- return type ;
2341
+ return MAY_BE_ANY | MAY_BE_ARRAY_KEY_ANY | MAY_BE_ARRAY_OF_ANY | MAY_BE_ARRAY_OF_REF | MAY_BE_RC1 | MAY_BE_RCN ;
2347
2342
}
2348
- return MAY_BE_ANY | MAY_BE_ARRAY_KEY_ANY | MAY_BE_ARRAY_OF_ANY | MAY_BE_ARRAY_OF_REF | MAY_BE_RC1 | MAY_BE_RCN ;
2343
+
2344
+ return zend_convert_type (script , prop_info -> type , pce );
2349
2345
}
2350
2346
2351
2347
static zend_always_inline int _zend_update_type_info (
0 commit comments