@@ -579,6 +579,38 @@ SPL_METHOD(SplFixedArray, __construct)
579579}
580580/* }}} */
581581
582+ /* {{{ proto void SplFixedArray::__wakeup()
583+ */
584+ SPL_METHOD (SplFixedArray , __wakeup )
585+ {
586+ spl_fixedarray_object * intern = (spl_fixedarray_object * ) zend_object_store_get_object (getThis () TSRMLS_CC );
587+ HashPosition ptr ;
588+ HashTable * intern_ht = zend_std_get_properties (getThis () TSRMLS_CC );
589+ zval * * data ;
590+
591+ if (FAILURE == zend_parse_parameters (ZEND_NUM_ARGS () TSRMLS_CC , "" )) {
592+ return ;
593+ }
594+
595+ if (!intern -> array ) {
596+ int index = 0 ;
597+ int size = zend_hash_num_elements (intern_ht );
598+
599+ intern -> array = emalloc (sizeof (spl_fixedarray ));
600+ spl_fixedarray_init (intern -> array , size TSRMLS_CC );
601+
602+ for (zend_hash_internal_pointer_reset_ex (intern_ht , & ptr ); zend_hash_get_current_data_ex (intern_ht , (void * * ) & data , & ptr ) == SUCCESS ; zend_hash_move_forward_ex (intern_ht , & ptr )) {
603+ Z_ADDREF_PP (data );
604+ intern -> array -> elements [index ++ ] = * data ;
605+ }
606+
607+ /* Remove the unserialised properties, since we now have the elements
608+ * within the spl_fixedarray_object structure. */
609+ zend_hash_clean (intern_ht );
610+ }
611+ }
612+ /* }}} */
613+
582614/* {{{ proto int SplFixedArray::count(void)
583615*/
584616SPL_METHOD (SplFixedArray , count )
@@ -1056,6 +1088,7 @@ ZEND_END_ARG_INFO()
10561088
10571089static zend_function_entry spl_funcs_SplFixedArray [] = { /* {{{ */
10581090 SPL_ME (SplFixedArray , __construct , arginfo_splfixedarray_construct ,ZEND_ACC_PUBLIC )
1091+ SPL_ME (SplFixedArray , __wakeup , arginfo_splfixedarray_void , ZEND_ACC_PUBLIC )
10591092 SPL_ME (SplFixedArray , count , arginfo_splfixedarray_void , ZEND_ACC_PUBLIC )
10601093 SPL_ME (SplFixedArray , toArray , arginfo_splfixedarray_void , ZEND_ACC_PUBLIC )
10611094 SPL_ME (SplFixedArray , fromArray , arginfo_fixedarray_fromArray , ZEND_ACC_PUBLIC |ZEND_ACC_STATIC )
0 commit comments