Coverage Report

Created: 2025-07-23 06:33

/src/php-src/Zend/zend_object_handlers.h
Line
Count
Source (jump to first uncovered line)
1
/*
2
   +----------------------------------------------------------------------+
3
   | Zend Engine                                                          |
4
   +----------------------------------------------------------------------+
5
   | Copyright (c) Zend Technologies Ltd. (http://www.zend.com)           |
6
   +----------------------------------------------------------------------+
7
   | This source file is subject to version 2.00 of the Zend license,     |
8
   | that is bundled with this package in the file LICENSE, and is        |
9
   | available through the world-wide-web at the following url:           |
10
   | http://www.zend.com/license/2_00.txt.                                |
11
   | If you did not receive a copy of the Zend license and are unable to  |
12
   | obtain it through the world-wide-web, please send a note to          |
13
   | license@zend.com so we can mail you a copy immediately.              |
14
   +----------------------------------------------------------------------+
15
   | Authors: Andi Gutmans <andi@php.net>                                 |
16
   |          Zeev Suraski <zeev@php.net>                                 |
17
   +----------------------------------------------------------------------+
18
*/
19
20
#ifndef ZEND_OBJECT_HANDLERS_H
21
#define ZEND_OBJECT_HANDLERS_H
22
23
#include <stdint.h>
24
25
#include "zend_hash.h"
26
#include "zend_types.h"
27
#include "zend_property_hooks.h"
28
#include "zend_lazy_objects.h"
29
30
struct _zend_property_info;
31
32
#define ZEND_WRONG_PROPERTY_INFO \
33
43.3k
  ((struct _zend_property_info*)((intptr_t)-1))
34
35
60.0k
#define ZEND_DYNAMIC_PROPERTY_OFFSET               ((uintptr_t)(intptr_t)(-1))
36
37
/* The first 4 bits in the property offset are used within the cache slot for
38
 * storing information about the property. This value may be bumped to
39
 * offsetof(zend_object, properties_table) in the future. */
40
#define ZEND_FIRST_PROPERTY_OFFSET (1 << 4)
41
#define IS_VALID_PROPERTY_OFFSET(offset)           ((intptr_t)(offset) >= ZEND_FIRST_PROPERTY_OFFSET)
42
#define IS_WRONG_PROPERTY_OFFSET(offset)           ((intptr_t)(offset) == 0)
43
#define IS_HOOKED_PROPERTY_OFFSET(offset) \
44
8.74k
  ((intptr_t)(offset) > 0 && (intptr_t)(offset) < 16)
45
#define IS_DYNAMIC_PROPERTY_OFFSET(offset)         ((intptr_t)(offset) < 0)
46
47
4.66k
#define ZEND_PROPERTY_HOOK_SIMPLE_READ_BIT 2u
48
1.86k
#define ZEND_PROPERTY_HOOK_SIMPLE_WRITE_BIT 4u
49
#define ZEND_PROPERTY_HOOK_SIMPLE_GET_BIT 8u
50
#define ZEND_IS_PROPERTY_HOOK_SIMPLE_READ(offset) \
51
4.66k
  (((offset) & ZEND_PROPERTY_HOOK_SIMPLE_READ_BIT) != 0)
52
#define ZEND_IS_PROPERTY_HOOK_SIMPLE_WRITE(offset) \
53
1.86k
  (((offset) & ZEND_PROPERTY_HOOK_SIMPLE_WRITE_BIT) != 0)
54
#define ZEND_IS_PROPERTY_HOOK_SIMPLE_GET(offset) \
55
  (((offset) & ZEND_PROPERTY_HOOK_SIMPLE_GET_BIT) != 0)
56
#define ZEND_SET_PROPERTY_HOOK_SIMPLE_READ(cache_slot) \
57
448
  do { \
58
448
    void **__cache_slot = (cache_slot); \
59
448
    if (__cache_slot) { \
60
410
      CACHE_PTR_EX(__cache_slot + 1, (void*)((uintptr_t)CACHED_PTR_EX(__cache_slot + 1) | ZEND_PROPERTY_HOOK_SIMPLE_READ_BIT)); \
61
410
    } \
62
448
  } while (0)
63
#define ZEND_SET_PROPERTY_HOOK_SIMPLE_WRITE(cache_slot) \
64
289
  do { \
65
289
    void **__cache_slot = (cache_slot); \
66
289
    if (__cache_slot) { \
67
289
      CACHE_PTR_EX(__cache_slot + 1, (void*)((uintptr_t)CACHED_PTR_EX(__cache_slot + 1) | ZEND_PROPERTY_HOOK_SIMPLE_WRITE_BIT)); \
68
289
    } \
69
289
  } while (0)
70
#define ZEND_SET_PROPERTY_HOOK_SIMPLE_GET(cache_slot) \
71
392
  do { \
72
392
    void **__cache_slot = (cache_slot); \
73
392
    if (__cache_slot) { \
74
392
      CACHE_PTR_EX(__cache_slot + 1, (void*)((uintptr_t)CACHED_PTR_EX(__cache_slot + 1) | ZEND_PROPERTY_HOOK_SIMPLE_GET_BIT)); \
75
392
    } \
76
392
  } while (0)
