/* {{{ proto bool ArrayObject::offsetExists(mixed $index) U
proto bool ArrayIterator::offsetExists(mixed $index) U
- Returns whether the requested $index exists. */
+ Returns whether the requested $index exists. */
SPL_METHOD(Array, offsetExists)
{
zval *index;
/* {{{ proto mixed ArrayObject::offsetGet(mixed $index) U
proto mixed ArrayIterator::offsetGet(mixed $index) U
- Returns the value at the specified $index. */
+ Returns the value at the specified $index. */
SPL_METHOD(Array, offsetGet)
{
zval *index, *value;
/* {{{ proto void ArrayObject::offsetSet(mixed $index, mixed $newval) U
proto void ArrayIterator::offsetSet(mixed $index, mixed $newval) U
- Sets the value at the specified $index to $newval. */
+ Sets the value at the specified $index to $newval. */
SPL_METHOD(Array, offsetSet)
{
zval *index, *value;
/* {{{ proto void ArrayObject::append(mixed $newval) U
proto void ArrayIterator::append(mixed $newval) U
- Appends the value (cannot be called for objects). */
+ Appends the value (cannot be called for objects). */
SPL_METHOD(Array, append)
{
zval *value;
/* {{{ proto void ArrayObject::offsetUnset(mixed $index) U
proto void ArrayIterator::offsetUnset(mixed $index) U
- Unsets the value at the specified $index. */
+ Unsets the value at the specified $index. */
SPL_METHOD(Array, offsetUnset)
{
zval *index;
/* {{{ proto array ArrayObject::getArrayCopy() U
proto array ArrayIterator::getArrayCopy() U
- Return a copy of the contained array */
+ Return a copy of the contained array */
SPL_METHOD(Array, getArrayCopy)
{
zval *object = getThis(), *tmp;
spl_array_object *intern = (spl_array_object*)zend_object_store_get_object(object TSRMLS_CC);
-
+
array_init(return_value);
zend_hash_copy(HASH_OF(return_value), spl_array_get_hash_table(intern, 0 TSRMLS_CC), (copy_ctor_func_t) zval_add_ref, &tmp, sizeof(zval*));
} /* }}} */
/* {{{ proto void ArrayObject::__construct(array|object ar = array() [, int flags = 0 [, string iterator_class = "ArrayIterator"]]) U
proto void ArrayIterator::__construct(array|object ar = array() [, int flags = 0]) U
- Cronstructs a new array iterator from a path. */
+ Constructs a new array iterator from a path. */
SPL_METHOD(Array, __construct)
{
zval *object = getThis();
/* }}} */
/* {{{ proto void ArrayIterator::seek(int $position) U
- Seek to position. */
+ Seek to position. */
SPL_METHOD(Array, seek)
{
long opos, position;
/* {{{ proto int ArrayObject::count() U
proto int ArrayIterator::count() U
- Return the number of elements in the Iterator. */
+ Return the number of elements in the Iterator. */
SPL_METHOD(Array, count)
{
long count;
RETURN_LONG(count);
} /* }}} */
-/* {{{ static void spl_array_method */
+/* {{{ static void spl_array_method
+*/
static void spl_array_method(INTERNAL_FUNCTION_PARAMETERS, char *fname, int fname_len, int use_arg)
{
spl_array_object *intern = (spl_array_object*)zend_object_store_get_object(getThis() TSRMLS_CC);
/* {{{ proto int ArrayObject::asort() U
proto int ArrayIterator::asort() U
- Sort the entries by values. */
+ Sort the entries by values. */
SPL_ARRAY_METHOD(Array, asort, 0) /* }}} */
/* {{{ proto int ArrayObject::ksort() U
proto int ArrayIterator::ksort() U
- Sort the entries by key. */
+ Sort the entries by key. */
SPL_ARRAY_METHOD(Array, ksort, 0) /* }}} */
/* {{{ proto int ArrayObject::uasort(callback cmp_function) U
proto int ArrayIterator::uasort(callback cmp_function) U
- Sort the entries by values user defined function. */
+ Sort the entries by values user defined function. */
SPL_ARRAY_METHOD(Array, uasort, 1) /* }}} */
/* {{{ proto int ArrayObject::uksort(callback cmp_function) U
proto int ArrayIterator::uksort(callback cmp_function) U
- Sort the entries by key using user defined function. */
+ Sort the entries by key using user defined function. */
SPL_ARRAY_METHOD(Array, uksort, 1) /* }}} */
/* {{{ proto int ArrayObject::natsort() U
proto int ArrayIterator::natsort() U
- Sort the entries by values using "natural order" algorithm. */
+ Sort the entries by values using "natural order" algorithm. */
SPL_ARRAY_METHOD(Array, natsort, 0) /* }}} */
/* {{{ proto int ArrayObject::natcasesort() U
proto int ArrayIterator::natcasesort() U
- Sort the entries by key using case insensitive "natural order" algorithm. */
+ Sort the entries by key using case insensitive "natural order" algorithm. */
SPL_ARRAY_METHOD(Array, natcasesort, 0) /* }}} */
/* {{{ proto mixed|NULL ArrayIterator::current() U
}
/* }}} */
-smart_str spl_array_serialize_helper(spl_array_object *intern, php_serialize_data_t *var_hash_p TSRMLS_DC) { /* {{{ */
+smart_str spl_array_serialize_helper(spl_array_object *intern, php_serialize_data_t *var_hash_p TSRMLS_DC) /* {{{ */
+{
HashTable *aht = spl_array_get_hash_table(intern, 0 TSRMLS_CC);
zval members, *pmembers;
smart_str buf = {0};
/* }}} */
/* {{{ proto string ArrayObject::serialize()
- * serialize the object
- */
+ Serialize the object */
SPL_METHOD(Array, serialize)
{
zval *object = getThis();
RETURN_NULL();
} /* }}} */
-int spl_array_serialize(zval *object, int *type, zstr *buffer, zend_uint *buf_len, zend_serialize_data *data TSRMLS_DC) { /* {{{ */
+int spl_array_serialize(zval *object, int *type, zstr *buffer, zend_uint *buf_len, zend_serialize_data *data TSRMLS_DC) /* {{{ */
+{
spl_array_object *intern = (spl_array_object*)zend_object_store_get_object(object TSRMLS_CC);
if (intern->fptr_serialize) {
}
/* }}} */
-void spl_array_unserialize_helper(spl_array_object *intern, const unsigned char *buf, zend_uint buf_len, php_unserialize_data_t *var_hash_p TSRMLS_DC) { /* {{{ */
+void spl_array_unserialize_helper(spl_array_object *intern, const unsigned char *buf, zend_uint buf_len, php_unserialize_data_t *var_hash_p TSRMLS_DC) /* {{{ */
+{
const unsigned char *p, *s;
zval *pmembers, *pflags = NULL;
long flags;
/* }}} */
/* {{{ proto void ArrayObject::unserialize(string serialized)
- *
- *
- * unserialize the object
- */
+ Unserialize the object */
SPL_METHOD(Array, unserialize)
{
char *buf;
}
/* }}} */
-int spl_array_unserialize(zval **object, zend_class_entry *ce, int type, const zstr buf, zend_uint buf_len, zend_unserialize_data *data TSRMLS_DC) { /* {{{ */
+int spl_array_unserialize(zval **object, zend_class_entry *ce, int type, const zstr buf, zend_uint buf_len, zend_unserialize_data *data TSRMLS_DC) /* {{{ */
+{
spl_array_object *intern;
object_init_ex(*object, ce);