]> granicus.if.org Git - php/commitdiff
Generate class entries from stubs for com, standard, xmlreader, xmlwriter, xsl, zip...
authorMáté Kocsis <kocsismate@woohoolabs.com>
Wed, 17 Feb 2021 12:42:42 +0000 (13:42 +0100)
committerMáté Kocsis <kocsismate@woohoolabs.com>
Mon, 22 Feb 2021 14:24:03 +0000 (15:24 +0100)
Closes GH-6706

39 files changed:
Zend/zend_builtin_functions.c
Zend/zend_builtin_functions.stub.php
Zend/zend_builtin_functions_arginfo.h
ext/com_dotnet/com_extension.c
ext/com_dotnet/com_extension.stub.php
ext/com_dotnet/com_extension_arginfo.h
ext/com_dotnet/com_persist.c
ext/com_dotnet/com_persist.stub.php
ext/com_dotnet/com_persist_arginfo.h
ext/dom/php_dom.h
ext/reflection/tests/ReflectionExtension_getClassNames_basic.phpt
ext/standard/assert.c
ext/standard/basic_functions.c
ext/standard/basic_functions.stub.php
ext/standard/basic_functions_arginfo.h
ext/standard/dir.c
ext/standard/dir.stub.php
ext/standard/dir_arginfo.h
ext/standard/incomplete_class.c
ext/standard/php_assert.h
ext/standard/php_incomplete_class.h
ext/standard/user_filters.c
ext/standard/user_filters.stub.php
ext/standard/user_filters_arginfo.h
ext/xmlreader/php_xmlreader.c
ext/xmlreader/php_xmlreader.stub.php
ext/xmlreader/php_xmlreader_arginfo.h
ext/xmlwriter/php_xmlwriter.c
ext/xmlwriter/php_xmlwriter.stub.php
ext/xmlwriter/php_xmlwriter_arginfo.h
ext/xsl/php_xsl.c
ext/xsl/php_xsl.stub.php
ext/xsl/php_xsl_arginfo.h
ext/zip/php_zip.c
ext/zip/php_zip.stub.php
ext/zip/php_zip_arginfo.h
ext/zlib/zlib.c
ext/zlib/zlib.stub.php
ext/zlib/zlib_arginfo.h

index 94a119eeec8f22d99aabd11a340a8ef4dd7e90a1..94a9502bc968cb8ea94548ab25b3d59b98e34b45 100644 (file)
 /* }}} */
 
 ZEND_MINIT_FUNCTION(core) { /* {{{ */
-       zend_class_entry class_entry;
-
-       INIT_CLASS_ENTRY(class_entry, "stdClass", NULL);
-       zend_standard_class_def = zend_register_internal_class(&class_entry);
+       zend_standard_class_def = register_class_stdClass();
 
        zend_register_default_classes();
 
index 6e6175a693dc6681e75fd89422676d5068def32d..87a530200dc00d0411a10f203de4960e5b768e1a 100644 (file)
@@ -2,6 +2,10 @@
 
 /** @generate-class-entries */
 
+class stdClass
+{
+}
+
 function zend_version(): string {}
 
 function func_num_args(): int {}
index abf380537ead7c505d3994eac9ec17cb36d83f26..6baaead27dfebfb8825cf9db8afd373f30680734 100644 (file)
@@ -1,5 +1,5 @@
 /* This is a generated file, edit the .stub.php file instead.
- * Stub hash: b2216a294367f50c8b6208653ebf6fa43dc106d1 */
+ * Stub hash: 429fc9b22054348101d0b9d6746494e52dc04edf */
 
 ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_zend_version, 0, 0, IS_STRING, 0)
 ZEND_END_ARG_INFO()
@@ -333,3 +333,18 @@ static const zend_function_entry ext_functions[] = {
        ZEND_FE(gc_status, arginfo_gc_status)
        ZEND_FE_END
 };
+
+
+static const zend_function_entry class_stdClass_methods[] = {
+       ZEND_FE_END
+};
+
+static zend_class_entry *register_class_stdClass(void)
+{
+       zend_class_entry ce, *class_entry;
+
+       INIT_CLASS_ENTRY(ce, "stdClass", class_stdClass_methods);
+       class_entry = zend_register_internal_class_ex(&ce, NULL);
+
+       return class_entry;
+}
index 5e2c1f69de7fb28429e729044031523c3f578923..6c256e7fc08fd6d26c6994c738df004f6297c356 100644 (file)
@@ -159,40 +159,33 @@ static PHP_GINIT_FUNCTION(com_dotnet)
 /* {{{ PHP_MINIT_FUNCTION */
 PHP_MINIT_FUNCTION(com_dotnet)
 {
-       zend_class_entry ce, *tmp;
+       zend_class_entry *tmp;
 
        php_com_wrapper_minit(INIT_FUNC_ARGS_PASSTHRU);
        php_com_persist_minit(INIT_FUNC_ARGS_PASSTHRU);
 
-       INIT_CLASS_ENTRY(ce, "com_exception", NULL);
-       php_com_exception_class_entry = zend_register_internal_class_ex(&ce, zend_ce_exception);
-       php_com_exception_class_entry->ce_flags |= ZEND_ACC_FINAL;
+       php_com_exception_class_entry = register_class_com_exception(zend_ce_exception);
 /*     php_com_exception_class_entry->constructor->common.fn_flags |= ZEND_ACC_PROTECTED; */
 
-       INIT_CLASS_ENTRY(ce, "com_safearray_proxy", NULL);
-       php_com_saproxy_class_entry = zend_register_internal_class(&ce);
-       php_com_saproxy_class_entry->ce_flags |= ZEND_ACC_FINAL;
+       php_com_saproxy_class_entry = register_class_com_safearray_proxy();
 /*     php_com_saproxy_class_entry->constructor->common.fn_flags |= ZEND_ACC_PROTECTED; */
        php_com_saproxy_class_entry->get_iterator = php_com_saproxy_iter_get;
 
-       INIT_CLASS_ENTRY(ce, "variant", class_variant_methods);
-       ce.create_object = php_com_object_new;
-       php_com_variant_class_entry = zend_register_internal_class(&ce);
+       php_com_variant_class_entry = register_class_variant();
+       php_com_variant_class_entry->create_object = php_com_object_new;
        php_com_variant_class_entry->get_iterator = php_com_iter_get;
        php_com_variant_class_entry->serialize = zend_class_serialize_deny;
        php_com_variant_class_entry->unserialize = zend_class_unserialize_deny;
 
-       INIT_CLASS_ENTRY(ce, "com", class_com_methods);
-       ce.create_object = php_com_object_new;
-       tmp = zend_register_internal_class_ex(&ce, php_com_variant_class_entry);
+       tmp = register_class_com(php_com_variant_class_entry);
+       tmp->create_object = php_com_object_new;
        tmp->get_iterator = php_com_iter_get;
        tmp->serialize = zend_class_serialize_deny;
        tmp->unserialize = zend_class_unserialize_deny;
 
 #if HAVE_MSCOREE_H
-       INIT_CLASS_ENTRY(ce, "dotnet", class_dotnet_methods);
-       ce.create_object = php_com_object_new;
-       tmp = zend_register_internal_class_ex(&ce, php_com_variant_class_entry);
+       tmp = register_class_dotnet(php_com_variant_class_entry);
+       tmp->create_object = php_com_object_new;
        tmp->get_iterator = php_com_iter_get;
        tmp->serialize = zend_class_serialize_deny;
        tmp->unserialize = zend_class_unserialize_deny;
index e3194efe06a8a16930fed1b497fab9ff229b70c1..8c46f319b95abf3e06f6564b4ec8b93f621dcb9b 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 
-/** @generate-function-entries */
+/** @generate-class-entries */
 
 function variant_set(variant $variant, mixed $value): void {}
 
@@ -71,18 +71,22 @@ class variant
     public function __construct(mixed $value = null, int $type = VT_EMPTY, int $codepage = CP_ACP) {}
 }
 