77
78
2.46k
#define IS_UNKNOWN_DYNAMIC_PROPERTY_OFFSET(offset) (offset == ZEND_DYNAMIC_PROPERTY_OFFSET)
79
492
#define ZEND_DECODE_DYN_PROP_OFFSET(offset)        ((uintptr_t)(-(intptr_t)(offset) - 2))
80
#define ZEND_ENCODE_DYN_PROP_OFFSET(offset)        ((uintptr_t)(-((intptr_t)(offset) + 2)))
81
82
83
/* Used to fetch property from the object, read-only */
84
typedef zval *(*zend_object_read_property_t)(zend_object *object, zend_string *member, int type, void **cache_slot, zval *rv);
85
86
/* Used to fetch dimension from the object, read-only */
87
typedef zval *(*zend_object_read_dimension_t)(zend_object *object, zval *offset, int type, zval *rv);
88
89
90
/* Used to set property of the object
91
   You must return the final value of the assigned property.
92
*/
93
typedef zval *(*zend_object_write_property_t)(zend_object *object, zend_string *member, zval *value, void **cache_slot);
94
95
/* Used to set dimension of the object */
96
typedef void (*zend_object_write_dimension_t)(zend_object *object, zval *offset, zval *value);
97
98
99
/* Used to create pointer to the property of the object, for future direct r/w access.
100
 * May return one of:
101
 *  * A zval pointer, without incrementing the reference count.
102
 *  * &EG(error_zval), if an exception has been thrown.
103
 *  * NULL, if acquiring a direct pointer is not possible.
104
 *    In this case, the VM will fall back to using read_property and write_property.
105
 */
106
typedef zval *(*zend_object_get_property_ptr_ptr_t)(zend_object *object, zend_string *member, int type, void **cache_slot);
107
108
/* Used to check if a property of the object exists */
109
/* param has_set_exists:
110
 * 0 (has) whether property exists and is not NULL
111
 * 1 (set) whether property exists and is true
112
 * 2 (exists) whether property exists
113
 */
114
typedef int (*zend_object_has_property_t)(zend_object *object, zend_string *member, int has_set_exists, void **cache_slot);
115
116
/* Used to check if a dimension of the object exists */
117
typedef int (*zend_object_has_dimension_t)(zend_object *object, zval *member, int check_empty);
118
119
/* Used to remove a property of the object */
120
typedef void (*zend_object_unset_property_t)(zend_object *object, zend_string *member, void **cache_slot);
121
122
/* Used to remove a dimension of the object */
123
typedef void (*zend_object_unset_dimension_t)(zend_object *object, zval *offset);
124
125
/* Used to get hash of the properties of the object, as hash of zval's */
126
typedef HashTable *(*zend_object_get_properties_t)(zend_object *object);
127
128
typedef HashTable *(*zend_object_get_debug_info_t)(zend_object *object, int *is_temp);
129
130
typedef enum _zend_prop_purpose {
131
  /* Used for debugging. Supersedes get_debug_info handler. */
132
  ZEND_PROP_PURPOSE_DEBUG,
133
  /* Used for (array) casts. */
134
  ZEND_PROP_PURPOSE_ARRAY_CAST,
135
  /* Used for serialization using the "O" scheme.
136
   * Unserialization will use __wakeup(). */
137
  ZEND_PROP_PURPOSE_SERIALIZE,
138
  /* Used for var_export().
139
   * The data will be passed to __set_state() when evaluated. */
140
  ZEND_PROP_PURPOSE_VAR_EXPORT,
141
  /* Used for json_encode(). */
142
  ZEND_PROP_PURPOSE_JSON,
143
  /* Used for get_object_vars(). */
144
  ZEND_PROP_PURPOSE_GET_OBJECT_VARS,
145
  /* Dummy member to ensure that "default" is specified. */
146
  _ZEND_PROP_PURPOSE_NON_EXHAUSTIVE_ENUM
147
} zend_prop_purpose;
148
149
/* The return value must be released using zend_release_properties(). */
150
typedef zend_array *(*zend_object_get_properties_for_t)(zend_object *object, zend_prop_purpose purpose);
151
152
/* Used to call methods */
153
/* args on stack! */
154
/* Andi - EX(fbc) (function being called) needs to be initialized already in the INIT fcall opcode so that the parameters can be parsed the right way. We need to add another callback for this.
155
 */
156
typedef zend_function *(*zend_object_get_method_t)(zend_object **object, zend_string *method, const zval *key);
157
typedef zend_function *(*zend_object_get_constructor_t)(zend_object *object);
158
159
/* free_obj should release any resources the object holds, without freeing the
160
 * object structure itself. The object does not need to be in a valid state after
161
 * free_obj finishes running.
162
 *
163
 * free_obj will always be invoked, even if the object leaks or a fatal error
164
 * occurs. However, during shutdown it may be called once the executor is no
165
 * longer active, in which case execution of user code may be skipped.
166
 */
167
typedef void (*zend_object_free_obj_t)(zend_object *object);
168
169
/* dtor_obj is called before free_obj. The object must remain in a valid state
170
 * after dtor_obj finishes running. Unlike free_obj, it is run prior to
171
 * deactivation of the executor during shutdown, which allows user code to run.
172
 *
173
 * This handler is not guaranteed to be called (e.g. on fatal error), and as
174
 * such should not be used to release resources or deallocate memory. Furthermore,
175
 * releasing resources in this handler can break detection of memory leaks, as
176
 * cycles may be broken early.
177
 *
178
 * dtor_obj should be used *only* to call user destruction hooks, such as __destruct.
179
 */
180
typedef void (*zend_object_dtor_obj_t)(zend_object *object);
181
182
typedef zend_object* (*zend_object_clone_obj_t)(zend_object *object);
183
typedef zend_object* (*zend_object_clone_obj_with_t)(zend_object *object, const zend_class_entry *scope, const HashTable *properties);
184
185
/* Get class name for display in var_dump and other debugging functions.
186
 * Must be defined and must return a non-NULL value. */
