Coverage Report

Created: 2025-06-13 06:43

/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
46.3k
  ((struct _zend_property_info*)((intptr_t)-1))
34
35
61.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.20k
  ((intptr_t)(offset) > 0 && (intptr_t)(offset) < 16)
45
#define IS_DYNAMIC_PROPERTY_OFFSET(offset)         ((intptr_t)(offset) < 0)
46
47
4.13k
#define ZEND_PROPERTY_HOOK_SIMPLE_READ_BIT 2u
48
1.90k
#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.13k
  (((offset) & ZEND_PROPERTY_HOOK_SIMPLE_READ_BIT) != 0)
52
#define ZEND_IS_PROPERTY_HOOK_SIMPLE_WRITE(offset) \
53
1.90k
  (((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
411
  do { \
58
411
    void **__cache_slot = (cache_slot); \
59
411
    if (__cache_slot) { \
60
376
      CACHE_PTR_EX(__cache_slot + 1, (void*)((uintptr_t)CACHED_PTR_EX(__cache_slot + 1) | ZEND_PROPERTY_HOOK_SIMPLE_READ_BIT)); \
61
376
    } \
62
411
  } while (0)
63
#define ZEND_SET_PROPERTY_HOOK_SIMPLE_WRITE(cache_slot) \
64
232
  do { \
65
232
    void **__cache_slot = (cache_slot); \
66
232
    if (__cache_slot) { \
67
232
      CACHE_PTR_EX(__cache_slot + 1, (void*)((uintptr_t)CACHED_PTR_EX(__cache_slot + 1) | ZEND_PROPERTY_HOOK_SIMPLE_WRITE_BIT)); \
68
232
    } \
69
232
  } while (0)
70
#define ZEND_SET_PROPERTY_HOOK_SIMPLE_GET(cache_slot) \
71
360
  do { \
72
360
    void **__cache_slot = (cache_slot); \
73
360
    if (__cache_slot) { \
74
360
      CACHE_PTR_EX(__cache_slot + 1, (void*)((uintptr_t)CACHED_PTR_EX(__cache_slot + 1) | ZEND_PROPERTY_HOOK_SIMPLE_GET_BIT)); \
75
360
    } \
76
360
  } while (0)
77
78
2.51k
#define IS_UNKNOWN_DYNAMIC_PROPERTY_OFFSET(offset) (offset == ZEND_DYNAMIC_PROPERTY_OFFSET)
79
458
#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
184
/* Get class name for display in var_dump and other debugging functions.
185
 * Must be defined and must return a non-NULL value. */
186
typedef zend_string *(*zend_object_get_class_name_t)(const zend_object *object);
187
188
typedef int (*zend_object_compare_t)(zval *object1, zval *object2);
189
190
/* Cast an object to some other type.
191
 * readobj and retval must point to distinct zvals.
192
 */
193
typedef zend_result (*zend_object_cast_t)(zend_object *readobj, zval *retval, int type);
194
195
/* updates *count to hold the number of elements present and returns SUCCESS.
196
 * Returns FAILURE if the object does not have any sense of overloaded dimensions */
197
typedef zend_result (*zend_object_count_elements_t)(zend_object *object, zend_long *count);
198
199
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);
200
201
typedef HashTable *(*zend_object_get_gc_t)(zend_object *object, zval **table, int *n);
202
203
typedef zend_result (*zend_object_do_operation_t)(uint8_t opcode, zval *result, zval *op1, zval *op2);
204
205
struct _zend_object_handlers {
206
  /* offset of real object header (usually zero) */
207
  int                   offset;
208
  /* object handlers */
209
  zend_object_free_obj_t          free_obj;             /* required */
210
  zend_object_dtor_obj_t          dtor_obj;             /* required */
211
  zend_object_clone_obj_t         clone_obj;            /* optional */
212
  zend_object_read_property_t       read_property;        /* required */
213
  zend_object_write_property_t      write_property;       /* required */
214
  zend_object_read_dimension_t      read_dimension;       /* required */
215
  zend_object_write_dimension_t     write_dimension;      /* required */
216
  zend_object_get_property_ptr_ptr_t    get_property_ptr_ptr; /* required */
217
  zend_object_has_property_t        has_property;         /* required */
218
  zend_object_unset_property_t      unset_property;       /* required */
219
  zend_object_has_dimension_t       has_dimension;        /* required */
220
  zend_object_unset_dimension_t     unset_dimension;      /* required */
221
  zend_object_get_properties_t      get_properties;       /* required */
222
  zend_object_get_method_t        get_method;           /* required */
223
  zend_object_get_constructor_t     get_constructor;      /* required */
224
  zend_object_get_class_name_t      get_class_name;       /* required */
225
  zend_object_cast_t            cast_object;          /* required */
226
  zend_object_count_elements_t      count_elements;       /* optional */
227
  zend_object_get_debug_info_t      get_debug_info;       /* optional */
228
  zend_object_get_closure_t       get_closure;          /* optional */
229
  zend_object_get_gc_t          get_gc;               /* required */
230
  zend_object_do_operation_t        do_operation;         /* optional */
231
  zend_object_compare_t         compare;              /* required */
232
  zend_object_get_properties_for_t    get_properties_for;   /* optional */
233
};
234
235
BEGIN_EXTERN_C()
236
extern const ZEND_API zend_object_handlers std_object_handlers;
237
238
#define zend_get_std_object_handlers() \
239
128
  (&std_object_handlers)
240
241
#define zend_get_function_root_class(fbc) \
242
125
  ((fbc)->common.prototype ? (fbc)->common.prototype->common.scope : (fbc)->common.scope)
243
244
0
#define ZEND_PROPERTY_ISSET     0x0          /* Property exists and is not NULL */
245
496
#define ZEND_PROPERTY_NOT_EMPTY ZEND_ISEMPTY /* Property is not empty */
246
306
#define ZEND_PROPERTY_EXISTS    0x2          /* Property exists */
247
248
ZEND_API void zend_class_init_statics(zend_class_entry *ce);
249
ZEND_API zend_function *zend_std_get_static_method(zend_class_entry *ce, zend_string *function_name_strval, const zval *key);
250
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);
251
ZEND_API zval *zend_std_get_static_property(zend_class_entry *ce, zend_string *property_name, int type);
252
ZEND_API ZEND_COLD bool zend_std_unset_static_property(zend_class_entry *ce, zend_string *property_name);
253
ZEND_API zend_function *zend_std_get_constructor(zend_object *object);
254
ZEND_API struct _zend_property_info *zend_get_property_info(const zend_class_entry *ce, zend_string *member, int silent);
255
ZEND_API HashTable *zend_std_get_properties(zend_object *object);
256
ZEND_API HashTable *zend_get_properties_no_lazy_init(zend_object *zobj);
257
ZEND_API HashTable *zend_std_get_gc(zend_object *object, zval **table, int *n);
258
ZEND_API HashTable *zend_std_get_debug_info(zend_object *object, int *is_temp);
259
ZEND_API zend_result zend_std_cast_object_tostring(zend_object *object, zval *writeobj, int type);
260
ZEND_API zval *zend_std_get_property_ptr_ptr(zend_object *object, zend_string *member, int type, void **cache_slot);
261
ZEND_API zval *zend_std_read_property(zend_object *object, zend_string *member, int type, void **cache_slot, zval *rv);
262
ZEND_API zval *zend_std_write_property(zend_object *object, zend_string *member, zval *value, void **cache_slot);
263
ZEND_API int zend_std_has_property(zend_object *object, zend_string *member, int has_set_exists, void **cache_slot);
264
ZEND_API void zend_std_unset_property(zend_object *object, zend_string *member, void **cache_slot);
265
ZEND_API zval *zend_std_read_dimension(zend_object *object, zval *offset, int type, zval *rv);
266
ZEND_API void zend_std_write_dimension(zend_object *object, zval *offset, zval *value);
267
ZEND_API int zend_std_has_dimension(zend_object *object, zval *offset, int check_empty);
268
ZEND_API void zend_std_unset_dimension(zend_object *object, zval *offset);
269
ZEND_API zend_function *zend_std_get_method(zend_object **obj_ptr, zend_string *method_name, const zval *key);
270
ZEND_API zend_string *zend_std_get_class_name(const zend_object *zobj);
271
ZEND_API int zend_std_compare_objects(zval *o1, zval *o2);
272
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);
273
/* Use zend_std_get_properties_ex() */
274
ZEND_API HashTable *rebuild_object_properties_internal(zend_object *zobj);
275
ZEND_API ZEND_COLD zend_never_inline void zend_bad_method_call(zend_function *fbc, zend_string *method_name, zend_class_entry *scope);
276
ZEND_API ZEND_COLD zend_never_inline void zend_abstract_method_call(zend_function *fbc);
277
278
static zend_always_inline HashTable *zend_std_get_properties_ex(zend_object *object)
279
1.81M
{
280
1.81M
  if (UNEXPECTED(zend_lazy_object_must_init(object))) {
281
323
    return zend_lazy_object_get_properties(object);
282
323
  }
283
1.81M
  if (!object->properties) {
284
787k
    return rebuild_object_properties_internal(object);
285
787k
  }
286
1.02M
  return object->properties;
287
1.81M
}
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
279
177
{
280
177
  if (UNEXPECTED(zend_lazy_object_must_init(object))) {
281
0
    return zend_lazy_object_get_properties(object);
282
0
  }
283
177
  if (!object->properties) {
284
70
    return rebuild_object_properties_internal(object);
285
70
  }
286
107
  return object->properties;
287
177
}
Unexecuted instantiation: spl_directory.c:zend_std_get_properties_ex
spl_dllist.c:zend_std_get_properties_ex
Line
Count
Source
279
10
{
280
10
  if (UNEXPECTED(zend_lazy_object_must_init(object))) {
281
0
    return zend_lazy_object_get_properties(object);
282
0
  }
283
10
  if (!object->properties) {
284
10
    return rebuild_object_properties_internal(object);
285
10
  }
286
0
  return object->properties;
287
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: 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
279
64.9k
{
280
64.9k
  if (UNEXPECTED(zend_lazy_object_must_init(object))) {
281
0
    return zend_lazy_object_get_properties(object);
282
0
  }
283
64.9k
  if (!object->properties) {
284
27.6k
    return rebuild_object_properties_internal(object);
285
27.6k
  }
286
37.3k
  return object->properties;
287
64.9k
}
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
279
262
{
280
262
  if (UNEXPECTED(zend_lazy_object_must_init(object))) {
281
0
    return zend_lazy_object_get_properties(object);
282
0
  }
283
262
  if (!object->properties) {
284
148
    return rebuild_object_properties_internal(object);
285
148
  }
286
114
  return object->properties;
287
262
}
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
279
1.75M
{
280
1.75M
  if (UNEXPECTED(zend_lazy_object_must_init(object))) {
281
323
    return zend_lazy_object_get_properties(object);
282
323
  }
283
1.75M
  if (!object->properties) {
284
759k
    return rebuild_object_properties_internal(object);
285
759k
  }
286
991k
  return object->properties;
287
1.75M
}
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
288
289
/* Implements the fast path for array cast */
290
ZEND_API HashTable *zend_std_build_object_properties_array(zend_object *zobj);
291
292
266
#define ZEND_STD_BUILD_OBJECT_PROPERTIES_ARRAY_COMPATIBLE(object) (            \
293
266
    /* We can use zend_std_build_object_properties_array() for objects     \
294
266
     * without properties ht and with standard handlers */                 \
295
266
    Z_OBJ_P(object)->properties == NULL                                    \
296
266
    && Z_OBJ_HT_P(object)->get_properties_for == NULL                      \
297
266
    && Z_OBJ_HT_P(object)->get_properties == zend_std_get_properties       \
298
266
    /* For initialized proxies we need to forward to the real instance */  \
299
266
    && (                                                                   \
300
138
      !zend_object_is_lazy_proxy(Z_OBJ_P(object))                        \
301
138
      || !zend_lazy_object_initialized(Z_OBJ_P(object))                  \
302
138
    )                                                                      \
303
266
)
304
305
/* Handler for objects that cannot be meaningfully compared.
306
 * Only objects with the same identity will be considered equal. */