-class com
+class com extends variant
 {
     public function __construct(string $module_name, array|string|null $server_name = null, int $codepage = CP_ACP, string $typelib = "") {}
 }
 
 #if HAVE_MSCOREE_H
-class dotnet
+class dotnet extends variant
 {
     public function __construct(string $assembly_name, string $datatype_name, int $codepage = CP_ACP) {}
 }
 #endif
 
-final class com_exception extends exception
+final class com_safearray_proxy
+{
+}
+
+final class com_exception extends Exception
 {
 }
index d290161fd06e63391e2f84a6936ace67d194fee7..cf9a08e71110c59ea4e8b76f738f3182c8ad820e 100644 (file)
@@ -1,5 +1,5 @@
 /* This is a generated file, edit the .stub.php file instead.
- * Stub hash: 6b162963bcceb90144fdd3165137fb567f916812 */
+ * Stub hash: ba77cee0a718bcbe7ac280f07a41f9e97a8e2246 */
 
 ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_variant_set, 0, 2, IS_VOID, 0)
        ZEND_ARG_OBJ_INFO(0, variant, variant, 0)
@@ -228,6 +228,63 @@ static const zend_function_entry class_dotnet_methods[] = {
 };
 
 
+static const zend_function_entry class_com_safearray_proxy_methods[] = {
+       ZEND_FE_END
+};
+
+
 static const zend_function_entry class_com_exception_methods[] = {
        ZEND_FE_END
 };