187
typedef zend_string *(*zend_object_get_class_name_t)(const zend_object *object);
188
189
typedef int (*zend_object_compare_t)(zval *object1, zval *object2);
190
191
/* Cast an object to some other type.
192
 * readobj and retval must point to distinct zvals.
193
 */
194
typedef zend_result (*zend_object_cast_t)(zend_object *readobj, zval *retval, int type);
195
196
/* updates *count to hold the number of elements present and returns SUCCESS.
197
 * Returns FAILURE if the object does not have any sense of overloaded dimensions */
198
typedef zend_result (*zend_object_count_elements_t)(zend_object *object, zend_long *count);
199
200
typedef zend_result (*zend_object_get_closure_t)(zend_object *obj, zend_class_entry **ce_ptr, zend_function **fptr_ptr, zend_object **obj_ptr, bool check_only);
201
202
typedef HashTable *(*zend_object_get_gc_t)(zend_object *object, zval **table, int *n);
203
204
typedef zend_result (*zend_object_do_operation_t)(uint8_t opcode, zval *result, zval *op1, zval *op2);
205
206
struct _zend_object_handlers {
207
  /* offset of real object header (usually zero) */
208
  int                   offset;
209
  /* object handlers */
210
  zend_object_free_obj_t          free_obj;             /* required */
211
  zend_object_dtor_obj_t          dtor_obj;             /* required */
212
  zend_object_clone_obj_t         clone_obj;            /* optional */
213
  zend_object_clone_obj_with_t      clone_obj_with;       /* optional */
214
  zend_object_read_property_t       read_property;        /* required */
215
  zend_object_write_property_t      write_property;       /* required */
216
  zend_object_read_dimension_t      read_dimension;       /* required */
217
  zend_object_write_dimension_t     write_dimension;      /* required */
218
  zend_object_get_property_ptr_ptr_t    get_property_ptr_ptr; /* required */
219
  zend_object_has_property_t        has_property;         /* required */
220
  zend_object_unset_property_t      unset_property;       /* required */
221
  zend_object_has_dimension_t       has_dimension;        /* required */
222
  zend_object_unset_dimension_t     unset_dimension;      /* required */
223
  zend_object_get_properties_t      get_properties;       /* required */
224
  zend_object_get_method_t        get_method;           /* required */
225
  zend_object_get_constructor_t     get_constructor;      /* required */
226
  zend_object_get_class_name_t      get_class_name;       /* required */
227
  zend_object_cast_t            cast_object;          /* required */
228
  zend_object_count_elements_t      count_elements;       /* optional */
229
  zend_object_get_debug_info_t      get_debug_info;       /* optional */
230
  zend_object_get_closure_t       get_closure;          /* optional */
231
  zend_object_get_gc_t          get_gc;               /* required */
232
  zend_object_do_operation_t        do_operation;         /* optional */
233
  zend_object_compare_t         compare;              /* required */
234
  zend_object_get_properties_for_t    get_properties_for;   /* optional */
235
};
236
237
BEGIN_EXTERN_C()
238
extern const ZEND_API zend_object_handlers std_object_handlers;
239
240
#define zend_get_std_object_handlers() \
241
128
  (&std_object_handlers)
242
243
#define zend_get_function_root_class(fbc) \
244
22
  ((fbc)->common.prototype ? (fbc)->common.prototype->common.scope : (fbc)->common.scope)