307
ZEND_API int zend_objects_not_comparable(zval *o1, zval *o2);
308
309
ZEND_API bool zend_check_protected(const zend_class_entry *ce, const zend_class_entry *scope);
310
311
ZEND_API zend_result zend_check_property_access(const zend_object *zobj, zend_string *prop_info_name, bool is_dynamic);
312
313
ZEND_API zend_function *zend_get_call_trampoline_func(const zend_class_entry *ce, zend_string *method_name, bool is_static);
314
315
ZEND_API uint32_t *zend_get_property_guard(zend_object *zobj, zend_string *member);
316
317
ZEND_API uint32_t *zend_get_property_guard(zend_object *zobj, zend_string *member);
318
319
ZEND_API uint32_t *zend_get_recursion_guard(zend_object *zobj);
320
321
/* Default behavior for get_properties_for. For use as a fallback in custom
322
 * get_properties_for implementations. */
323
ZEND_API HashTable *zend_std_get_properties_for(zend_object *obj, zend_prop_purpose purpose);
324
325
/* Will call get_properties_for handler or use default behavior. For use by
326
 * consumers of the get_properties_for API. */
327
ZEND_API HashTable *zend_get_properties_for(zval *obj, zend_prop_purpose purpose);
328
329
typedef struct _zend_property_info zend_property_info;
330
331
ZEND_API zend_function *zend_get_property_hook_trampoline(
332
  const zend_property_info *prop_info,
333
  zend_property_hook_kind kind, zend_string *prop_name);
