Skip to content

Commit a01dd9f

Browse files
committed
Revert "Port all internally used classes to use default_object_handlers"
This reverts commit 94ee4f9. The commit was a bit too late to be included in PHP 8.2 RC1. Given it's a massive ABI break, we decide to postpone the change to PHP 8.3.
1 parent d228651 commit a01dd9f

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

57 files changed

+115
-108
lines changed

Zend/zend_inheritance.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1472,7 +1472,6 @@ ZEND_API void zend_do_inheritance_ex(zend_class_entry *ce, zend_class_entry *par
14721472
zend_string_release_ex(ce->parent_name, 0);
14731473
}
14741474
ce->parent = parent_ce;
1475-
ce->default_object_handlers = parent_ce->default_object_handlers;
14761475
ce->ce_flags |= ZEND_ACC_RESOLVED_PARENT;
14771476

14781477
/* Inherit properties */

Zend/zend_iterators.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,6 @@ static const zend_object_handlers iterator_object_handlers = {
5757
ZEND_API void zend_register_iterator_wrapper(void)
5858
{
5959
INIT_CLASS_ENTRY(zend_iterator_class_entry, "__iterator_wrapper", NULL);
60-
zend_iterator_class_entry.default_object_handlers = &iterator_object_handlers;
6160
}
6261

6362
static void iter_wrapper_free(zend_object *object)
@@ -84,6 +83,7 @@ static HashTable *iter_wrapper_get_gc(zend_object *object, zval **table, int *n)
8483
ZEND_API void zend_iterator_init(zend_object_iterator *iter)
8584
{
8685
zend_object_std_init(&iter->std, &zend_iterator_class_entry);
86+
iter->std.handlers = &iterator_object_handlers;
8787
}
8888

8989
ZEND_API void zend_iterator_dtor(zend_object_iterator *iter)

ext/com_dotnet/com_extension.c

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -184,22 +184,18 @@ PHP_MINIT_FUNCTION(com_dotnet)
184184

185185
php_com_saproxy_class_entry = register_class_com_safearray_proxy();
186186
/* php_com_saproxy_class_entry->constructor->common.fn_flags |= ZEND_ACC_PROTECTED; */
187-
php_com_saproxy_class_entry->default_object_handlers = &php_com_saproxy_handlers;
188187
php_com_saproxy_class_entry->get_iterator = php_com_saproxy_iter_get;
189188

190189
php_com_variant_class_entry = register_class_variant();
191-
php_com_variant_class_entry->default_object_handlers = &php_com_object_handlers;
192190
php_com_variant_class_entry->create_object = php_com_object_new;
193191
php_com_variant_class_entry->get_iterator = php_com_iter_get;
194192

195193
tmp = register_class_com(php_com_variant_class_entry);
196-
tmp->default_object_handlers = &php_com_object_handlers;
197194
tmp->create_object = php_com_object_new;
198195
tmp->get_iterator = php_com_iter_get;
199196

200197
#if HAVE_MSCOREE_H
201198
tmp = register_class_dotnet(php_com_variant_class_entry);
202-
tmp->default_object_handlers = &php_com_object_handlers;
203199
tmp->create_object = php_com_object_new;
204200
tmp->get_iterator = php_com_iter_get;
205201
#endif

ext/com_dotnet/com_handlers.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -627,6 +627,7 @@ zend_object* php_com_object_new(zend_class_entry *ce)
627627
obj->ce = ce;
628628

629629
zend_object_std_init(&obj->zo, ce);
630+
obj->zo.handlers = &php_com_object_handlers;
630631

631632
obj->typeinfo = NULL;
632633

ext/com_dotnet/com_misc.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@ PHP_COM_DOTNET_API void php_com_wrap_dispatch(zval *z, IDispatch *disp,
6161
IDispatch_GetTypeInfo(V_DISPATCH(&obj->v), 0, LANG_NEUTRAL, &obj->typeinfo);
6262

6363
zend_object_std_init(&obj->zo, php_com_variant_class_entry);
64+
obj->zo.handlers = &php_com_object_handlers;
6465
ZVAL_OBJ(z, &obj->zo);
6566
}
6667

@@ -84,6 +85,7 @@ PHP_COM_DOTNET_API void php_com_wrap_variant(zval *z, VARIANT *v,
8485
}
8586

8687
zend_object_std_init(&obj->zo, php_com_variant_class_entry);
88+
obj->zo.handlers = &php_com_object_handlers;
8789
ZVAL_OBJ(z, &obj->zo);
8890
}
8991