+
+static zend_class_entry *register_class_variant(void)
+{
+       zend_class_entry ce, *class_entry;
+
+       INIT_CLASS_ENTRY(ce, "variant", class_variant_methods);
+       class_entry = zend_register_internal_class_ex(&ce, NULL);
+
+       return class_entry;
+}
+
+static zend_class_entry *register_class_com(zend_class_entry *class_entry_variant)
+{
+       zend_class_entry ce, *class_entry;
+
+       INIT_CLASS_ENTRY(ce, "com", class_com_methods);
+       class_entry = zend_register_internal_class_ex(&ce, class_entry_variant);
+
+       return class_entry;
+}
+
+static zend_class_entry *register_class_dotnet(zend_class_entry *class_entry_variant)
+{
+       zend_class_entry ce, *class_entry;
+
+       INIT_CLASS_ENTRY(ce, "dotnet", class_dotnet_methods);
+       class_entry = zend_register_internal_class_ex(&ce, class_entry_variant);
+
+       return class_entry;
+}
+
+static zend_class_entry *register_class_com_safearray_proxy(void)
+{
+       zend_class_entry ce, *class_entry;
+
+       INIT_CLASS_ENTRY(ce, "com_safearray_proxy", class_com_safearray_proxy_methods);
+       class_entry = zend_register_internal_class_ex(&ce, NULL);
+       class_entry->ce_flags |= ZEND_ACC_FINAL;
+
+       return class_entry;
+}
+
+static zend_class_entry *register_class_com_exception(zend_class_entry *class_entry_Exception)
+{
+       zend_class_entry ce, *class_entry;
+
+       INIT_CLASS_ENTRY(ce, "com_exception", class_com_exception_methods);
+       class_entry = zend_register_internal_class_ex(&ce, class_entry_Exception);
+       class_entry->ce_flags |= ZEND_ACC_FINAL;
+
+       return class_entry;
+}
index bf0f7062fb894343752b714cf28f1f51e8ee7bca..2c2cc4226ea61766e6c2d14424f7c53a07b5c738 100644 (file)
@@ -721,16 +721,12 @@ static zend_object* helper_new(zend_class_entry *ce)
 
 int php_com_persist_minit(INIT_FUNC_ARGS)
 {
-       zend_class_entry ce;
-
        memcpy(&helper_handlers, &std_object_handlers, sizeof(helper_handlers));
        helper_handlers.free_obj = helper_free_storage;
        helper_handlers.clone_obj = helper_clone;
 
-       INIT_CLASS_ENTRY(ce, "COMPersistHelper", class_COMPersistHelper_methods);
-       ce.create_object = helper_new;
-       helper_ce = zend_register_internal_class(&ce);
-       helper_ce->ce_flags |= ZEND_ACC_FINAL;
+       helper_ce = register_class_COMPersistHelper();
+       helper_ce->create_object = helper_new;
 
        le_istream = zend_register_list_destructors_ex(istream_dtor,
                        NULL, "com_dotnet_istream_wrapper", module_number);
index b0e9ef6b5c785527da53eea364fcfc754f327c0c..2a2b7ac5cbef1c3c5a2fcf8cfcfdec0fe78ed4da 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 
-/** @generate-function-entries */
+/** @generate-class-entries */
 
 final class COMPersistHelper
 {
index dc8bd6fa4817f958a134b2cd1726912156977bea..410782098d0777a2ae7b91fc76faf8177c55d57f 100644 (file)
@@ -1,5 +1,5 @@
 /* This is a generated file, edit the .stub.php file instead.
- * Stub hash: 2c2759e6c1894713439e3ee8da7f56810d00d8cf */
+ * Stub hash: d14d30fb232f08da37ba0df0b9186eb8bac5e1a4 */
 
 ZEND_BEGIN_ARG_INFO_EX(arginfo_class_COMPersistHelper___construct, 0, 0, 0)
        ZEND_ARG_OBJ_INFO_WITH_DEFAULT_VALUE(0, variant, variant, 1, "null")
@@ -52,3 +52,14 @@ static const zend_function_entry class_COMPersistHelper_methods[] = {
        ZEND_ME(COMPersistHelper, SaveToStream, arginfo_class_COMPersistHelper_SaveToStream, ZEND_ACC_PUBLIC)
        ZEND_FE_END
 };
+
+static zend_class_entry *register_class_COMPersistHelper(void)
+{
+       zend_class_entry ce, *class_entry;
+
+       INIT_CLASS_ENTRY(ce, "COMPersistHelper", class_COMPersistHelper_methods);
+       class_entry = zend_register_internal_class_ex(&ce, NULL);
+       class_entry->ce_flags |= ZEND_ACC_FINAL;
+
+       return class_entry;
+}
index 24e1ea646a05d76ce334ea319acb02fda1e564f9..0c5fc9778f8af89fd3050337ae7576f28895bc05 100644 (file)
@@ -132,11 +132,6 @@ void dom_parent_node_after(dom_object *context, zval *nodes, int nodesc);
 void dom_parent_node_before(dom_object *context, zval *nodes, int nodesc);
 void dom_child_node_remove(dom_object *context);
 
-#define REGISTER_DOM_CLASS(ce, name, parent_ce, funcs, entry) \
-INIT_CLASS_ENTRY(ce, name, funcs); \
-ce.create_object = dom_objects_new; \
-entry = zend_register_internal_class_ex(&ce, parent_ce);
-
 #define DOM_GET_OBJ(__ptr, __id, __prtype, __intern) { \
        __intern = Z_DOMOBJ_P(__id); \
        if (__intern->ptr == NULL || !(__ptr = (__prtype)((php_libxml_node_ptr *)__intern->ptr)->node)) { \
index e90209ee672d6c667bd868b8ad8570bdda9d9032..5c4d1cb87f1d730cb5c30a23c7003319855cee9a 100644 (file)
@@ -7,14 +7,14 @@ Felix De Vliegher <felix.devliegher@gmail.com>
 $standard = new ReflectionExtension('standard');
 var_dump($standard->getClassNames());
 ?>
---EXPECTF--
+--EXPECT--
 array(4) {
   [0]=>
-  %s(22) "__PHP_Incomplete_Class"
+  string(22) "__PHP_Incomplete_Class"
   [1]=>
-  %s(15) "php_user_filter"
+  string(14) "AssertionError"
   [2]=>
-  %s(9) "Directory"
+  string(15) "php_user_filter"
   [3]=>
-  %s(14) "AssertionError"
+  string(9) "Directory"
 }
index fae6d940ba205f2908d704c7ce1743424538fd14..8b2e25fcc5a1299c072b714a5d9c630d6dd368d5 100644 (file)
@@ -32,8 +32,6 @@ ZEND_END_MODULE_GLOBALS(assert)
 
 ZEND_DECLARE_MODULE_GLOBALS(assert)
 
-static zend_class_entry *assertion_error_ce;
-
 #define ASSERTG(v) ZEND_MODULE_GLOBALS_ACCESSOR(assert, v)
 
 #define SAFE_STRING(s) ((s)?(s):"")
@@ -46,6 +44,8 @@ enum {
        ASSERT_EXCEPTION
 };
 
+PHPAPI zend_class_entry *assertion_error_ce;
+
 static PHP_INI_MH(OnChangeCallback) /* {{{ */
 {
        if (EG(current_execute_data)) {
@@ -89,8 +89,6 @@ static void php_assert_init_globals(zend_assert_globals *assert_globals_p) /* {{
 
 PHP_MINIT_FUNCTION(assert) /* {{{ */
 {
-       zend_class_entry ce;
-
        ZEND_INIT_MODULE_GLOBALS(assert, php_assert_init_globals, NULL);
 
        REGISTER_INI_ENTRIES();
@@ -101,9 +99,6 @@ PHP_MINIT_FUNCTION(assert) /* {{{ */
        REGISTER_LONG_CONSTANT("ASSERT_WARNING", ASSERT_WARNING, CONST_CS|CONST_PERSISTENT);
        REGISTER_LONG_CONSTANT("ASSERT_EXCEPTION", ASSERT_EXCEPTION, CONST_CS|CONST_PERSISTENT);
 
-       INIT_CLASS_ENTRY(ce, "AssertionError", NULL);
-       assertion_error_ce = zend_register_internal_class_ex(&ce, zend_ce_error);
-
        return SUCCESS;
 }
 /* }}} */
index 4084f5d85311093d22015b045e53a7e1634029ef..1a6326624ba2c2f8ce1c4f71f9aa942628b6e5e3 100755 (executable)
@@ -283,7 +283,10 @@ PHP_MINIT_FUNCTION(basic) /* {{{ */
 #endif
 #endif
 
-       php_register_incomplete_class();
+       php_ce_incomplete_class = register_class___PHP_Incomplete_Class();
+       php_register_incomplete_class_handlers();
+
+       assertion_error_ce = register_class_AssertionError(zend_ce_error);
 
        REGISTER_LONG_CONSTANT("CONNECTION_ABORTED", PHP_CONNECTION_ABORTED, CONST_CS | CONST_PERSISTENT);
        REGISTER_LONG_CONSTANT("CONNECTION_NORMAL",  PHP_CONNECTION_NORMAL,  CONST_CS | CONST_PERSISTENT);
index 3a7e0de1743f1f235269021e4a959ab21bee2b71..83000d5b099b72b7f7e905b2f9086aeb6dd67e7f 100755 (executable)
@@ -1,6 +1,14 @@
 <?php
 
-/** @generate-function-entries */
+/** @generate-class-entries */
+
+final class __PHP_Incomplete_Class
+{
+}
+
+class AssertionError extends Error
+{
+}
 
 /* main/main.c */
 
index 1c7f6b00ecaae4d0520625eccc6464f1989ebbbc..f44a32226736b5a85d16eb5eda5f7cb74714d608 100644 (file)
@@ -1,5 +1,5 @@
 /* This is a generated file, edit the .stub.php file instead.
- * Stub hash: e9f39cbc595f0f2cdd84e58d4857f9fdb03ff7b7 */
+ * Stub hash: 97edf8c87780c892984099e52ad1c6c745b919f8 */
 
 ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_set_time_limit, 0, 1, _IS_BOOL, 0)
        ZEND_ARG_TYPE_INFO(0, seconds, IS_LONG, 0)
@@ -3491,3 +3491,34 @@ static const zend_function_entry ext_functions[] = {
 #endif
        ZEND_FE_END
 };
+
+
+static const zend_function_entry class___PHP_Incomplete_Class_methods[] = {
+       ZEND_FE_END
+};
+
+
+static const zend_function_entry class_AssertionError_methods[] = {
+       ZEND_FE_END
+};
+
+static zend_class_entry *register_class___PHP_Incomplete_Class(void)
+{
+       zend_class_entry ce, *class_entry;
+
+       INIT_CLASS_ENTRY(ce, "__PHP_Incomplete_Class", class___PHP_Incomplete_Class_methods);
+       class_entry = zend_register_internal_class_ex(&ce, NULL);
+       class_entry->ce_flags |= ZEND_ACC_FINAL;
+
+       return class_entry;
+}
+
+static zend_class_entry *register_class_AssertionError(zend_class_entry *class_entry_Error)
+{
+       zend_class_entry ce, *class_entry;
+
+       INIT_CLASS_ENTRY(ce, "AssertionError", class_AssertionError_methods);
+       class_entry = zend_register_internal_class_ex(&ce, class_entry_Error);
+
+       return class_entry;
+}
index e2b6f5bb3d9af88af1629d1e2765d9c2fb0b223f..c75db7e45aaff6936b65b8d4388f7516cb9012ce 100644 (file)
@@ -112,10 +112,8 @@ PHP_RINIT_FUNCTION(dir)
 PHP_MINIT_FUNCTION(dir)
 {
        static char dirsep_str[2], pathsep_str[2];
-       zend_class_entry dir_class_entry;
 
-       INIT_CLASS_ENTRY(dir_class_entry, "Directory", class_Directory_methods);
-       dir_class_entry_ptr = zend_register_internal_class(&dir_class_entry);
+       dir_class_entry_ptr = register_class_Directory();
 
 #ifdef ZTS
        ts_allocate_id(&dir_globals_id, sizeof(php_dir_globals), NULL, NULL);
index 9904c6bc992d606c392004da39b0ade677ecc1db..9cafa29c373a19f078a07048f7a7573f00fa5b72 100755 (executable)
@@ -1,6 +1,6 @@
 <?php
 
-/** @generate-function-entries */
+/** @generate-class-entries */
 
 class Directory
 {
index a2fa03611cab842b3b95f81db2870d7423a39bf9..1ad629204c589200f402c1ddf68aa643c5b161cf 100644 (file)
@@ -1,5 +1,5 @@
 /* This is a generated file, edit the .stub.php file instead.
- * Stub hash: a715bf6a8d5fe69732623cc17f03bd463f369648 */
+ * Stub hash: 1fd5cc5147c7272006e59d63d68c12caec84589f */
 
 ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Directory_close, 0, 0, 0)
 ZEND_END_ARG_INFO()
@@ -20,3 +20,13 @@ static const zend_function_entry class_Directory_methods[] = {
        ZEND_ME_MAPPING(read, readdir, arginfo_class_Directory_read, ZEND_ACC_PUBLIC)
        ZEND_FE_END
 };
+
+static zend_class_entry *register_class_Directory(void)
+{
+       zend_class_entry ce, *class_entry;
+
+       INIT_CLASS_ENTRY(ce, "Directory", class_Directory_methods);
+       class_entry = zend_register_internal_class_ex(&ce, NULL);
+
+       return class_entry;
+}
index 0ca2443eb2965126941ee7c45bfc1e0c6649368a..c59eb2d52cc5c63160a94fda5dd559427577cba5 100644 (file)
@@ -108,14 +108,8 @@ static zend_object *php_create_incomplete_object(zend_class_entry *class_type)
        return object;
 }
 
-PHPAPI void php_register_incomplete_class(void)
+PHPAPI void php_register_incomplete_class_handlers(void)
 {
-       zend_class_entry incomplete_class;
-
-       INIT_CLASS_ENTRY(incomplete_class, INCOMPLETE_CLASS, NULL);
-
-       incomplete_class.create_object = php_create_incomplete_object;
-
        memcpy(&php_incomplete_object_handlers, &std_object_handlers, sizeof(zend_object_handlers));
        php_incomplete_object_handlers.read_property = incomplete_class_get_property;
        php_incomplete_object_handlers.has_property = incomplete_class_has_property;
@@ -124,8 +118,7 @@ PHPAPI void php_register_incomplete_class(void)
        php_incomplete_object_handlers.get_property_ptr_ptr = incomplete_class_get_property_ptr_ptr;
     php_incomplete_object_handlers.get_method = incomplete_class_get_method;
 
-       php_ce_incomplete_class = zend_register_internal_class(&incomplete_class);
-       php_ce_incomplete_class->ce_flags |= ZEND_ACC_FINAL;
+       php_ce_incomplete_class->create_object = php_create_incomplete_object;
 }
 /* }}} */
 
index a0d81ed84eee73d5d94a23d3daae1833792d018b..596632d9a5f121dca2bbc49df6bbe64d08f0a140 100644 (file)
@@ -23,4 +23,6 @@ PHP_RINIT_FUNCTION(assert);
 PHP_RSHUTDOWN_FUNCTION(assert);
 PHP_MINFO_FUNCTION(assert);
 
+extern PHPAPI zend_class_entry *assertion_error_ce;
+
 #endif /* PHP_ASSERT_H */
index fc2caaa62c9cb4d380c32ba9205565cd7460c841..0464358d1bf6165260f6497925a59cde6afa5d20 100644 (file)
@@ -49,7 +49,7 @@ extern PHPAPI zend_class_entry *php_ce_incomplete_class;
 extern "C" {
 #endif
 
-PHPAPI void php_register_incomplete_class(void);
+PHPAPI void php_register_incomplete_class_handlers(void);
 PHPAPI zend_string *php_lookup_class_name(zend_object *object);
 PHPAPI void php_store_class_name(zval *object, zend_string *name);
 
index 6c5574f9912e6dac694d16f47ddd3d348bfdddfe..75cdcc734e5f7bbaf30ad0df2a1ba8e23f5dd39e 100644 (file)
@@ -58,7 +58,7 @@ PHP_METHOD(php_user_filter, onClose)
        ZEND_PARSE_PARAMETERS_NONE();
 }
 
-static zend_class_entry user_filter_class_entry;
+static zend_class_entry *user_filter_class_entry;
 
 static ZEND_RSRC_DTOR_FUNC(php_bucket_dtor)
 {
@@ -71,14 +71,8 @@ static ZEND_RSRC_DTOR_FUNC(php_bucket_dtor)
 
 PHP_MINIT_FUNCTION(user_filters)
 {
-       zend_class_entry *php_user_filter;
        /* init the filter class ancestor */
-       INIT_CLASS_ENTRY(user_filter_class_entry, "php_user_filter", class_php_user_filter_methods);
-       if ((php_user_filter = zend_register_internal_class(&user_filter_class_entry)) == NULL) {
-               return FAILURE;
-       }
-       zend_declare_property_string(php_user_filter, "filtername", sizeof("filtername")-1, "", ZEND_ACC_PUBLIC);
-       zend_declare_property_string(php_user_filter, "params", sizeof("params")-1, "", ZEND_ACC_PUBLIC);
+       user_filter_class_entry = register_class_php_user_filter();
 
        /* init the filter resource; it has no dtor, as streams will always clean it up
         * at the correct time */
index 7beb014f62f687f13ea4588dbd9f74b9e54715f1..2a20b88780d36a7afe79e84df5072025f5a65043 100755 (executable)
@@ -1,6 +1,6 @@
 <?php
 
-/** @generate-function-entries */
+/** @generate-class-entries */
 
 class php_user_filter
 {
index a982adbf7225649dcc0444cc754d0f259271c6f1..23181961997e828604e0fba2599fa222d922fc37 100644 (file)
@@ -1,5 +1,5 @@
 /* This is a generated file, edit the .stub.php file instead.
- * Stub hash: e3ab7a87eb78ef3a7f96ad18f5dff6c6d8032ca2 */
+ * Stub hash: d0653a1b2a1f33744b41a9b5f047ec4330bac091 */
 
 ZEND_BEGIN_ARG_INFO_EX(arginfo_class_php_user_filter_filter, 0, 0, 4)
        ZEND_ARG_INFO(0, in)
@@ -25,3 +25,25 @@ static const zend_function_entry class_php_user_filter_methods[] = {
        ZEND_ME(php_user_filter, onClose, arginfo_class_php_user_filter_onClose, ZEND_ACC_PUBLIC)
        ZEND_FE_END
 };
+
+static zend_class_entry *register_class_php_user_filter(void)
+{
+       zend_class_entry ce, *class_entry;
+
+       INIT_CLASS_ENTRY(ce, "php_user_filter", class_php_user_filter_methods);
+       class_entry = zend_register_internal_class_ex(&ce, NULL);
+
+       zval property_filtername_default_value;
+       ZVAL_EMPTY_STRING(&property_filtername_default_value);
+       zend_string *property_filtername_name = zend_string_init("filtername", sizeof("filtername") - 1, 1);
+       zend_declare_property_ex(class_entry, property_filtername_name, &property_filtername_default_value, ZEND_ACC_PUBLIC, NULL);
+       zend_string_release(property_filtername_name);
+
+       zval property_params_default_value;
+       ZVAL_EMPTY_STRING(&property_params_default_value);
+       zend_string *property_params_name = zend_string_init("params", sizeof("params") - 1, 1);
+       zend_declare_property_ex(class_entry, property_params_name, &property_params_default_value, ZEND_ACC_PUBLIC, NULL);
+       zend_string_release(property_params_name);
+
+       return class_entry;
+}
index 2a8eed34fe9e6512e272a4d7ffbd76d7db199811..c264993405f8146b3ba450d80f7ee579b7d52358 100644 (file)
@@ -1147,8 +1147,6 @@ PHP_METHOD(XMLReader, expand)
 PHP_MINIT_FUNCTION(xmlreader)
 {
 
-       zend_class_entry ce;
-
        memcpy(&xmlreader_object_handlers, &std_object_handlers, sizeof(zend_object_handlers));
        xmlreader_object_handlers.offset = XtOffsetOf(xmlreader_object, std);
        xmlreader_object_handlers.dtor_obj = zend_objects_destroy_object;
@@ -1159,9 +1157,8 @@ PHP_MINIT_FUNCTION(xmlreader)
        xmlreader_object_handlers.get_method = xmlreader_get_method;
        xmlreader_object_handlers.clone_obj = NULL;
 
-       INIT_CLASS_ENTRY(ce, "XMLReader", class_XMLReader_methods);
-       ce.create_object = xmlreader_objects_new;
-       xmlreader_class_entry = zend_register_internal_class(&ce);
+       xmlreader_class_entry = register_class_XMLReader();
+       xmlreader_class_entry->create_object = xmlreader_objects_new;
 
        memcpy(&xmlreader_open_fn, zend_hash_str_find_ptr(&xmlreader_class_entry->function_table, "open", sizeof("open")-1), sizeof(zend_internal_function));
        xmlreader_open_fn.fn_flags &= ~ZEND_ACC_STATIC;
index ecad4b392b8197de0701d9a58f1ae7dc1e4eff2d..a551ec0debb031b67f704da0a9bb21b46c9d90d2 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 
-/** @generate-function-entries */
+/** @generate-class-entries */
 
 class XMLReader
 {
index 487b53f698be9614450c9d66fa94e26e7540cd94..0c236bfe6b25c7a54a4ce1464730a385d3539b54 100644 (file)
@@ -1,5 +1,5 @@
 /* This is a generated file, edit the .stub.php file instead.
- * Stub hash: 0188a53f262d3f8e19b5b64d163bdee84f1be6b8 */
+ * Stub hash: 44e03e4884bd11843bae3d286a75ef1e6a677c16 */
 
 ZEND_BEGIN_ARG_INFO_EX(arginfo_class_XMLReader_close, 0, 0, 0)
 ZEND_END_ARG_INFO()
@@ -138,3 +138,13 @@ static const zend_function_entry class_XMLReader_methods[] = {
        ZEND_ME(XMLReader, expand, arginfo_class_XMLReader_expand, ZEND_ACC_PUBLIC)
        ZEND_FE_END
 };
+
+static zend_class_entry *register_class_XMLReader(void)
+{
+       zend_class_entry ce, *class_entry;
+
+       INIT_CLASS_ENTRY(ce, "XMLReader", class_XMLReader_methods);
+       class_entry = zend_register_internal_class_ex(&ce, NULL);
+
+       return class_entry;
+}
index 6934feb77eccf7f1d3c7dff43ff29b84a1542a15..8c3c92849d065283a00f3ad492290f1333cde6e3 100644 (file)
@@ -1032,16 +1032,13 @@ PHP_FUNCTION(xmlwriter_flush)
 /* {{{ PHP_MINIT_FUNCTION */
 static PHP_MINIT_FUNCTION(xmlwriter)
 {
-       zend_class_entry ce;
-
        memcpy(&xmlwriter_object_handlers, &std_object_handlers, sizeof(zend_object_handlers));
        xmlwriter_object_handlers.offset = XtOffsetOf(ze_xmlwriter_object, std);
        xmlwriter_object_handlers.dtor_obj = xmlwriter_object_dtor;
        xmlwriter_object_handlers.free_obj = xmlwriter_object_free_storage;
        xmlwriter_object_handlers.clone_obj = NULL;
-       INIT_CLASS_ENTRY(ce, "XMLWriter", class_XMLWriter_methods);
-       ce.create_object = xmlwriter_object_new;
-       xmlwriter_class_entry_ce = zend_register_internal_class(&ce);
+       xmlwriter_class_entry_ce = register_class_XMLWriter();
+       xmlwriter_class_entry_ce->create_object = xmlwriter_object_new;
 
        return SUCCESS;
 }
index 9334545ffae07f36a9f3ca9f12fe903d0f8962ed..ee90003399b032230a785a58ad30b9fef71425c8 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 
-/** @generate-function-entries */
+/** @generate-class-entries */
 
 function xmlwriter_open_uri(string $uri): XMLWriter|false {}
 
index 9325ffbdb5fe599c90aa0525c07083e4cb5245e6..7547479b3bf8ca25eb925b53159967e836b3ff38 100644 (file)
@@ -1,5 +1,5 @@
 /* This is a generated file, edit the .stub.php file instead.
- * Stub hash: a0ece6bc77b0a9811cb09a604b175e2295efc7a0 */
+ * Stub hash: ce5cf4f922e47833033729b2a8941c36fa2b4d6d */
 
 ZEND_BEGIN_ARG_WITH_RETURN_OBJ_TYPE_MASK_EX(arginfo_xmlwriter_open_uri, 0, 1, XMLWriter, MAY_BE_FALSE)
        ZEND_ARG_TYPE_INFO(0, uri, IS_STRING, 0)
@@ -464,3 +464,13 @@ static const zend_function_entry class_XMLWriter_methods[] = {
        ZEND_ME_MAPPING(flush, xmlwriter_flush, arginfo_class_XMLWriter_flush, ZEND_ACC_PUBLIC)
        ZEND_FE_END
 };
+
+static zend_class_entry *register_class_XMLWriter(void)
+{
+       zend_class_entry ce, *class_entry;
+
+       INIT_CLASS_ENTRY(ce, "XMLWriter", class_XMLWriter_methods);
+       class_entry = zend_register_internal_class_ex(&ce, NULL);
+
+       return class_entry;
+}
index 300b196d03c694ee2582f11ef05ba7b47c726977..0a454039f51c8a27099a6a3d472e26478c5634c8 100644 (file)
@@ -111,16 +111,13 @@ zend_object *xsl_objects_new(zend_class_entry *class_type)
 /* {{{ PHP_MINIT_FUNCTION */
 PHP_MINIT_FUNCTION(xsl)
 {
-       zend_class_entry ce;
-
        memcpy(&xsl_object_handlers, &std_object_handlers, sizeof(zend_object_handlers));
        xsl_object_handlers.offset = XtOffsetOf(xsl_object, std);
        xsl_object_handlers.clone_obj = NULL;
        xsl_object_handlers.free_obj = xsl_objects_free_storage;
 
-       INIT_CLASS_ENTRY(ce, "XSLTProcessor", class_XSLTProcessor_methods);
-       ce.create_object = xsl_objects_new;
-       xsl_xsltprocessor_class_entry = zend_register_internal_class(&ce);
+       xsl_xsltprocessor_class_entry = register_class_XSLTProcessor();
+       xsl_xsltprocessor_class_entry->create_object = xsl_objects_new;
 
 #ifdef HAVE_XSL_EXSLT
        exsltRegisterAll();
index 536f82ac20052b32a9ccab95ae2e16c73f06b9b4..6f52e5570e1e4446b3fea47c6e371df126be32fc 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 
-/** @generate-function-entries */
+/** @generate-class-entries */
 
 class XSLTProcessor
 {
index 8f7f90a053c8eef5b0a56a71c7955bf2ca516f86..f5be7aa731d29d1c56fad3a22b2dc10ffac0860b 100644 (file)
@@ -1,5 +1,5 @@
 /* This is a generated file, edit the .stub.php file instead.
- * Stub hash: a119247725ff61dbd615cb86ee6201ee6603ba51 */
+ * Stub hash: bcc89ca2603d60a9832704809fd8ab3834e79f74 */
 
 ZEND_BEGIN_ARG_INFO_EX(arginfo_class_XSLTProcessor_importStylesheet, 0, 0, 1)
        ZEND_ARG_TYPE_INFO(0, stylesheet, IS_OBJECT, 0)
@@ -79,3 +79,13 @@ static const zend_function_entry class_XSLTProcessor_methods[] = {
        ZEND_ME(XSLTProcessor, getSecurityPrefs, arginfo_class_XSLTProcessor_getSecurityPrefs, ZEND_ACC_PUBLIC)
        ZEND_FE_END
 };
+
+static zend_class_entry *register_class_XSLTProcessor(void)
+{
+       zend_class_entry ce, *class_entry;
+
+       INIT_CLASS_ENTRY(ce, "XSLTProcessor", class_XSLTProcessor_methods);
+       class_entry = zend_register_internal_class_ex(&ce, NULL);
+
+       return class_entry;
+}
index fd1585d472e929c05a816b8d0826ee773acc562f..a3b266bba8489ba5148da040588822d77874944b 100644 (file)
@@ -831,17 +831,12 @@ static void php_zip_register_prop_handler(HashTable *prop_handler, char *name, z
 {
        zip_prop_handler hnd;
        zend_string *str;
-       zval tmp;
 
        hnd.read_const_char_func = read_char_func;
        hnd.read_int_func = read_int_func;
        hnd.type = rettype;
        str = zend_string_init_interned(name, strlen(name), 1);
        zend_hash_add_mem(prop_handler, str, &hnd, sizeof(zip_prop_handler));
-
-       /* Register for reflection */
-       ZVAL_NULL(&tmp);
-       zend_declare_property_ex(zip_class_entry, str, &tmp, ZEND_ACC_PUBLIC, NULL);
        zend_string_release_ex(str, 1);
 }
 /* }}} */
@@ -3026,8 +3021,6 @@ static void php_zip_free_prop_handler(zval *el) /* {{{ */ {
 /* {{{ PHP_MINIT_FUNCTION */
 static PHP_MINIT_FUNCTION(zip)
 {
-       zend_class_entry ce;
-
        memcpy(&zip_object_handlers, &std_object_handlers, sizeof(zend_object_handlers));
        zip_object_handlers.offset = XtOffsetOf(ze_zip_object, zo);
        zip_object_handlers.free_obj = php_zip_object_free_storage;
@@ -3039,9 +3032,8 @@ static PHP_MINIT_FUNCTION(zip)
        zip_object_handlers.read_property       = php_zip_read_property;
        zip_object_handlers.has_property        = php_zip_has_property;
 
-       INIT_CLASS_ENTRY(ce, "ZipArchive", class_ZipArchive_methods);
-       ce.create_object = php_zip_object_new;
-       zip_class_entry = zend_register_internal_class(&ce);
+       zip_class_entry = register_class_ZipArchive(zend_ce_countable);
+       zip_class_entry->create_object = php_zip_object_new;
 
        zend_hash_init(&zip_prop_handlers, 0, NULL, php_zip_free_prop_handler, 1);
        php_zip_register_prop_handler(&zip_prop_handlers, "lastId",    php_zip_last_id, NULL, IS_LONG);
@@ -3050,7 +3042,6 @@ static PHP_MINIT_FUNCTION(zip)
        php_zip_register_prop_handler(&zip_prop_handlers, "numFiles",  php_zip_get_num_files, NULL, IS_LONG);
        php_zip_register_prop_handler(&zip_prop_handlers, "filename",  NULL, php_zipobj_get_filename, IS_STRING);
        php_zip_register_prop_handler(&zip_prop_handlers, "comment",   NULL, php_zipobj_get_zip_comment, IS_STRING);
-       zend_class_implements(zip_class_entry, 1, zend_ce_countable);
 
        REGISTER_ZIP_CLASS_CONST_LONG("CREATE", ZIP_CREATE);
        REGISTER_ZIP_CLASS_CONST_LONG("EXCL", ZIP_EXCL);
index ff7b9d99fbe9f60a084c5b07ed8cad8c408521d0..2c23b03851190c8302d80d99c863891c6b222c25 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 
-/** @generate-function-entries */
+/** @generate-class-entries */
 
 /**
  * @return resource|int|false
@@ -64,10 +64,25 @@ function zip_entry_filesize($zip_entry): int|false {}
  */
 function zip_entry_compressionmethod($zip_entry): string|false {}
 
-class ZipArchive
+class ZipArchive implements Countable
 {
+    /** @var int|null */
+    public $lastId;
+
+    /** @var int|null */
+    public $status;
+
+    /** @var int|null */
+    public $statusSys;
+
+    /** @var int|null */
+    public $numFiles;
+
+    /** @var string|null */
+    public $filename;
+
     /** @var string|null */
-    public $name;
+    public $comment;
 
     /** @return bool|int */
     public function open(string $filename, int $flags = 0) {}
index 104fac05a0b56e923ca1d3b5919bdd8e5aa07d7f..900c334bf0d2aa95fc57bf39a1081a8dd0e6792d 100644 (file)
@@ -1,5 +1,5 @@
 /* This is a generated file, edit the .stub.php file instead.
- * Stub hash: a5b8a10dbaeddf5d0d1ac751ff64a5d7ff235562 */
+ * Stub hash: a50da348df01027594efd7c8ab7427c05ffea39e */
 
 ZEND_BEGIN_ARG_INFO_EX(arginfo_zip_open, 0, 0, 1)
        ZEND_ARG_TYPE_INFO(0, filename, IS_STRING, 0)
@@ -453,3 +453,50 @@ static const zend_function_entry class_ZipArchive_methods[] = {
 #endif
        ZEND_FE_END
 };
+
+static zend_class_entry *register_class_ZipArchive(zend_class_entry *class_entry_Countable)
+{
+       zend_class_entry ce, *class_entry;
+
+       INIT_CLASS_ENTRY(ce, "ZipArchive", class_ZipArchive_methods);
+       class_entry = zend_register_internal_class_ex(&ce, NULL);
+       zend_class_implements(class_entry, 1, class_entry_Countable);
+
+       zval property_lastId_default_value;
+       ZVAL_NULL(&property_lastId_default_value);
+       zend_string *property_lastId_name = zend_string_init("lastId", sizeof("lastId") - 1, 1);
+       zend_declare_property_ex(class_entry, property_lastId_name, &property_lastId_default_value, ZEND_ACC_PUBLIC, NULL);
+       zend_string_release(property_lastId_name);
+
+       zval property_status_default_value;
+       ZVAL_NULL(&property_status_default_value);
+       zend_string *property_status_name = zend_string_init("status", sizeof("status") - 1, 1);
+       zend_declare_property_ex(class_entry, property_status_name, &property_status_default_value, ZEND_ACC_PUBLIC, NULL);
+       zend_string_release(property_status_name);
+
+       zval property_statusSys_default_value;
+       ZVAL_NULL(&property_statusSys_default_value);
+       zend_string *property_statusSys_name = zend_string_init("statusSys", sizeof("statusSys") - 1, 1);
+       zend_declare_property_ex(class_entry, property_statusSys_name, &property_statusSys_default_value, ZEND_ACC_PUBLIC, NULL);
+       zend_string_release(property_statusSys_name);
+
+       zval property_numFiles_default_value;
+       ZVAL_NULL(&property_numFiles_default_value);
+       zend_string *property_numFiles_name = zend_string_init("numFiles", sizeof("numFiles") - 1, 1);
+       zend_declare_property_ex(class_entry, property_numFiles_name, &property_numFiles_default_value, ZEND_ACC_PUBLIC, NULL);
+       zend_string_release(property_numFiles_name);
+
+       zval property_filename_default_value;
+       ZVAL_NULL(&property_filename_default_value);
+       zend_string *property_filename_name = zend_string_init("filename", sizeof("filename") - 1, 1);
+       zend_declare_property_ex(class_entry, property_filename_name, &property_filename_default_value, ZEND_ACC_PUBLIC, NULL);
+       zend_string_release(property_filename_name);
+
+       zval property_comment_default_value;
+       ZVAL_NULL(&property_comment_default_value);
+       zend_string *property_comment_name = zend_string_init("comment", sizeof("comment") - 1, 1);
+       zend_declare_property_ex(class_entry, property_comment_name, &property_comment_default_value, ZEND_ACC_PUBLIC, NULL);
+       zend_string_release(property_comment_name);
+
+       return class_entry;
+}
index 628f04f2f46764c8df03f35bd48232e851f0d3a1..02fb4dd207a29bb2e3f1fefb1cac5e0fab5ca146 100644 (file)
@@ -1337,10 +1337,7 @@ static PHP_MINIT_FUNCTION(zlib)
        php_output_handler_conflict_register(ZEND_STRL("ob_gzhandler"), php_zlib_output_conflict_check);
        php_output_handler_conflict_register(ZEND_STRL(PHP_ZLIB_OUTPUT_HANDLER_NAME), php_zlib_output_conflict_check);
 
-       zend_class_entry inflate_ce;
-       INIT_CLASS_ENTRY(inflate_ce, "InflateContext", class_InflateContext_methods);
-       inflate_context_ce = zend_register_internal_class(&inflate_ce);
-       inflate_context_ce->ce_flags |= ZEND_ACC_FINAL | ZEND_ACC_NO_DYNAMIC_PROPERTIES;
+       inflate_context_ce = register_class_InflateContext();
        inflate_context_ce->create_object = inflate_context_create_object;
        inflate_context_ce->serialize = zend_class_serialize_deny;
        inflate_context_ce->unserialize = zend_class_unserialize_deny;
@@ -1352,10 +1349,7 @@ static PHP_MINIT_FUNCTION(zlib)
        inflate_context_object_handlers.clone_obj = NULL;
        inflate_context_object_handlers.compare = zend_objects_not_comparable;
 
-       zend_class_entry deflate_ce;
-       INIT_CLASS_ENTRY(deflate_ce, "DeflateContext", class_DeflateContext_methods);
-       deflate_context_ce = zend_register_internal_class(&deflate_ce);
-       deflate_context_ce->ce_flags |= ZEND_ACC_FINAL | ZEND_ACC_NO_DYNAMIC_PROPERTIES;
+       deflate_context_ce = register_class_DeflateContext();
        deflate_context_ce->create_object = deflate_context_create_object;
        deflate_context_ce->serialize = zend_class_serialize_deny;
        deflate_context_ce->unserialize = zend_class_unserialize_deny;
index c047a535417ef600b05897073e492229db2647a0..1aaafcdce22b15bc438db946ac24af96c3b49d84 100644 (file)
@@ -1,11 +1,13 @@
 <?php
 
-/** @generate-function-entries */
+/** @generate-class-entries */
 
+/** @strict-properties */
 final class InflateContext
 {
 }
 
+/** @strict-properties */
 final class DeflateContext
 {
 }
index 9f5129feb0341b77ffbfdbd54feb7486cef5ae9f..e0ff0e16e99c3a1ffc6354160872b6dcbb20ee9d 100644 (file)
@@ -1,5 +1,5 @@
 /* This is a generated file, edit the .stub.php file instead.
- * Stub hash: 5862b97739c885589779f8ba3d13b4e390d72811 */
+ * Stub hash: 1aa5f9d6d062280f6148f3e72ceeaca81fb3037e */
 
 ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_ob_gzhandler, 0, 2, MAY_BE_STRING|MAY_BE_FALSE)
        ZEND_ARG_TYPE_INFO(0, data, IS_STRING, 0)
@@ -207,3 +207,25 @@ static const zend_function_entry class_InflateContext_methods[] = {
 static const zend_function_entry class_DeflateContext_methods[] = {
        ZEND_FE_END
 };
+
+static zend_class_entry *register_class_InflateContext(void)
+{
+       zend_class_entry ce, *class_entry;
+
+       INIT_CLASS_ENTRY(ce, "InflateContext", class_InflateContext_methods);
+       class_entry = zend_register_internal_class_ex(&ce, NULL);
+       class_entry->ce_flags |= ZEND_ACC_FINAL|ZEND_ACC_NO_DYNAMIC_PROPERTIES;
+
+       return class_entry;
+}
+
+static zend_class_entry *register_class_DeflateContext(void)
+{
+       zend_class_entry ce, *class_entry;
+
+       INIT_CLASS_ENTRY(ce, "DeflateContext", class_DeflateContext_methods);
+       class_entry = zend_register_internal_class_ex(&ce, NULL);
+       class_entry->ce_flags |= ZEND_ACC_FINAL|ZEND_ACC_NO_DYNAMIC_PROPERTIES;
+
+       return class_entry;
+}