334
335
ZEND_API bool ZEND_FASTCALL zend_asymmetric_property_has_set_access(const zend_property_info *prop_info);
336
337
11.0k
#define zend_release_properties(ht) do { \
338
11.0k
  if (ht) { \
339
10.9k
    zend_array_release(ht); \
340
10.9k
  } \
341
11.0k
} while (0)
342
343
3.89k
#define zend_free_trampoline(func) do { \
344
3.89k
    if ((func) == &EG(trampoline)) { \
345
3.65k
      EG(trampoline).common.attributes = NULL; \
346
3.65k
      EG(trampoline).common.function_name = NULL; \
347
3.65k
    } else { \
348
235
      efree(func); \
349
235
    } \
350
3.89k
  } while (0)
351
352
/* Fallback to default comparison implementation if the arguments aren't both objects
353
 * and have the same compare() handler. You'll likely want to use this unless you
354
 * explicitly wish to support comparisons between objects and non-objects. */
355
#define ZEND_COMPARE_OBJECTS_FALLBACK(op1, op2) \
356
183
  if (Z_TYPE_P(op1) != IS_OBJECT || \
357
183
      Z_TYPE_P(op2) != IS_OBJECT || \
358
183
      Z_OBJ_HT_P(op1)->compare != Z_OBJ_HT_P(op2)->compare) { \
359
46
    return zend_std_compare_objects(op1, op2); \
360
46
  }
361
362
END_EXTERN_C()
363
364
#endif