245
246
0
#define ZEND_PROPERTY_ISSET     0x0          /* Property exists and is not NULL */
247
625
#define ZEND_PROPERTY_NOT_EMPTY ZEND_ISEMPTY /* Property is not empty */
248
388
#define ZEND_PROPERTY_EXISTS    0x2          /* Property exists */
249
250
ZEND_API void zend_class_init_statics(zend_class_entry *ce);
251
ZEND_API zend_function *zend_std_get_static_method(zend_class_entry *ce, zend_string *function_name_strval, const zval *key);
252
ZEND_API zval *zend_std_get_static_property_with_info(zend_class_entry *ce, zend_string *property_name, int type, struct _zend_property_info **prop_info);
253
ZEND_API zval *zend_std_get_static_property(zend_class_entry *ce, zend_string *property_name, int type);
254
ZEND_API ZEND_COLD bool zend_std_unset_static_property(const zend_class_entry *ce, const zend_string *property_name);
255
ZEND_API zend_function *zend_std_get_constructor(zend_object *object);
256
ZEND_API struct _zend_property_info *zend_get_property_info(const zend_class_entry *ce, zend_string *member, int silent);
257
ZEND_API HashTable *zend_std_get_properties(zend_object *object);
258
ZEND_API HashTable *zend_get_properties_no_lazy_init(zend_object *zobj);
259
ZEND_API HashTable *zend_std_get_gc(zend_object *object, zval **table, int *n);
260
ZEND_API HashTable *zend_std_get_debug_info(zend_object *object, int *is_temp);
261
ZEND_API zend_result zend_std_cast_object_tostring(zend_object *object, zval *writeobj, int type);
262
ZEND_API zval *zend_std_get_property_ptr_ptr(zend_object *object, zend_string *member, int type, void **cache_slot);
263
ZEND_API zval *zend_std_read_property(zend_object *object, zend_string *member, int type, void **cache_slot, zval *rv);
264
ZEND_API zval *zend_std_write_property(zend_object *object, zend_string *member, zval *value, void **cache_slot);
265
ZEND_API int zend_std_has_property(zend_object *object, zend_string *member, int has_set_exists, void **cache_slot);
266
ZEND_API void zend_std_unset_property(zend_object *object, zend_string *member, void **cache_slot);
267
ZEND_API zval *zend_std_read_dimension(zend_object *object, zval *offset, int type, zval *rv);
268
ZEND_API void zend_std_write_dimension(zend_object *object, zval *offset, zval *value);
269
ZEND_API int zend_std_has_dimension(zend_object *object, zval *offset, int check_empty);
270
ZEND_API void zend_std_unset_dimension(zend_object *object, zval *offset);
271
ZEND_API zend_function *zend_std_get_method(zend_object **obj_ptr, zend_string *method_name, const zval *key);
272
ZEND_API zend_string *zend_std_get_class_name(const zend_object *zobj);
273
ZEND_API int zend_std_compare_objects(zval *o1, zval *o2);
274
ZEND_API zend_result zend_std_get_closure(zend_object *obj, zend_class_entry **ce_ptr, zend_function **fptr_ptr, zend_object **obj_ptr, bool check_only);
275
/* Use zend_std_get_properties_ex() */
276
ZEND_API HashTable *rebuild_object_properties_internal(zend_object *zobj);
277
ZEND_API ZEND_COLD zend_never_inline void zend_bad_method_call(const zend_function *fbc, const zend_string *method_name, const zend_class_entry *scope);
278
ZEND_API ZEND_COLD zend_never_inline void zend_abstract_method_call(const zend_function *fbc);
279
280
static zend_always_inline HashTable *zend_std_get_properties_ex(zend_object *object)
281
1.55M
{
282
1.55M
  if (UNEXPECTED(zend_lazy_object_must_init(object))) {
283
302
    return zend_lazy_object_get_properties(object);
284
302
  }
285
1.55M
  if (!object->properties) {
286
658k
    return rebuild_object_properties_internal(object);
287
658k
  }
288
898k
  return object->properties;
289
1.55M
}
Unexecuted instantiation: php_date.c:zend_std_get_properties_ex
Unexecuted instantiation: astro.c:zend_std_get_properties_ex
Unexecuted instantiation: dow.c:zend_std_get_properties_ex
Unexecuted instantiation: parse_date.c:zend_std_get_properties_ex
Unexecuted instantiation: parse_tz.c:zend_std_get_properties_ex
Unexecuted instantiation: parse_posix.c:zend_std_get_properties_ex
Unexecuted instantiation: timelib.c:zend_std_get_properties_ex
Unexecuted instantiation: tm2unixtime.c:zend_std_get_properties_ex
Unexecuted instantiation: unixtime2tm.c:zend_std_get_properties_ex
Unexecuted instantiation: parse_iso_intervals.c:zend_std_get_properties_ex
Unexecuted instantiation: interval.c:zend_std_get_properties_ex
Unexecuted instantiation: php_pcre.c:zend_std_get_properties_ex
Unexecuted instantiation: exif.c:zend_std_get_properties_ex
Unexecuted instantiation: hash_adler32.c:zend_std_get_properties_ex
Unexecuted instantiation: hash_crc32.c:zend_std_get_properties_ex
Unexecuted instantiation: hash_fnv.c:zend_std_get_properties_ex
Unexecuted instantiation: hash_gost.c:zend_std_get_properties_ex
Unexecuted instantiation: hash_haval.c:zend_std_get_properties_ex
Unexecuted instantiation: hash_joaat.c:zend_std_get_properties_ex
Unexecuted instantiation: hash_md.c:zend_std_get_properties_ex
Unexecuted instantiation: hash_murmur.c:zend_std_get_properties_ex
Unexecuted instantiation: hash_ripemd.c:zend_std_get_properties_ex
Unexecuted instantiation: hash_sha_ni.c:zend_std_get_properties_ex
Unexecuted instantiation: hash_sha_sse2.c:zend_std_get_properties_ex
Unexecuted instantiation: hash_sha.c:zend_std_get_properties_ex
Unexecuted instantiation: hash_sha3.c:zend_std_get_properties_ex
Unexecuted instantiation: hash_snefru.c:zend_std_get_properties_ex
Unexecuted instantiation: hash_tiger.c:zend_std_get_properties_ex
Unexecuted instantiation: hash_whirlpool.c:zend_std_get_properties_ex
Unexecuted instantiation: hash_xxhash.c:zend_std_get_properties_ex
Unexecuted instantiation: hash.c:zend_std_get_properties_ex
Unexecuted instantiation: json_encoder.c:zend_std_get_properties_ex
Unexecuted instantiation: json_parser.tab.c:zend_std_get_properties_ex
Unexecuted instantiation: json_scanner.c:zend_std_get_properties_ex
Unexecuted instantiation: json.c:zend_std_get_properties_ex
Unexecuted instantiation: php_lexbor.c:zend_std_get_properties_ex
Unexecuted instantiation: csprng.c:zend_std_get_properties_ex
Unexecuted instantiation: engine_mt19937.c:zend_std_get_properties_ex
Unexecuted instantiation: engine_pcgoneseq128xslrr64.c:zend_std_get_properties_ex
Unexecuted instantiation: engine_secure.c:zend_std_get_properties_ex
Unexecuted instantiation: engine_user.c:zend_std_get_properties_ex
Unexecuted instantiation: engine_xoshiro256starstar.c:zend_std_get_properties_ex
Unexecuted instantiation: gammasection.c:zend_std_get_properties_ex
Unexecuted instantiation: random.c:zend_std_get_properties_ex
Unexecuted instantiation: randomizer.c:zend_std_get_properties_ex
Unexecuted instantiation: zend_utils.c:zend_std_get_properties_ex
Unexecuted instantiation: php_reflection.c:zend_std_get_properties_ex
Unexecuted instantiation: php_spl.c:zend_std_get_properties_ex
spl_array.c:zend_std_get_properties_ex
Line
Count
Source
281
173
{
282
173
  if (UNEXPECTED(zend_lazy_object_must_init(object))) {
283
0
    return zend_lazy_object_get_properties(object);
284
0
  }
285
173
  if (!object->properties) {
286
66
    return rebuild_object_properties_internal(object);
287
66
  }
288
107
  return object->properties;
289
173
}
Unexecuted instantiation: spl_directory.c:zend_std_get_properties_ex
spl_dllist.c:zend_std_get_properties_ex
Line
Count
Source
281
10
{
282
10
  if (UNEXPECTED(zend_lazy_object_must_init(object))) {
283
0
    return zend_lazy_object_get_properties(object);
284
0
  }
285
10
  if (!object->properties) {
286
10
    return rebuild_object_properties_internal(object);
287
10
  }
288
0
  return object->properties;
289
10
}
Unexecuted instantiation: spl_exceptions.c:zend_std_get_properties_ex
Unexecuted instantiation: spl_fixedarray.c:zend_std_get_properties_ex
Unexecuted instantiation: spl_functions.c:zend_std_get_properties_ex
Unexecuted instantiation: spl_heap.c:zend_std_get_properties_ex
Unexecuted instantiation: spl_iterators.c:zend_std_get_properties_ex
Unexecuted instantiation: spl_observer.c:zend_std_get_properties_ex
Unexecuted instantiation: array.c:zend_std_get_properties_ex
Unexecuted instantiation: assert.c:zend_std_get_properties_ex
Unexecuted instantiation: base64.c:zend_std_get_properties_ex
Unexecuted instantiation: basic_functions.c:zend_std_get_properties_ex
Unexecuted instantiation: browscap.c:zend_std_get_properties_ex
Unexecuted instantiation: crc32_x86.c:zend_std_get_properties_ex
Unexecuted instantiation: crc32.c:zend_std_get_properties_ex
Unexecuted instantiation: credits.c:zend_std_get_properties_ex
Unexecuted instantiation: crypt.c:zend_std_get_properties_ex
Unexecuted instantiation: css.c:zend_std_get_properties_ex
Unexecuted instantiation: datetime.c:zend_std_get_properties_ex
Unexecuted instantiation: dir.c:zend_std_get_properties_ex
Unexecuted instantiation: dl.c:zend_std_get_properties_ex
Unexecuted instantiation: dns.c:zend_std_get_properties_ex
Unexecuted instantiation: exec.c:zend_std_get_properties_ex
Unexecuted instantiation: file.c:zend_std_get_properties_ex
Unexecuted instantiation: filestat.c:zend_std_get_properties_ex
Unexecuted instantiation: filters.c:zend_std_get_properties_ex
Unexecuted instantiation: flock_compat.c:zend_std_get_properties_ex
Unexecuted instantiation: formatted_print.c:zend_std_get_properties_ex
Unexecuted instantiation: fsock.c:zend_std_get_properties_ex
Unexecuted instantiation: ftok.c:zend_std_get_properties_ex
Unexecuted instantiation: ftp_fopen_wrapper.c:zend_std_get_properties_ex
Unexecuted instantiation: head.c:zend_std_get_properties_ex
Unexecuted instantiation: hrtime.c:zend_std_get_properties_ex
Unexecuted instantiation: html.c:zend_std_get_properties_ex
Unexecuted instantiation: http_fopen_wrapper.c:zend_std_get_properties_ex
Unexecuted instantiation: http.c:zend_std_get_properties_ex
Unexecuted instantiation: image.c:zend_std_get_properties_ex
Unexecuted instantiation: incomplete_class.c:zend_std_get_properties_ex
Unexecuted instantiation: info.c:zend_std_get_properties_ex
Unexecuted instantiation: iptc.c:zend_std_get_properties_ex
Unexecuted instantiation: levenshtein.c:zend_std_get_properties_ex
Unexecuted instantiation: link.c:zend_std_get_properties_ex
Unexecuted instantiation: mail.c:zend_std_get_properties_ex
Unexecuted instantiation: math.c:zend_std_get_properties_ex
Unexecuted instantiation: md5.c:zend_std_get_properties_ex
Unexecuted instantiation: metaphone.c:zend_std_get_properties_ex
Unexecuted instantiation: microtime.c:zend_std_get_properties_ex
Unexecuted instantiation: net.c:zend_std_get_properties_ex
Unexecuted instantiation: pack.c:zend_std_get_properties_ex
Unexecuted instantiation: pageinfo.c:zend_std_get_properties_ex
Unexecuted instantiation: password.c:zend_std_get_properties_ex
Unexecuted instantiation: php_fopen_wrapper.c:zend_std_get_properties_ex
Unexecuted instantiation: proc_open.c:zend_std_get_properties_ex
Unexecuted instantiation: quot_print.c:zend_std_get_properties_ex
Unexecuted instantiation: scanf.c:zend_std_get_properties_ex
Unexecuted instantiation: sha1.c:zend_std_get_properties_ex
Unexecuted instantiation: soundex.c:zend_std_get_properties_ex
Unexecuted instantiation: streamsfuncs.c:zend_std_get_properties_ex
Unexecuted instantiation: string.c:zend_std_get_properties_ex
Unexecuted instantiation: strnatcmp.c:zend_std_get_properties_ex
Unexecuted instantiation: syslog.c:zend_std_get_properties_ex
Unexecuted instantiation: type.c:zend_std_get_properties_ex
Unexecuted instantiation: uniqid.c:zend_std_get_properties_ex
Unexecuted instantiation: url_scanner_ex.c:zend_std_get_properties_ex
Unexecuted instantiation: url.c:zend_std_get_properties_ex
Unexecuted instantiation: user_filters.c:zend_std_get_properties_ex
Unexecuted instantiation: uuencode.c:zend_std_get_properties_ex
Unexecuted instantiation: var_unserializer.c:zend_std_get_properties_ex
Unexecuted instantiation: var.c:zend_std_get_properties_ex
Unexecuted instantiation: versioning.c:zend_std_get_properties_ex
Unexecuted instantiation: crypt_sha256.c:zend_std_get_properties_ex
Unexecuted instantiation: crypt_sha512.c:zend_std_get_properties_ex
Unexecuted instantiation: php_crypt_r.c:zend_std_get_properties_ex
Unexecuted instantiation: php_uri.c:zend_std_get_properties_ex
Unexecuted instantiation: php_uri_common.c:zend_std_get_properties_ex
Unexecuted instantiation: php_uriparser.c:zend_std_get_properties_ex
Unexecuted instantiation: explicit_bzero.c:zend_std_get_properties_ex
Unexecuted instantiation: fopen_wrappers.c:zend_std_get_properties_ex
Unexecuted instantiation: getopt.c:zend_std_get_properties_ex
Unexecuted instantiation: main.c:zend_std_get_properties_ex
Unexecuted instantiation: network.c:zend_std_get_properties_ex
Unexecuted instantiation: output.c:zend_std_get_properties_ex
Unexecuted instantiation: php_content_types.c:zend_std_get_properties_ex
Unexecuted instantiation: php_ini_builder.c:zend_std_get_properties_ex
Unexecuted instantiation: php_ini.c:zend_std_get_properties_ex
Unexecuted instantiation: php_glob.c:zend_std_get_properties_ex
Unexecuted instantiation: php_odbc_utils.c:zend_std_get_properties_ex
Unexecuted instantiation: php_open_temporary_file.c:zend_std_get_properties_ex
Unexecuted instantiation: php_scandir.c:zend_std_get_properties_ex
Unexecuted instantiation: php_syslog.c:zend_std_get_properties_ex
Unexecuted instantiation: php_ticks.c:zend_std_get_properties_ex
Unexecuted instantiation: php_variables.c:zend_std_get_properties_ex
Unexecuted instantiation: reentrancy.c:zend_std_get_properties_ex
Unexecuted instantiation: rfc1867.c:zend_std_get_properties_ex
Unexecuted instantiation: safe_bcmp.c:zend_std_get_properties_ex
Unexecuted instantiation: SAPI.c:zend_std_get_properties_ex
Unexecuted instantiation: snprintf.c:zend_std_get_properties_ex
Unexecuted instantiation: spprintf.c:zend_std_get_properties_ex
Unexecuted instantiation: strlcat.c:zend_std_get_properties_ex
Unexecuted instantiation: strlcpy.c:zend_std_get_properties_ex
Unexecuted instantiation: cast.c:zend_std_get_properties_ex
Unexecuted instantiation: filter.c:zend_std_get_properties_ex
Unexecuted instantiation: glob_wrapper.c:zend_std_get_properties_ex
Unexecuted instantiation: memory.c:zend_std_get_properties_ex
Unexecuted instantiation: mmap.c:zend_std_get_properties_ex
Unexecuted instantiation: plain_wrapper.c:zend_std_get_properties_ex
Unexecuted instantiation: streams.c:zend_std_get_properties_ex
Unexecuted instantiation: transports.c:zend_std_get_properties_ex
Unexecuted instantiation: userspace.c:zend_std_get_properties_ex
Unexecuted instantiation: xp_socket.c:zend_std_get_properties_ex
Unexecuted instantiation: block_pass.c:zend_std_get_properties_ex
Unexecuted instantiation: compact_literals.c:zend_std_get_properties_ex
Unexecuted instantiation: compact_vars.c:zend_std_get_properties_ex
Unexecuted instantiation: dce.c:zend_std_get_properties_ex
Unexecuted instantiation: dfa_pass.c:zend_std_get_properties_ex
Unexecuted instantiation: escape_analysis.c:zend_std_get_properties_ex
Unexecuted instantiation: nop_removal.c:zend_std_get_properties_ex
Unexecuted instantiation: optimize_func_calls.c:zend_std_get_properties_ex
Unexecuted instantiation: optimize_temp_vars_5.c:zend_std_get_properties_ex
Unexecuted instantiation: pass1.c:zend_std_get_properties_ex
Unexecuted instantiation: pass3.c:zend_std_get_properties_ex
Unexecuted instantiation: sccp.c:zend_std_get_properties_ex
Unexecuted instantiation: scdf.c:zend_std_get_properties_ex
Unexecuted instantiation: zend_call_graph.c:zend_std_get_properties_ex
Unexecuted instantiation: zend_cfg.c:zend_std_get_properties_ex
Unexecuted instantiation: zend_dfg.c:zend_std_get_properties_ex
Unexecuted instantiation: zend_dump.c:zend_std_get_properties_ex
Unexecuted instantiation: zend_func_info.c:zend_std_get_properties_ex
Unexecuted instantiation: zend_inference.c:zend_std_get_properties_ex
Unexecuted instantiation: zend_optimizer.c:zend_std_get_properties_ex
Unexecuted instantiation: zend_ssa.c:zend_std_get_properties_ex
Unexecuted instantiation: zend_alloc.c:zend_std_get_properties_ex
zend_API.c:zend_std_get_properties_ex
Line
Count
Source
281
82.8k
{
282
82.8k
  if (UNEXPECTED(zend_lazy_object_must_init(object))) {
283
0
    return zend_lazy_object_get_properties(object);
284
0
  }
285
82.8k
  if (!object->properties) {
286
36.1k
    return rebuild_object_properties_internal(object);
287
36.1k
  }
288
46.7k
  return object->properties;
289
82.8k
}
Unexecuted instantiation: zend_ast.c:zend_std_get_properties_ex
Unexecuted instantiation: zend_attributes.c:zend_std_get_properties_ex
Unexecuted instantiation: zend_builtin_functions.c:zend_std_get_properties_ex
Unexecuted instantiation: zend_call_stack.c:zend_std_get_properties_ex
Unexecuted instantiation: zend_closures.c:zend_std_get_properties_ex
Unexecuted instantiation: zend_compile.c:zend_std_get_properties_ex
Unexecuted instantiation: zend_constants.c:zend_std_get_properties_ex
Unexecuted instantiation: zend_cpuinfo.c:zend_std_get_properties_ex
Unexecuted instantiation: zend_default_classes.c:zend_std_get_properties_ex
Unexecuted instantiation: zend_dtrace.c:zend_std_get_properties_ex
Unexecuted instantiation: zend_enum.c:zend_std_get_properties_ex
Unexecuted instantiation: zend_exceptions.c:zend_std_get_properties_ex
Unexecuted instantiation: zend_execute_API.c:zend_std_get_properties_ex
Unexecuted instantiation: zend_execute.c:zend_std_get_properties_ex
Unexecuted instantiation: zend_extensions.c:zend_std_get_properties_ex
Unexecuted instantiation: zend_fibers.c:zend_std_get_properties_ex
Unexecuted instantiation: zend_float.c:zend_std_get_properties_ex
Unexecuted instantiation: zend_gc.c:zend_std_get_properties_ex
Unexecuted instantiation: zend_gdb.c:zend_std_get_properties_ex
Unexecuted instantiation: zend_generators.c:zend_std_get_properties_ex
Unexecuted instantiation: zend_hash.c:zend_std_get_properties_ex
Unexecuted instantiation: zend_highlight.c:zend_std_get_properties_ex
Unexecuted instantiation: zend_hrtime.c:zend_std_get_properties_ex
Unexecuted instantiation: zend_inheritance.c:zend_std_get_properties_ex
Unexecuted instantiation: zend_ini_parser.c:zend_std_get_properties_ex
Unexecuted instantiation: zend_ini_scanner.c:zend_std_get_properties_ex
Unexecuted instantiation: zend_ini.c:zend_std_get_properties_ex
Unexecuted instantiation: zend_interfaces.c:zend_std_get_properties_ex
Unexecuted instantiation: zend_iterators.c:zend_std_get_properties_ex
Unexecuted instantiation: zend_language_parser.c:zend_std_get_properties_ex
Unexecuted instantiation: zend_language_scanner.c:zend_std_get_properties_ex
zend_lazy_objects.c:zend_std_get_properties_ex
Line
Count
Source
281
243
{
282
243
  if (UNEXPECTED(zend_lazy_object_must_init(object))) {
283
0
    return zend_lazy_object_get_properties(object);
284
0
  }
285
243
  if (!object->properties) {
286
151
    return rebuild_object_properties_internal(object);
287
151
  }
288
92
  return object->properties;
289
243
}
Unexecuted instantiation: zend_list.c:zend_std_get_properties_ex
Unexecuted instantiation: zend_llist.c:zend_std_get_properties_ex
Unexecuted instantiation: zend_multibyte.c:zend_std_get_properties_ex
zend_object_handlers.c:zend_std_get_properties_ex
Line
Count
Source
281
1.47M
{
282
1.47M
  if (UNEXPECTED(zend_lazy_object_must_init(object))) {
283
302
    return zend_lazy_object_get_properties(object);
284
302
  }
285
1.47M
  if (!object->properties) {
286
621k
    return rebuild_object_properties_internal(object);
287
621k
  }
288
851k
  return object->properties;
289
1.47M
}
Unexecuted instantiation: zend_objects_API.c:zend_std_get_properties_ex
Unexecuted instantiation: zend_objects.c:zend_std_get_properties_ex
Unexecuted instantiation: zend_observer.c:zend_std_get_properties_ex
Unexecuted instantiation: zend_opcode.c:zend_std_get_properties_ex
Unexecuted instantiation: zend_operators.c:zend_std_get_properties_ex
Unexecuted instantiation: zend_property_hooks.c:zend_std_get_properties_ex
Unexecuted instantiation: zend_ptr_stack.c:zend_std_get_properties_ex
Unexecuted instantiation: zend_signal.c:zend_std_get_properties_ex
Unexecuted instantiation: zend_smart_str.c:zend_std_get_properties_ex
Unexecuted instantiation: zend_sort.c:zend_std_get_properties_ex
Unexecuted instantiation: zend_stack.c:zend_std_get_properties_ex
Unexecuted instantiation: zend_stream.c:zend_std_get_properties_ex
Unexecuted instantiation: zend_string.c:zend_std_get_properties_ex
Unexecuted instantiation: zend_strtod.c:zend_std_get_properties_ex
Unexecuted instantiation: zend_system_id.c:zend_std_get_properties_ex
Unexecuted instantiation: zend_variables.c:zend_std_get_properties_ex
Unexecuted instantiation: zend_virtual_cwd.c:zend_std_get_properties_ex
Unexecuted instantiation: zend_vm_opcodes.c:zend_std_get_properties_ex
Unexecuted instantiation: zend_weakrefs.c:zend_std_get_properties_ex
Unexecuted instantiation: zend.c:zend_std_get_properties_ex
Unexecuted instantiation: internal_functions_cli.c:zend_std_get_properties_ex
Unexecuted instantiation: fuzzer-parser.c:zend_std_get_properties_ex
Unexecuted instantiation: fuzzer-sapi.c:zend_std_get_properties_ex
Unexecuted instantiation: fuzzer-tracing-jit.c:zend_std_get_properties_ex
Unexecuted instantiation: fuzzer-exif.c:zend_std_get_properties_ex
Unexecuted instantiation: fuzzer-unserialize.c:zend_std_get_properties_ex
Unexecuted instantiation: fuzzer-function-jit.c:zend_std_get_properties_ex
Unexecuted instantiation: fuzzer-json.c:zend_std_get_properties_ex
Unexecuted instantiation: fuzzer-unserializehash.c:zend_std_get_properties_ex
Unexecuted instantiation: fuzzer-execute.c:zend_std_get_properties_ex
290
291
/* Implements the fast path for array cast */
292
ZEND_API HashTable *zend_std_build_object_properties_array(zend_object *zobj);
293
294
288
#define ZEND_STD_BUILD_OBJECT_PROPERTIES_ARRAY_COMPATIBLE(object) (            \
295
288
    /* We can use zend_std_build_object_properties_array() for objects     \
296
288
     * without properties ht and with standard handlers */                 \