ext/com_dotnet/com_persist.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -709,6 +709,7 @@ static zend_object* helper_new(zend_class_entry *ce)
709709
memset(helper, 0, sizeof(*helper));
710710

711711
zend_object_std_init(&helper->std, helper_ce);
712+
helper->std.handlers = &helper_handlers;
712713

713714
return &helper->std;
714715
}
@@ -721,7 +722,6 @@ void php_com_persist_minit(INIT_FUNC_ARGS)
721722

722723
helper_ce = register_class_COMPersistHelper();
723724
helper_ce->create_object = helper_new;
724-
helper_ce->default_object_handlers = &helper_handlers;
725725

726726
le_istream = zend_register_list_destructors_ex(istream_dtor,
727727
NULL, "com_dotnet_istream_wrapper", module_number);

ext/com_dotnet/com_saproxy.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -440,6 +440,7 @@ void php_com_saproxy_create(zend_object *com_object, zval *proxy_out, zval *inde
440440
ZVAL_DUP(&proxy->indices[proxy->dimensions-1], index);
441441

442442
zend_object_std_init(&proxy->std, php_com_saproxy_class_entry);
443+
proxy->std.handlers = &php_com_saproxy_handlers;
443444
ZVAL_OBJ(proxy_out, &proxy->std);
444445
}
445446

ext/com_dotnet/php_com_dotnet_internal.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,6 @@ void php_com_object_enable_event_sink(php_com_dotnet_object *obj, bool enable);
7878
/* com_saproxy.c */
7979
zend_object_iterator *php_com_saproxy_iter_get(zend_class_entry *ce, zval *object, int by_ref);
8080
void php_com_saproxy_create(zend_object *com_object, zval *proxy_out, zval *index);
81-
extern zend_object_handlers php_com_saproxy_handlers;
8281

8382
/* com_olechar.c */
8483
PHP_COM_DOTNET_API zend_string *php_com_olestring_to_string(OLECHAR *olestring, int codepage);

ext/curl/interface.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -398,7 +398,6 @@ PHP_MINIT_FUNCTION(curl)
398398

399399
curl_ce = register_class_CurlHandle();
400400
curl_ce->create_object = curl_create_object;
401-
curl_ce->default_object_handlers = &curl_object_handlers;
402401

403402
memcpy(&curl_object_handlers, &std_object_handlers, sizeof(zend_object_handlers));
404403
curl_object_handlers.offset = XtOffsetOf(php_curl, std);
@@ -427,6 +426,7 @@ static zend_object *curl_create_object(zend_class_entry *class_type) {
427426

428427
zend_object_std_init(&intern->std, class_type);
429428
object_properties_init(&intern->std, class_type);
429+
intern->std.handlers = &curl_object_handlers;
430430

431431
return &intern->std;
432432
}

ext/curl/multi.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -512,11 +512,14 @@ PHP_FUNCTION(curl_multi_setopt)
512512

513513
/* CurlMultiHandle class */
514514

515+
static zend_object_handlers curl_multi_handlers;
516+
515517
static zend_object *curl_multi_create_object(zend_class_entry *class_type) {
516518
php_curlm *intern = zend_object_alloc(sizeof(php_curlm), class_type);
517519

518520
zend_object_std_init(&intern->std, class_type);
519521
object_properties_init(&intern->std, class_type);
522+
intern->std.handlers = &curl_multi_handlers;
520523

521524
return &intern->std;
522525
}
@@ -579,11 +582,8 @@ static HashTable *curl_multi_get_gc(zend_object *object, zval **table, int *n)
579582
return zend_std_get_properties(object);
580583
}
581584

582-
static zend_object_handlers curl_multi_handlers;
583-
584585
void curl_multi_register_handlers(void) {
585586
curl_multi_ce->create_object = curl_multi_create_object;
586-
curl_multi_ce->default_object_handlers = &curl_multi_handlers;
587587

588588
memcpy(&curl_multi_handlers, &std_object_handlers, sizeof(zend_object_handlers));
589589
curl_multi_handlers.offset = XtOffsetOf(php_curlm, std);

0 commit comments

Comments
 (0)