44
44
45
45
PHONGO_API zend_class_entry * php_phongo_regex_ce ;
46
46
47
+ zend_object_handlers php_phongo_handler_regex ;
48
+
47
49
/* {{{ proto BSON\Regex Regex::__construct(string $pattern, string $flags)
48
50
Constructs a new regular expression. */
49
51
PHP_METHOD (Regex , __construct )
@@ -185,10 +187,27 @@ zend_object_value php_phongo_regex_create_object(zend_class_entry *class_type TS
185
187
object_properties_init (& intern -> std , class_type );
186
188
187
189
retval .handle = zend_objects_store_put (intern , (zend_objects_store_dtor_t ) zend_objects_destroy_object , php_phongo_regex_free_object , NULL TSRMLS_CC );
188
- retval .handlers = phongo_get_std_object_handlers () ;
190
+ retval .handlers = & php_phongo_handler_regex ;
189
191
190
192
return retval ;
191
193
} /* }}} */
194
+
195
+ HashTable * php_phongo_regex_get_debug_info (zval * object , int * is_temp TSRMLS_DC ) /* {{{ */
196
+ {
197
+ php_phongo_regex_t * intern ;
198
+ zval retval = zval_used_for_init ;
199
+
200
+
201
+ * is_temp = 1 ;
202
+ intern = (php_phongo_regex_t * )zend_object_store_get_object (object TSRMLS_CC );
203
+
204
+ array_init (& retval );
205
+
206
+ add_assoc_stringl_ex (& retval , ZEND_STRS ("pattern" ), intern -> pattern , intern -> pattern_len , 1 );
207
+ add_assoc_stringl_ex (& retval , ZEND_STRS ("flags" ), intern -> flags , intern -> flags_len , 1 );
208
+
209
+ return Z_ARRVAL (retval );
210
+ } /* }}} */
192
211
/* }}} */
193
212
194
213
/* {{{ PHP_MINIT_FUNCTION */
@@ -203,6 +222,8 @@ PHP_MINIT_FUNCTION(Regex)
203
222
204
223
zend_class_implements (php_phongo_regex_ce TSRMLS_CC , 1 , php_phongo_type_ce );
205
224
225
+ memcpy (& php_phongo_handler_regex , phongo_get_std_object_handlers (), sizeof (zend_object_handlers ));
226
+ php_phongo_handler_regex .get_debug_info = php_phongo_regex_get_debug_info ;
206
227
207
228
return SUCCESS ;
208
229
}
0 commit comments