297
288
    Z_OBJ_P(object)->properties == NULL                                    \
298
288
    && Z_OBJ_HT_P(object)->get_properties_for == NULL                      \
299
288
    && Z_OBJ_HT_P(object)->get_properties == zend_std_get_properties       \
300
288
    /* For initialized proxies we need to forward to the real instance */  \
301
288
    && (                                                                   \
302
145
      !zend_object_is_lazy_proxy(Z_OBJ_P(object))                        \
303
145
      || !zend_lazy_object_initialized(Z_OBJ_P(object))                  \
304
145
    )                                                                      \
305
288
)
306
307
/* Handler for objects that cannot be meaningfully compared.
308
 * Only objects with the same identity will be considered equal. */
309
ZEND_API int zend_objects_not_comparable(zval *o1, zval *o2);
310
311
ZEND_API bool zend_check_protected(const zend_class_entry *ce, const zend_class_entry *scope);
312
313
ZEND_API zend_result zend_check_property_access(const zend_object *zobj, zend_string *prop_info_name, bool is_dynamic);
314
315
ZEND_API zend_function *zend_get_call_trampoline_func(const zend_class_entry *ce, zend_string *method_name, bool is_static);
316
317
ZEND_API uint32_t *zend_get_property_guard(zend_object *zobj, zend_string *member);
318
319
ZEND_API uint32_t *zend_get_property_guard(zend_object *zobj, zend_string *member);
320
321
ZEND_API uint32_t *zend_get_recursion_guard(zend_object *zobj);
322
323
/* Default behavior for get_properties_for. For use as a fallback in custom
324
 * get_properties_for implementations. */
