44#define SOS_OVERRIDDEN_READ_DIMENSION 1
45#define SOS_OVERRIDDEN_WRITE_DIMENSION 2
46#define SOS_OVERRIDDEN_UNSET_DIMENSION 4
70#define Z_SPLOBJSTORAGE_P(zv) spl_object_storage_from_obj(Z_OBJ_P((zv)))
72static void spl_SplObjectStorage_free_storage(
zend_object *
object)
93 zend_type_error(
"%s::getHash(): Return value must be of type string, %s returned",
115static void spl_object_storage_dtor(
zval *element)
119 zend_object_release(el->
obj);
128 return zend_hash_find_ptr(&intern->
storage,
key->key);
130 return zend_hash_index_find_ptr(&intern->
storage,
key->h);
172 pelement = spl_object_storage_create_element(obj, inf);
180 return spl_object_storage_attach_handle(intern, obj, inf);
186 if (spl_object_storage_get_hash(&
key, intern, obj) ==
FAILURE) {
190 pelement = spl_object_storage_get(intern, &
key);
200 spl_object_storage_free_hash(intern, &
key);
218 spl_object_storage_free_hash(intern, &
key);
229 if (spl_object_storage_get_hash(&
key, intern, obj) ==
FAILURE) {
237 spl_object_storage_free_hash(intern, &
key);
246 spl_object_storage_attach(intern, element->
obj, &element->
inf);
252#define SPL_OBJECT_STORAGE_CLASS_HAS_OVERRIDE(class_type, zstr_method) \
253 (class_type->arrayaccess_funcs_ptr && class_type->arrayaccess_funcs_ptr->zstr_method)
297 parent = parent->parent;
302 spl_object_storage_addall(intern, other);
314 new_object = spl_object_storage_new_ex(old_object->
ce, old_object);
361 zend_get_gc_buffer_add_obj(gc_buffer, element->
obj);
362 zend_get_gc_buffer_add_zval(gc_buffer, &element->
inf);
365 zend_get_gc_buffer_use(gc_buffer, table,
n);
370static int spl_object_storage_compare_info(
zval *e1,
zval *e2)
379static int spl_object_storage_compare_objects(
zval *o1,
zval *o2)
400 return spl_object_storage_new_ex(class_type,
NULL);
411 if (spl_object_storage_get_hash(&
key, intern, obj) ==
FAILURE) {
416 bool found = zend_hash_exists(&intern->
storage,
key.key);
435 spl_object_storage_attach(intern, obj, inf);
452 return i_zend_is_true(&element->
inf);
469 return &
EG(uninitialized_zval);
488 spl_object_storage_attach_handle(intern,
Z_OBJ_P(
offset), inf);
510 spl_object_storage_detach(intern, obj);
541 if (spl_object_storage_get_hash(&
key, intern, obj) ==
FAILURE) {
545 element = spl_object_storage_get(intern, &
key);
546 spl_object_storage_free_hash(intern, &
key);
568 spl_object_storage_addall(intern, other);
587 zend_hash_internal_pointer_reset(&other->
storage);
589 if (spl_object_storage_detach(intern, element->
obj) ==
FAILURE) {
590 zend_hash_move_forward(&other->
storage);
615 if (!spl_object_storage_contains(other, element->
obj)) {
616 spl_object_storage_detach(intern, element->
obj);
636 RETURN_BOOL(spl_object_storage_contains(intern, obj));
703 if ((element = zend_hash_get_current_data_ptr_ex(&intern->
storage, &intern->
pos)) ==
NULL) {
720 if ((element = zend_hash_get_current_data_ptr_ex(&intern->
storage, &intern->
pos)) ==
NULL) {
737 if ((element = zend_hash_get_current_data_ptr_ex(&intern->
storage, &intern->
pos)) ==
NULL) {
769 if (position < 0 || position >= zend_hash_num_elements(&intern->
storage)) {
778 }
else if (position > intern->
index) {
783 }
while (position > intern->
index);
784 }
else if (position < intern->index) {
786 if (intern->
index - position > position) {
792 }
while (position > intern->
index);
797 }
while (position < intern->index);
820 smart_str_appendl(&
buf,
"x:", 2);
828 if ((element = zend_hash_get_current_data_ptr_ex(&intern->
storage, &
pos)) ==
NULL) {
829 smart_str_free(&
buf);
840 smart_str_appendc(&
buf,
',');
842 smart_str_appendc(&
buf,
';');
849 smart_str_appendl(&
buf,
"m:", 2);
868 const unsigned char *
p, *
s;
870 zval *pcount, *pmembers;
883 s =
p = (
const unsigned char*)
buf;
886 if (*
p!=
'x' || *++
p !=
':') {
902 while (
count-- > 0) {
913 if(*
p !=
'O' && *
p !=
'C' && *
p !=
'r') {
936 pelement = spl_object_storage_get(intern, &
key);
937 spl_object_storage_free_hash(intern, &
key);
957 if (*
p!=
'm' || *++
p !=
':') {
1023 if (!storage_zv || !members_zv ||
1026 "Incomplete or ill-typed serialization data", 0);
1030 if (zend_hash_num_elements(
Z_ARRVAL_P(storage_zv)) % 2 != 0) {
1065#define SPL_MULTIPLE_ITERATOR_GET_ALL_CURRENT 1
1066#define SPL_MULTIPLE_ITERATOR_GET_ALL_KEY 2
1115 bool info_is_null = 1;
1125 if (!info_is_null) {
1135 while ((element = zend_hash_get_current_data_ptr_ex(&intern->
storage, &intern->
pos)) !=
NULL) {
1136 if (fast_is_identical_function(&zinfo, &element->
inf)) {
1143 spl_object_storage_attach(intern, iterator, &zinfo);
1145 spl_object_storage_attach(intern, iterator,
NULL);
1159 spl_object_storage_detach(intern,
Z_OBJ_P(iterator));
1244 if (!zend_hash_num_elements(&intern->
storage)) {
1262 if (expect != valid) {
1277 int valid = 1, num_elements;
1279 num_elements = zend_hash_num_elements(&intern->
storage);
1280 if (num_elements < 1) {
1384 spl_handler_SplObjectStorage.compare = spl_object_storage_compare_objects;
1385 spl_handler_SplObjectStorage.clone_obj = spl_object_storage_clone;
1386 spl_handler_SplObjectStorage.get_gc = spl_object_storage_get_gc;
1387 spl_handler_SplObjectStorage.free_obj = spl_SplObjectStorage_free_storage;
1388 spl_handler_SplObjectStorage.read_dimension = spl_object_storage_read_dimension;
1389 spl_handler_SplObjectStorage.write_dimension = spl_object_storage_write_dimension;
1390 spl_handler_SplObjectStorage.has_dimension = spl_object_storage_has_dimension;
1391 spl_handler_SplObjectStorage.unset_dimension = spl_object_storage_unset_dimension;
file_private int get_type(const struct type_tbl_s *tbl, const char *l, const char **t)
count(Countable|array $value, int $mode=COUNT_NORMAL)
memset(ptr, 0, type->size)
zend_ffi_ctype_name_buf buf
#define PHP_MINIT_FUNCTION
#define PHP_COUNT_RECURSIVE
unsigned const char * pos
unsigned char key[REFLECTION_KEY_LEN]
PHPAPI zend_string * php_spl_object_hash(zend_object *obj)
#define PHP_VAR_UNSERIALIZE_DESTROY(d)
struct php_unserialize_data * php_unserialize_data_t
struct php_serialize_data * php_serialize_data_t
#define PHP_VAR_UNSERIALIZE_INIT(d)
PHPAPI void var_replace(php_unserialize_data_t *var_hash, zval *ozval, zval *nzval)
PHPAPI zval * var_tmp_var(php_unserialize_data_t *var_hashx)
PHPAPI int php_var_unserialize(zval *rval, const unsigned char **p, const unsigned char *max, php_unserialize_data_t *var_hash)
PHPAPI void var_push_dtor(php_unserialize_data_t *var_hash, zval *val)
#define PHP_VAR_SERIALIZE_INIT(d)
PHPAPI void php_var_serialize(smart_str *buf, zval *struc, php_serialize_data_t *data)
#define PHP_VAR_SERIALIZE_DESTROY(d)
php_unserialize_data_t var_hash
PHPAPI zend_class_entry * spl_ce_RuntimeException
PHPAPI zend_class_entry * spl_ce_UnexpectedValueException
PHPAPI zend_class_entry * spl_ce_OutOfBoundsException
PHPAPI zend_class_entry * spl_ce_InvalidArgumentException
void spl_set_private_debug_info_property(const zend_class_entry *ce, const char *property, size_t property_len, HashTable *debug_info, zval *value)
PHPAPI zend_class_entry * spl_ce_SeekableIterator
#define SPL_OBJECT_STORAGE_CLASS_HAS_OVERRIDE(class_type, zstr_method)
PHPAPI zend_class_entry * spl_ce_SplSubject
#define SOS_OVERRIDDEN_UNSET_DIMENSION
#define SPL_MULTIPLE_ITERATOR_GET_ALL_KEY
struct _spl_SplObjectStorageElement spl_SplObjectStorageElement
PHPAPI zend_class_entry * spl_ce_SplObjectStorage
#define SOS_OVERRIDDEN_WRITE_DIMENSION
#define SPL_MULTIPLE_ITERATOR_GET_ALL_CURRENT
#define Z_SPLOBJSTORAGE_P(zv)
PHPAPI zend_class_entry * spl_ce_MultipleIterator
PHPAPI zend_class_entry * spl_ce_SplObserver
#define SOS_OVERRIDDEN_READ_DIMENSION
struct _spl_SplObjectStorage spl_SplObjectStorage
PHPAPI zend_long php_count_recursive(HashTable *ht)
zend_function * fptr_get_hash
zend_class_iterator_funcs * iterator_funcs_ptr
zend_function * zf_current
zend_function * zf_rewind
zend_object_get_properties_t get_properties
const zend_object_handlers * handlers
struct _zend_function::@236135173067030250234125302313220025134003177336 common
ZEND_API ZEND_COLD void zend_type_error(const char *format,...)
ZEND_API const char * zend_zval_value_name(const zval *arg)
ZEND_API zend_result zend_parse_parameters(uint32_t num_args, const char *type_spec,...)
ZEND_API void add_assoc_zval_ex(zval *arg, const char *key, size_t key_len, zval *value)
ZEND_API void object_properties_init(zend_object *object, zend_class_entry *class_type)
ZEND_API void object_properties_load(zend_object *object, HashTable *properties)
#define RETURN_COPY_DEREF(zv)
#define ZEND_PARSE_PARAMETERS_END()
#define array_init_size(arg, size)
#define zend_parse_parameters_none()
#define Z_PARAM_STR_OR_LONG_OR_NULL(dest_str, dest_long, is_null)
#define ZEND_PARSE_PARAMETERS_START(min_num_args, max_num_args)
#define RETURN_NEW_STR(s)
#define Z_PARAM_OBJ(dest)
#define Z_PARAM_OBJ_OF_CLASS(dest, _ce)
#define Z_PARAM_ZVAL(dest)
zend_string_release_ex(func->internal_function.function_name, 0)
ZEND_API ZEND_COLD zend_object * zend_throw_exception(zend_class_entry *exception_ce, const char *message, zend_long code)
ZEND_API ZEND_COLD zend_object * zend_throw_exception_ex(zend_class_entry *exception_ce, zend_long code, const char *format,...)
union _zend_function zend_function
ZEND_API zend_get_gc_buffer * zend_get_gc_buffer_create(void)
ZEND_API void ZEND_FASTCALL zend_hash_destroy(HashTable *ht)
ZEND_API HashTable *ZEND_FASTCALL zend_proptable_to_symtable(HashTable *ht, bool always_duplicate)
ZEND_API zend_result ZEND_FASTCALL zend_hash_move_forward_ex(HashTable *ht, HashPosition *pos)
ZEND_API zval *ZEND_FASTCALL zend_hash_next_index_insert(HashTable *ht, zval *pData)
ZEND_API void ZEND_FASTCALL zend_hash_internal_pointer_reset_ex(HashTable *ht, HashPosition *pos)
ZEND_API zval *ZEND_FASTCALL zend_hash_index_lookup(HashTable *ht, zend_ulong h)
ZEND_API int zend_hash_compare(HashTable *ht1, HashTable *ht2, compare_func_t compar, bool ordered)
ZEND_API zend_result ZEND_FASTCALL zend_hash_index_del(HashTable *ht, zend_ulong h)
ZEND_API zend_result ZEND_FASTCALL zend_hash_move_backwards_ex(HashTable *ht, HashPosition *pos)
ZEND_API void ZEND_FASTCALL zend_hash_copy(HashTable *target, HashTable *source, copy_ctor_func_t pCopyConstructor)
ZEND_API HashTable *ZEND_FASTCALL zend_array_dup(HashTable *source)
ZEND_API zend_result ZEND_FASTCALL zend_hash_del(HashTable *ht, zend_string *key)
ZEND_API zval *ZEND_FASTCALL zend_hash_index_find(const HashTable *ht, zend_ulong h)
#define zend_hash_init(ht, nSize, pHashFunction, pDestructor, persistent)
struct _zend_hash_key zend_hash_key
#define ZEND_HASH_FOREACH_PTR(ht, _ptr)
#define zend_new_array(size)
#define zend_hash_get_current_data_ptr(ht)
#define ZEND_HASH_FOREACH_END()
#define ZEND_HASH_FOREACH_VAL(ht, _val)
ZEND_API zend_class_entry * zend_ce_countable
ZEND_API zend_class_entry * zend_ce_iterator
ZEND_API zend_class_entry * zend_ce_serializable
ZEND_API zend_class_entry * zend_ce_arrayaccess
struct _zend_string zend_string
ZEND_API int zend_std_has_dimension(zend_object *object, zval *offset, int check_empty)
ZEND_API HashTable * zend_std_get_properties(zend_object *zobj)
ZEND_API const zend_object_handlers std_object_handlers
ZEND_API void zend_std_unset_dimension(zend_object *object, zval *offset)
ZEND_API zval * zend_std_read_dimension(zend_object *object, zval *offset, int type, zval *rv)
ZEND_API void zend_std_write_dimension(zend_object *object, zval *offset, zval *value)
#define ZEND_COMPARE_OBJECTS_FALLBACK(op1, op2)
ZEND_API void ZEND_FASTCALL zend_objects_clone_members(zend_object *new_object, zend_object *old_object)
ZEND_API void ZEND_FASTCALL zend_object_std_init(zend_object *object, zend_class_entry *ce)
ZEND_API void zend_object_std_dtor(zend_object *object)
ZEND_API int ZEND_FASTCALL zend_compare(zval *op1, zval *op2)
#define ZEND_UNCOMPARABLE
#define EXPECTED(condition)
#define XtOffsetOf(s_type, field)
#define UNEXPECTED(condition)
struct _zend_class_entry zend_class_entry
struct _zend_object zend_object
int(* compare_func_t)(const void *, const void *)
#define Z_ARRVAL_P(zval_p)
struct _zend_array HashTable
#define ZVAL_COPY_DEREF(z, v)
#define Z_OBJ_HANDLE_P(zval_p)
void(* copy_ctor_func_t)(zval *pElement)
#define ZVAL_OBJ_COPY(z, o)
ZEND_RESULT_CODE zend_result
struct _zend_object_handlers zend_object_handlers
#define ZVAL_COPY_VALUE(z, v)
ZEND_API void zval_ptr_dtor(zval *zval_ptr)
ZEND_API void zval_add_ref(zval *p)
zend_refcounted * garbage