325
ZEND_API HashTable *zend_std_get_properties_for(zend_object *obj, zend_prop_purpose purpose);
326
327
/* Will call get_properties_for handler or use default behavior. For use by
328
 * consumers of the get_properties_for API. */
329
ZEND_API HashTable *zend_get_properties_for(zval *obj, zend_prop_purpose purpose);
330
331
typedef struct _zend_property_info zend_property_info;
332
333
ZEND_API zend_function *zend_get_property_hook_trampoline(
334
  const zend_property_info *prop_info,
335
  zend_property_hook_kind kind, zend_string *prop_name);
336
337
ZEND_API bool ZEND_FASTCALL zend_asymmetric_property_has_set_access(const zend_property_info *prop_info);
338
339
10.8k
#define zend_release_properties(ht) do { \
340
10.8k
  if (ht) { \
341
10.8k
    zend_array_release(ht); \
342
10.8k
  } \
343
10.8k
} while (0)
344
345
3.96k
#define zend_free_trampoline(func) do { \
346
3.96k
    if ((func) == &EG(trampoline)) { \
347
3.72k
      EG(trampoline).common.attributes = NULL; \
348
3.72k
      EG(trampoline).common.function_name = NULL; \
349
3.72k
    } else { \
350
239
      efree(func); \
351
239
    } \
352
3.96k
  } while (0)
353
354
/* Fallback to default comparison implementation if the arguments aren't both objects
355
 * and have the same compare() handler. You'll likely want to use this unless you
356
 * explicitly wish to support comparisons between objects and non-objects. */
357
#define ZEND_COMPARE_OBJECTS_FALLBACK(op1, op2) \
358
209
  if (Z_TYPE_P(op1) != IS_OBJECT || \
359
209
      Z_TYPE_P(op2) != IS_OBJECT || \
360
209
      Z_OBJ_HT_P(op1)->compare != Z_OBJ_HT_P(op2)->compare) { \
361
23
    return zend_std_compare_objects(op1, op2); \
362
23
  }
363
364
END_EXTERN_C()
365
366
#endif