summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMáté Kocsis <kocsismate@woohoolabs.com>2021-02-05 13:46:46 +0100
committerMáté Kocsis <kocsismate@woohoolabs.com>2021-02-08 19:53:55 +0100
commit98fb565c7448cd455b8d24df5f6be8fcf9330fd7 (patch)
tree939ec045221d2590e28d9111d7721414fec35478
parent882b418a014890b9b6763825ce9766f21da38a6f (diff)
downloadphp-git-98fb565c7448cd455b8d24df5f6be8fcf9330fd7.tar.gz
Generate class entries from stubs for another batch of extensions
Closes GH-6669
-rw-r--r--ext/enchant/enchant.c10
-rw-r--r--ext/enchant/enchant.stub.php7
-rw-r--r--ext/enchant/enchant_arginfo.h25
-rw-r--r--ext/exif/exif.stub.php5
-rw-r--r--ext/exif/exif_arginfo.h3
-rw-r--r--ext/ffi/ffi.c21
-rw-r--r--ext/ffi/ffi.stub.php14
-rw-r--r--ext/ffi/ffi_arginfo.h72
-rw-r--r--ext/fileinfo/fileinfo.c4
-rw-r--r--ext/fileinfo/fileinfo.stub.php5
-rw-r--r--ext/fileinfo/fileinfo_arginfo.h13
-rw-r--r--ext/filter/filter.stub.php5
-rw-r--r--ext/filter/filter_arginfo.h3
-rw-r--r--ext/ftp/ftp.stub.php10
-rw-r--r--ext/ftp/ftp_arginfo.h19
-rw-r--r--ext/ftp/php_ftp.c6
-rw-r--r--ext/gd/gd.c10
-rw-r--r--ext/gd/gd.stub.php7
-rw-r--r--ext/gd/gd_arginfo.h25
-rw-r--r--ext/gettext/gettext.stub.php5
-rw-r--r--ext/gettext/gettext_arginfo.h3
-rw-r--r--ext/gmp/gmp.c4
-rw-r--r--ext/gmp/gmp.stub.php5
-rw-r--r--ext/gmp/gmp_arginfo.h13
-rw-r--r--ext/hash/hash.c6
-rw-r--r--ext/hash/hash.stub.php5
-rw-r--r--ext/hash/hash_arginfo.h14
-rw-r--r--ext/iconv/iconv.stub.php5
-rw-r--r--ext/iconv/iconv_arginfo.h3
-rw-r--r--ext/imap/php_imap.c6
-rw-r--r--ext/imap/php_imap.stub.php8
-rw-r--r--ext/imap/php_imap_arginfo.h14
-rw-r--r--ext/json/json.c8
-rw-r--r--ext/json/json.stub.php9
-rw-r--r--ext/json/json_arginfo.h28
35 files changed, 314 insertions, 86 deletions
diff --git a/ext/enchant/enchant.c b/ext/enchant/enchant.c
index 5661975820..1b22ad48fb 100644
--- a/ext/enchant/enchant.c
+++ b/ext/enchant/enchant.c
@@ -186,11 +186,7 @@ static void php_enchant_dict_free(zend_object *object) /* {{{ */
/* {{{ PHP_MINIT_FUNCTION */
PHP_MINIT_FUNCTION(enchant)
{
- zend_class_entry bce, dce;
-
- INIT_CLASS_ENTRY(bce, "EnchantBroker", class_EnchantBroker_methods);
- enchant_broker_ce = zend_register_internal_class(&bce);
- enchant_broker_ce->ce_flags |= ZEND_ACC_FINAL | ZEND_ACC_NO_DYNAMIC_PROPERTIES;
+ enchant_broker_ce = register_class_EnchantBroker();
enchant_broker_ce->create_object = enchant_broker_create_object;
enchant_broker_ce->serialize = zend_class_serialize_deny;
enchant_broker_ce->unserialize = zend_class_unserialize_deny;
@@ -200,9 +196,7 @@ PHP_MINIT_FUNCTION(enchant)
enchant_broker_handlers.free_obj = php_enchant_broker_free;
enchant_broker_handlers.clone_obj = NULL;
- INIT_CLASS_ENTRY(dce, "EnchantDictionary", class_EnchantDictionary_methods);
- enchant_dict_ce = zend_register_internal_class(&dce);
- enchant_dict_ce->ce_flags |= ZEND_ACC_FINAL | ZEND_ACC_NO_DYNAMIC_PROPERTIES;
+ enchant_dict_ce = register_class_EnchantDictionary();
enchant_dict_ce->create_object = enchant_dict_create_object;
enchant_dict_ce->serialize = zend_class_serialize_deny;
enchant_dict_ce->unserialize = zend_class_unserialize_deny;
diff --git a/ext/enchant/enchant.stub.php b/ext/enchant/enchant.stub.php
index dcd11cea38..feba5d88d7 100644
--- a/ext/enchant/enchant.stub.php
+++ b/ext/enchant/enchant.stub.php
@@ -1,11 +1,16 @@
<?php
-/** @generate-function-entries */
+/**
+ * @generate-function-entries
+ * @generate-class-entries
+ */
+/** @strict-properties */
final class EnchantBroker
{
}
+/** @strict-properties */
final class EnchantDictionary
{
}
diff --git a/ext/enchant/enchant_arginfo.h b/ext/enchant/enchant_arginfo.h
index 34fa122b54..e0d020cc68 100644
--- a/ext/enchant/enchant_arginfo.h
+++ b/ext/enchant/enchant_arginfo.h
@@ -1,5 +1,5 @@
/* This is a generated file, edit the .stub.php file instead.
- * Stub hash: 31f7c4cd39e58d6474b90acd65f4b7bda7a6ddf3 */
+ * Stub hash: ec1ad38320dfec1e567b0f0062dbc032c425945c */
ZEND_BEGIN_ARG_WITH_RETURN_OBJ_TYPE_MASK_EX(arginfo_enchant_broker_init, 0, 0, EnchantBroker, MAY_BE_FALSE)
ZEND_END_ARG_INFO()
@@ -157,3 +157,26 @@ static const zend_function_entry class_EnchantBroker_methods[] = {
static const zend_function_entry class_EnchantDictionary_methods[] = {
ZEND_FE_END
};
+
+zend_class_entry *register_class_EnchantBroker()
+{
+ zend_class_entry ce, *class_entry;
+
+ INIT_CLASS_ENTRY(ce, "EnchantBroker", class_EnchantBroker_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;
+}
+
+zend_class_entry *register_class_EnchantDictionary()
+{
+ zend_class_entry ce, *class_entry;
+
+ INIT_CLASS_ENTRY(ce, "EnchantDictionary", class_EnchantDictionary_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;
+}
+
diff --git a/ext/exif/exif.stub.php b/ext/exif/exif.stub.php
index 9a8afe8577..b277a8daad 100644
--- a/ext/exif/exif.stub.php
+++ b/ext/exif/exif.stub.php
@@ -1,6 +1,9 @@
<?php
-/** @generate-function-entries */
+/**
+ * @generate-function-entries
+ * @generate-class-entries
+ */
function exif_tagname(int $index): string|false {}
diff --git a/ext/exif/exif_arginfo.h b/ext/exif/exif_arginfo.h
index 91dd8b0e61..7159380408 100644
--- a/ext/exif/exif_arginfo.h
+++ b/ext/exif/exif_arginfo.h
@@ -1,5 +1,5 @@
/* This is a generated file, edit the .stub.php file instead.
- * Stub hash: ef23ff502ea9658af29e50d57366c281f7a7eb6c */
+ * Stub hash: 3dde1567a65ab31bd5722ea6d568050420f89439 */
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_exif_tagname, 0, 1, MAY_BE_STRING|MAY_BE_FALSE)
ZEND_ARG_TYPE_INFO(0, index, IS_LONG, 0)
@@ -37,3 +37,4 @@ static const zend_function_entry ext_functions[] = {
ZEND_FE(exif_imagetype, arginfo_exif_imagetype)
ZEND_FE_END
};
+
diff --git a/ext/ffi/ffi.c b/ext/ffi/ffi.c
index e18da8bf7a..cc6e2a5440 100644
--- a/ext/ffi/ffi.c
+++ b/ext/ffi/ffi.c
@@ -4880,22 +4880,15 @@ static int zend_ffi_preload(char *preload) /* {{{ */
/* {{{ ZEND_MINIT_FUNCTION */
ZEND_MINIT_FUNCTION(ffi)
{
- zend_class_entry ce;
-
REGISTER_INI_ENTRIES();
FFI_G(is_cli) = strcmp(sapi_module.name, "cli") == 0;
- INIT_NS_CLASS_ENTRY(ce, "FFI", "Exception", NULL);
- zend_ffi_exception_ce = zend_register_internal_class_ex(&ce, zend_ce_error);
+ zend_ffi_exception_ce = register_class_FFI_Exception(zend_ce_error);
- INIT_NS_CLASS_ENTRY(ce, "FFI", "ParserException", NULL);
- zend_ffi_parser_exception_ce = zend_register_internal_class_ex(&ce, zend_ffi_exception_ce);
- zend_ffi_parser_exception_ce->ce_flags |= ZEND_ACC_FINAL;
+ zend_ffi_parser_exception_ce = register_class_FFI_ParserException(zend_ffi_exception_ce);
- INIT_CLASS_ENTRY(ce, "FFI", class_FFI_methods);
- zend_ffi_ce = zend_register_internal_class(&ce);
- zend_ffi_ce->ce_flags |= ZEND_ACC_FINAL;
+ zend_ffi_ce = register_class_FFI();
zend_ffi_ce->create_object = zend_ffi_new;
zend_ffi_ce->serialize = zend_class_serialize_deny;
zend_ffi_ce->unserialize = zend_class_unserialize_deny;
@@ -4930,9 +4923,7 @@ ZEND_MINIT_FUNCTION(ffi)
zend_declare_class_constant_long(zend_ffi_ce, "__BIGGEST_ALIGNMENT__", sizeof("__BIGGEST_ALIGNMENT__")-1, __BIGGEST_ALIGNMENT__);
- INIT_NS_CLASS_ENTRY(ce, "FFI", "CData", NULL);
- zend_ffi_cdata_ce = zend_register_internal_class(&ce);
- zend_ffi_cdata_ce->ce_flags |= ZEND_ACC_FINAL;
+ zend_ffi_cdata_ce = register_class_FFI_CData();
zend_ffi_cdata_ce->create_object = zend_ffi_cdata_new;
zend_ffi_cdata_ce->get_iterator = zend_ffi_cdata_get_iterator;
zend_ffi_cdata_ce->serialize = zend_class_serialize_deny;
@@ -5008,9 +4999,7 @@ ZEND_MINIT_FUNCTION(ffi)
zend_ffi_cdata_free_handlers.get_properties = zend_fake_get_properties;
zend_ffi_cdata_free_handlers.get_gc = zend_fake_get_gc;
- INIT_NS_CLASS_ENTRY(ce, "FFI", "CType", class_FFI_CType_methods);
- zend_ffi_ctype_ce = zend_register_internal_class(&ce);
- zend_ffi_ctype_ce->ce_flags |= ZEND_ACC_FINAL;
+ zend_ffi_ctype_ce = register_class_FFI_CType();
zend_ffi_ctype_ce->create_object = zend_ffi_ctype_new;
zend_ffi_ctype_ce->serialize = zend_class_serialize_deny;
zend_ffi_ctype_ce->unserialize = zend_class_unserialize_deny;
diff --git a/ext/ffi/ffi.stub.php b/ext/ffi/ffi.stub.php
index dba2dcc308..c86956c95f 100644
--- a/ext/ffi/ffi.stub.php
+++ b/ext/ffi/ffi.stub.php
@@ -1,6 +1,9 @@
<?php
-/** @generate-function-entries */
+/**
+ * @generate-function-entries
+ * @generate-class-entries
+ */
namespace {
@@ -68,8 +71,17 @@ final class FFI
namespace FFI {
+final class CData {
+}
+
final class CType {
public function getName() : string {}
}
+class Exception extends \Error {
+}
+
+final class ParserException extends Exception {
+}
+
}
diff --git a/ext/ffi/ffi_arginfo.h b/ext/ffi/ffi_arginfo.h
index d9e9dec3d0..bb9850cfb3 100644
--- a/ext/ffi/ffi_arginfo.h
+++ b/ext/ffi/ffi_arginfo.h
@@ -1,5 +1,5 @@
/* This is a generated file, edit the .stub.php file instead.
- * Stub hash: 5aeec68fea7a94cd643464acfb10bf4cfcc863da */
+ * Stub hash: f8eb234b7efa2060f54ed300fc6fa697741b0ab6 */
ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_class_FFI_cdef, 0, 0, FFI, 0)
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, code, IS_STRING, 0, "\"\"")
@@ -125,7 +125,77 @@ static const zend_function_entry class_FFI_methods[] = {
};
+static const zend_function_entry class_FFI_CData_methods[] = {
+ ZEND_FE_END
+};
+
+
static const zend_function_entry class_FFI_CType_methods[] = {
ZEND_ME(FFI_CType, getName, arginfo_class_FFI_CType_getName, ZEND_ACC_PUBLIC)
ZEND_FE_END
};
+
+
+static const zend_function_entry class_FFI_Exception_methods[] = {
+ ZEND_FE_END
+};
+
+
+static const zend_function_entry class_FFI_ParserException_methods[] = {
+ ZEND_FE_END
+};
+
+zend_class_entry *register_class_FFI()
+{
+ zend_class_entry ce, *class_entry;
+
+ INIT_CLASS_ENTRY(ce, "FFI", class_FFI_methods);
+ class_entry = zend_register_internal_class_ex(&ce, NULL);
+ class_entry->ce_flags |= ZEND_ACC_FINAL;
+
+ return class_entry;
+}
+
+zend_class_entry *register_class_FFI_CData()
+{
+ zend_class_entry ce, *class_entry;
+
+ INIT_NS_CLASS_ENTRY(ce, "FFI", "CData", class_FFI_CData_methods);
+ class_entry = zend_register_internal_class_ex(&ce, NULL);
+ class_entry->ce_flags |= ZEND_ACC_FINAL;
+
+ return class_entry;
+}
+
+zend_class_entry *register_class_FFI_CType()
+{
+ zend_class_entry ce, *class_entry;
+
+ INIT_NS_CLASS_ENTRY(ce, "FFI", "CType", class_FFI_CType_methods);
+ class_entry = zend_register_internal_class_ex(&ce, NULL);
+ class_entry->ce_flags |= ZEND_ACC_FINAL;
+
+ return class_entry;
+}
+
+zend_class_entry *register_class_FFI_Exception(zend_class_entry *class_entry_Error)
+{
+ zend_class_entry ce, *class_entry;
+
+ INIT_NS_CLASS_ENTRY(ce, "FFI", "Exception", class_FFI_Exception_methods);
+ class_entry = zend_register_internal_class_ex(&ce, class_entry_Error);
+
+ return class_entry;
+}
+
+zend_class_entry *register_class_FFI_ParserException(zend_class_entry *class_entry_FFI_Exception)
+{
+ zend_class_entry ce, *class_entry;
+
+ INIT_NS_CLASS_ENTRY(ce, "FFI", "ParserException", class_FFI_ParserException_methods);
+ class_entry = zend_register_internal_class_ex(&ce, class_entry_FFI_Exception);
+ class_entry->ce_flags |= ZEND_ACC_FINAL;
+
+ return class_entry;
+}
+
diff --git a/ext/fileinfo/fileinfo.c b/ext/fileinfo/fileinfo.c
index 5670debe4a..cc27206282 100644
--- a/ext/fileinfo/fileinfo.c
+++ b/ext/fileinfo/fileinfo.c
@@ -107,9 +107,7 @@ PHP_FILEINFO_API zend_object *finfo_objects_new(zend_class_entry *class_type)
/* {{{ PHP_MINIT_FUNCTION */
PHP_MINIT_FUNCTION(finfo)
{
- zend_class_entry _finfo_class_entry;
- INIT_CLASS_ENTRY(_finfo_class_entry, "finfo", class_finfo_methods);
- finfo_class_entry = zend_register_internal_class(&_finfo_class_entry);
+ finfo_class_entry = register_class_finfo();
finfo_class_entry->create_object = finfo_objects_new;
finfo_class_entry->serialize = zend_class_serialize_deny;
finfo_class_entry->unserialize = zend_class_unserialize_deny;
diff --git a/ext/fileinfo/fileinfo.stub.php b/ext/fileinfo/fileinfo.stub.php
index 5a498b79c1..cb9e639b2f 100644
--- a/ext/fileinfo/fileinfo.stub.php
+++ b/ext/fileinfo/fileinfo.stub.php
@@ -1,6 +1,9 @@
<?php
-/** @generate-function-entries */
+/**
+ * @generate-function-entries
+ * @generate-class-entries
+ */
class finfo
{
diff --git a/ext/fileinfo/fileinfo_arginfo.h b/ext/fileinfo/fileinfo_arginfo.h
index 3fe1f28a02..4921a546b5 100644
--- a/ext/fileinfo/fileinfo_arginfo.h
+++ b/ext/fileinfo/fileinfo_arginfo.h
@@ -1,5 +1,5 @@
/* This is a generated file, edit the .stub.php file instead.
- * Stub hash: 1282a20b1d007bbcc9c0d4efe400db43a5450307 */
+ * Stub hash: ae5759febdd7ad434c8bf2e23e9da334ff9054dd */
ZEND_BEGIN_ARG_WITH_RETURN_OBJ_TYPE_MASK_EX(arginfo_finfo_open, 0, 0, finfo, MAY_BE_FALSE)
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, flags, IS_LONG, 0, "FILEINFO_NONE")
@@ -81,3 +81,14 @@ static const zend_function_entry class_finfo_methods[] = {
ZEND_ME_MAPPING(set_flags, finfo_set_flags, arginfo_class_finfo_set_flags, ZEND_ACC_PUBLIC)
ZEND_FE_END
};
+
+zend_class_entry *register_class_finfo()
+{
+ zend_class_entry ce, *class_entry;
+
+ INIT_CLASS_ENTRY(ce, "finfo", class_finfo_methods);
+ class_entry = zend_register_internal_class_ex(&ce, NULL);
+
+ return class_entry;
+}
+
diff --git a/ext/filter/filter.stub.php b/ext/filter/filter.stub.php
index de92b93519..652f5d1431 100644
--- a/ext/filter/filter.stub.php
+++ b/ext/filter/filter.stub.php
@@ -1,6 +1,9 @@
<?php
-/** @generate-function-entries */
+/**
+ * @generate-function-entries
+ * @generate-class-entries
+ */
function filter_has_var(int $input_type, string $var_name): bool {}
diff --git a/ext/filter/filter_arginfo.h b/ext/filter/filter_arginfo.h
index c4e4479e79..f102c5902a 100644
--- a/ext/filter/filter_arginfo.h
+++ b/ext/filter/filter_arginfo.h
@@ -1,5 +1,5 @@
/* This is a generated file, edit the .stub.php file instead.
- * Stub hash: b5f2e4a79eb6f30fe143b3086845435d0a0a6ef0 */
+ * Stub hash: dc73178b6c82437ae4eec49984613563018d3bde */
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_filter_has_var, 0, 2, _IS_BOOL, 0)
ZEND_ARG_TYPE_INFO(0, input_type, IS_LONG, 0)
@@ -58,3 +58,4 @@ static const zend_function_entry ext_functions[] = {
ZEND_FE(filter_id, arginfo_filter_id)
ZEND_FE_END
};
+
diff --git a/ext/ftp/ftp.stub.php b/ext/ftp/ftp.stub.php
index 698cfe215c..9bf3265e40 100644
--- a/ext/ftp/ftp.stub.php
+++ b/ext/ftp/ftp.stub.php
@@ -1,6 +1,14 @@
<?php
-/** @generate-function-entries */
+/**
+ * @generate-function-entries
+ * @generate-class-entries
+ */
+
+/** @strict-properties */
+final class FTPConnection
+{
+}
function ftp_connect(string $hostname, int $port = 21, int $timeout = 90): FTPConnection|false {}
diff --git a/ext/ftp/ftp_arginfo.h b/ext/ftp/ftp_arginfo.h
index 30251b87ee..39f0170ee6 100644
--- a/ext/ftp/ftp_arginfo.h
+++ b/ext/ftp/ftp_arginfo.h
@@ -1,5 +1,5 @@
/* This is a generated file, edit the .stub.php file instead.
- * Stub hash: 151310a13eeeb2bbf4df1ab38a3a29506b26a570 */
+ * Stub hash: d72294d567338c30f627b8247a8cc27148237e41 */
ZEND_BEGIN_ARG_WITH_RETURN_OBJ_TYPE_MASK_EX(arginfo_ftp_connect, 0, 1, FTPConnection, MAY_BE_FALSE)
ZEND_ARG_TYPE_INFO(0, hostname, IS_STRING, 0)
@@ -274,3 +274,20 @@ static const zend_function_entry ext_functions[] = {
ZEND_FE(ftp_get_option, arginfo_ftp_get_option)
ZEND_FE_END
};
+
+
+static const zend_function_entry class_FTPConnection_methods[] = {
+ ZEND_FE_END
+};
+
+zend_class_entry *register_class_FTPConnection()
+{
+ zend_class_entry ce, *class_entry;
+
+ INIT_CLASS_ENTRY(ce, "FTPConnection", class_FTPConnection_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;
+}
+
diff --git a/ext/ftp/php_ftp.c b/ext/ftp/php_ftp.c
index 2b944f04e6..52d88fcf96 100644
--- a/ext/ftp/php_ftp.c
+++ b/ext/ftp/php_ftp.c
@@ -97,8 +97,6 @@ static void ftp_object_destroy(zend_object *zobj) {
PHP_MINIT_FUNCTION(ftp)
{
- zend_class_entry ce;
-
#ifdef HAVE_FTP_SSL
#if OPENSSL_VERSION_NUMBER < 0x10101000 && !defined(LIBRESSL_VERSION_NUMBER)
SSL_library_init();
@@ -110,9 +108,7 @@ PHP_MINIT_FUNCTION(ftp)
#endif
#endif
- INIT_CLASS_ENTRY(ce, "FTPConnection", NULL);
- php_ftp_ce = zend_register_internal_class(&ce);
- php_ftp_ce->ce_flags |= ZEND_ACC_FINAL | ZEND_ACC_NO_DYNAMIC_PROPERTIES;
+ php_ftp_ce = register_class_FTPConnection();
php_ftp_ce->create_object = ftp_object_create;
php_ftp_ce->serialize = zend_class_serialize_deny;
php_ftp_ce->unserialize = zend_class_unserialize_deny;
diff --git a/ext/gd/gd.c b/ext/gd/gd.c
index aecca33c8b..8dfb201402 100644
--- a/ext/gd/gd.c
+++ b/ext/gd/gd.c
@@ -217,10 +217,7 @@ void php_gd_assign_libgdimageptr_as_extgdimage(zval *val, gdImagePtr image)
static void php_gd_object_minit_helper()
{
- zend_class_entry ce;
- INIT_CLASS_ENTRY(ce, "GdImage", class_GdImage_methods);
- gd_image_ce = zend_register_internal_class(&ce);
- gd_image_ce->ce_flags |= ZEND_ACC_FINAL | ZEND_ACC_NO_DYNAMIC_PROPERTIES;
+ gd_image_ce = register_class_GdImage();
gd_image_ce->create_object = php_gd_image_object_create;
gd_image_ce->serialize = zend_class_serialize_deny;
gd_image_ce->unserialize = zend_class_unserialize_deny;
@@ -287,10 +284,7 @@ static zend_function *php_gd_font_object_get_constructor(zend_object *object)
static void php_gd_font_minit_helper()
{
- zend_class_entry ce;
- INIT_CLASS_ENTRY(ce, "GdFont", class_GdFont_methods);
- gd_font_ce = zend_register_internal_class(&ce);
- gd_font_ce->ce_flags |= ZEND_ACC_FINAL | ZEND_ACC_NO_DYNAMIC_PROPERTIES;
+ gd_font_ce = register_class_GdFont();
gd_font_ce->create_object = php_gd_font_object_create;
gd_font_ce->serialize = zend_class_serialize_deny;
gd_font_ce->unserialize = zend_class_unserialize_deny;
diff --git a/ext/gd/gd.stub.php b/ext/gd/gd.stub.php
index 0ef410fc1e..fdc56bc467 100644
--- a/ext/gd/gd.stub.php
+++ b/ext/gd/gd.stub.php
@@ -1,8 +1,13 @@
<?php
-/** @generate-function-entries */
+/**
+ * @generate-function-entries
+ * @generate-class-entries
+ */
+/** @strict-properties */
final class GdImage {}
+/** @strict-properties */
final class GdFont {}
function gd_info(): array {}
diff --git a/ext/gd/gd_arginfo.h b/ext/gd/gd_arginfo.h
index ea61b08374..01a79f9f2a 100644
--- a/ext/gd/gd_arginfo.h
+++ b/ext/gd/gd_arginfo.h
@@ -1,5 +1,5 @@
/* This is a generated file, edit the .stub.php file instead.
- * Stub hash: 23b7c8395c628239fb10d746ca6bba72871ee9f3 */
+ * Stub hash: 174cec5de1eb55d1fe837648255ee56553cdad6e */
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_gd_info, 0, 0, IS_ARRAY, 0)
ZEND_END_ARG_INFO()
@@ -836,3 +836,26 @@ static const zend_function_entry class_GdImage_methods[] = {
static const zend_function_entry class_GdFont_methods[] = {
ZEND_FE_END
};
+
+zend_class_entry *register_class_GdImage()
+{
+ zend_class_entry ce, *class_entry;
+
+ INIT_CLASS_ENTRY(ce, "GdImage", class_GdImage_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;
+}
+
+zend_class_entry *register_class_GdFont()
+{
+ zend_class_entry ce, *class_entry;
+
+ INIT_CLASS_ENTRY(ce, "GdFont", class_GdFont_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;
+}
+
diff --git a/ext/gettext/gettext.stub.php b/ext/gettext/gettext.stub.php
index 84654ab741..7a9716361e 100644
--- a/ext/gettext/gettext.stub.php
+++ b/ext/gettext/gettext.stub.php
@@ -1,6 +1,9 @@
<?php
-/** @generate-function-entries */
+/**
+ * @generate-function-entries
+ * @generate-class-entries
+ */
function textdomain(?string $domain): string {}
diff --git a/ext/gettext/gettext_arginfo.h b/ext/gettext/gettext_arginfo.h
index 32811d5b66..949a57e4ac 100644
--- a/ext/gettext/gettext_arginfo.h
+++ b/ext/gettext/gettext_arginfo.h
@@ -1,5 +1,5 @@
/* This is a generated file, edit the .stub.php file instead.
- * Stub hash: 3fbd90b87dfcbc5a1a0a2aea8d0cc45516e221ce */
+ * Stub hash: 4a111861e8302c685ba08073dacf9f120307d89a */
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_textdomain, 0, 1, IS_STRING, 0)
ZEND_ARG_TYPE_INFO(0, domain, IS_STRING, 1)
@@ -102,3 +102,4 @@ static const zend_function_entry ext_functions[] = {
#endif
ZEND_FE_END
};
+
diff --git a/ext/gmp/gmp.c b/ext/gmp/gmp.c
index 55567f5c6d..78c286cc83 100644
--- a/ext/gmp/gmp.c
+++ b/ext/gmp/gmp.c
@@ -527,9 +527,7 @@ static ZEND_GINIT_FUNCTION(gmp)
/* {{{ ZEND_MINIT_FUNCTION */
ZEND_MINIT_FUNCTION(gmp)
{
- zend_class_entry tmp_ce;
- INIT_CLASS_ENTRY(tmp_ce, "GMP", class_GMP_methods);
- gmp_ce = zend_register_internal_class(&tmp_ce);
+ gmp_ce = register_class_GMP();
gmp_ce->create_object = gmp_create_object;
gmp_ce->serialize = gmp_serialize;
gmp_ce->unserialize = gmp_unserialize;
diff --git a/ext/gmp/gmp.stub.php b/ext/gmp/gmp.stub.php
index 729ae37245..77dbfef5e1 100644
--- a/ext/gmp/gmp.stub.php
+++ b/ext/gmp/gmp.stub.php
@@ -1,6 +1,9 @@
<?php
-/** @generate-function-entries */
+/**
+ * @generate-function-entries
+ * @generate-class-entries
+ */
class GMP
{
diff --git a/ext/gmp/gmp_arginfo.h b/ext/gmp/gmp_arginfo.h
index fd341edbb5..ed4b49caf3 100644
--- a/ext/gmp/gmp_arginfo.h
+++ b/ext/gmp/gmp_arginfo.h
@@ -1,5 +1,5 @@
/* This is a generated file, edit the .stub.php file instead.
- * Stub hash: a1eb4fd58c0b2155692611386c77035f1ef11c2c */
+ * Stub hash: 97664dc0e71160eacf28f604964df4e9bc97fde5 */
ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_gmp_init, 0, 1, GMP, 0)
ZEND_ARG_TYPE_MASK(0, num, MAY_BE_LONG|MAY_BE_STRING, NULL)
@@ -296,3 +296,14 @@ static const zend_function_entry ext_functions[] = {
static const zend_function_entry class_GMP_methods[] = {
ZEND_FE_END
};
+
+zend_class_entry *register_class_GMP()
+{
+ zend_class_entry ce, *class_entry;
+
+ INIT_CLASS_ENTRY(ce, "GMP", class_GMP_methods);
+ class_entry = zend_register_internal_class_ex(&ce, NULL);
+
+ return class_entry;
+}
+
diff --git a/ext/hash/hash.c b/ext/hash/hash.c
index 216f80687e..bf1d1577ca 100644
--- a/ext/hash/hash.c
+++ b/ext/hash/hash.c
@@ -1557,8 +1557,6 @@ PHP_METHOD(HashContext, __unserialize)
/* {{{ PHP_MINIT_FUNCTION */
PHP_MINIT_FUNCTION(hash)
{
- zend_class_entry ce;
-
zend_hash_init(&php_hash_hashtable, 35, NULL, NULL, 1);
php_hash_register_algo("md2", &php_hash_md2_ops);
@@ -1627,9 +1625,7 @@ PHP_MINIT_FUNCTION(hash)
REGISTER_LONG_CONSTANT("HASH_HMAC", PHP_HASH_HMAC, CONST_CS | CONST_PERSISTENT);
- INIT_CLASS_ENTRY(ce, "HashContext", class_HashContext_methods);
- php_hashcontext_ce = zend_register_internal_class(&ce);
- php_hashcontext_ce->ce_flags |= ZEND_ACC_FINAL;
+ php_hashcontext_ce = register_class_HashContext();
php_hashcontext_ce->create_object = php_hashcontext_create;
memcpy(&php_hashcontext_handlers, &std_object_handlers,
diff --git a/ext/hash/hash.stub.php b/ext/hash/hash.stub.php
index 7eb3925c35..fe5516ad7e 100644
--- a/ext/hash/hash.stub.php
+++ b/ext/hash/hash.stub.php
@@ -1,6 +1,9 @@
<?php
-/** @generate-function-entries */
+/**
+ * @generate-function-entries
+ * @generate-class-entries
+ */
function hash(string $algo, string $data, bool $binary = false, array $options = []): string|false {}
diff --git a/ext/hash/hash_arginfo.h b/ext/hash/hash_arginfo.h
index 1d654b546e..0272f3fd99 100644
--- a/ext/hash/hash_arginfo.h
+++ b/ext/hash/hash_arginfo.h
@@ -1,5 +1,5 @@
/* This is a generated file, edit the .stub.php file instead.
- * Stub hash: e8466049fca2eae179adbc19bb67e71f6486ec4e */
+ * Stub hash: 58f4af6d45c5e69afd2bcee3207397654980f13e */
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_hash, 0, 2, MAY_BE_STRING|MAY_BE_FALSE)
ZEND_ARG_TYPE_INFO(0, algo, IS_STRING, 0)
@@ -204,3 +204,15 @@ static const zend_function_entry class_HashContext_methods[] = {
ZEND_ME(HashContext, __unserialize, arginfo_class_HashContext___unserialize, ZEND_ACC_PUBLIC)
ZEND_FE_END
};
+
+zend_class_entry *register_class_HashContext()
+{
+ zend_class_entry ce, *class_entry;
+
+ INIT_CLASS_ENTRY(ce, "HashContext", class_HashContext_methods);
+ class_entry = zend_register_internal_class_ex(&ce, NULL);
+ class_entry->ce_flags |= ZEND_ACC_FINAL;
+
+ return class_entry;
+}
+
diff --git a/ext/iconv/iconv.stub.php b/ext/iconv/iconv.stub.php
index 84dc48a5e9..f0d39238ff 100644
--- a/ext/iconv/iconv.stub.php
+++ b/ext/iconv/iconv.stub.php
@@ -1,6 +1,9 @@
<?php
-/** @generate-function-entries */
+/**
+ * @generate-function-entries
+ * @generate-class-entries
+ */
function iconv_strlen(string $string, ?string $encoding = null): int|false {}
diff --git a/ext/iconv/iconv_arginfo.h b/ext/iconv/iconv_arginfo.h
index 619d52631f..3a07b8a8ac 100644
--- a/ext/iconv/iconv_arginfo.h
+++ b/ext/iconv/iconv_arginfo.h
@@ -1,5 +1,5 @@
/* This is a generated file, edit the .stub.php file instead.
- * Stub hash: 5d05deb60466c6e1ee73b44ad0b09a032bc8410e */
+ * Stub hash: c301856deffe269e4bbf1554d9eba4d5cbbb20e8 */
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_iconv_strlen, 0, 1, MAY_BE_LONG|MAY_BE_FALSE)
ZEND_ARG_TYPE_INFO(0, string, IS_STRING, 0)
@@ -85,3 +85,4 @@ static const zend_function_entry ext_functions[] = {
ZEND_FE(iconv_get_encoding, arginfo_iconv_get_encoding)
ZEND_FE_END
};
+
diff --git a/ext/imap/php_imap.c b/ext/imap/php_imap.c
index aa547da000..e62d6f7b2a 100644
--- a/ext/imap/php_imap.c
+++ b/ext/imap/php_imap.c
@@ -444,7 +444,6 @@ static PHP_GINIT_FUNCTION(imap)
/* {{{ PHP_MINIT_FUNCTION */
PHP_MINIT_FUNCTION(imap)
{
- zend_class_entry ce;
unsigned long sa_all = SA_MESSAGES | SA_RECENT | SA_UNSEEN | SA_UIDNEXT | SA_UIDVALIDITY;
REGISTER_INI_ENTRIES();
@@ -478,10 +477,7 @@ PHP_MINIT_FUNCTION(imap)
ssl_onceonlyinit ();
#endif
-
- INIT_CLASS_ENTRY(ce, "IMAPConnection", class_IMAPConnection_methods);
- php_imap_ce = zend_register_internal_class(&ce);
- php_imap_ce->ce_flags |= ZEND_ACC_FINAL | ZEND_ACC_NO_DYNAMIC_PROPERTIES;
+ php_imap_ce = register_class_IMAPConnection();
php_imap_ce->create_object = imap_object_create;
php_imap_ce->serialize = zend_class_serialize_deny;
php_imap_ce->unserialize = zend_class_unserialize_deny;
diff --git a/ext/imap/php_imap.stub.php b/ext/imap/php_imap.stub.php
index bd4b04a121..18495683b9 100644
--- a/ext/imap/php_imap.stub.php
+++ b/ext/imap/php_imap.stub.php
@@ -1,8 +1,12 @@
<?php
-/** @generate-function-entries */
-final class IMAPConnection {
+/**
+ * @generate-function-entries
+ * @generate-class-entries
+ */
+/** @strict-properties */
+final class IMAPConnection {
}
function imap_open(string $mailbox, string $user, string $password, int $flags = 0, int $retries = 0, array $options = []): IMAPConnection|false {}
diff --git a/ext/imap/php_imap_arginfo.h b/ext/imap/php_imap_arginfo.h
index f7f999e3d6..32e1e6987a 100644
--- a/ext/imap/php_imap_arginfo.h
+++ b/ext/imap/php_imap_arginfo.h
@@ -1,5 +1,5 @@
/* This is a generated file, edit the .stub.php file instead.
- * Stub hash: 2b4a654a6a247e59e3213715ecee9c7b837b0249 */
+ * Stub hash: a1e3bdfdd48746db4743e1667d7ba53832160142 */
ZEND_BEGIN_ARG_WITH_RETURN_OBJ_TYPE_MASK_EX(arginfo_imap_open, 0, 3, IMAPConnection, MAY_BE_FALSE)
ZEND_ARG_TYPE_INFO(0, mailbox, IS_STRING, 0)
@@ -517,3 +517,15 @@ static const zend_function_entry ext_functions[] = {
static const zend_function_entry class_IMAPConnection_methods[] = {
ZEND_FE_END
};
+
+zend_class_entry *register_class_IMAPConnection()
+{
+ zend_class_entry ce, *class_entry;
+
+ INIT_CLASS_ENTRY(ce, "IMAPConnection", class_IMAPConnection_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;
+}
+
diff --git a/ext/json/json.c b/ext/json/json.c
index 872766239e..5315966f7d 100644
--- a/ext/json/json.c
+++ b/ext/json/json.c
@@ -44,13 +44,9 @@ PHP_JSON_API ZEND_DECLARE_MODULE_GLOBALS(json)
/* {{{ MINIT */
static PHP_MINIT_FUNCTION(json)
{
- zend_class_entry ce;
+ php_json_serializable_ce = register_class_JsonSerializable();
- INIT_CLASS_ENTRY(ce, "JsonSerializable", class_JsonSerializable_methods);
- php_json_serializable_ce = zend_register_internal_interface(&ce);
-
- INIT_CLASS_ENTRY(ce, "JsonException", NULL);
- php_json_exception_ce = zend_register_internal_class_ex(&ce, zend_ce_exception);
+ php_json_exception_ce = register_class_JsonException(zend_ce_exception);
/* options for json_encode */
PHP_JSON_REGISTER_CONSTANT("JSON_HEX_TAG", PHP_JSON_HEX_TAG);
diff --git a/ext/json/json.stub.php b/ext/json/json.stub.php
index a9b5bbf511..bf64f49408 100644
--- a/ext/json/json.stub.php
+++ b/ext/json/json.stub.php
@@ -1,6 +1,9 @@
<?php
-/** @generate-function-entries */
+/**
+ * @generate-function-entries
+ * @generate-class-entries
+ */
function json_encode(mixed $value, int $flags = 0, int $depth = 512): string|false {}
@@ -15,3 +18,7 @@ interface JsonSerializable
/** @return mixed */
public function jsonSerialize();
}
+
+class JsonException extends Exception
+{
+}
diff --git a/ext/json/json_arginfo.h b/ext/json/json_arginfo.h
index c4b20d7013..9cf5fad6ff 100644
--- a/ext/json/json_arginfo.h
+++ b/ext/json/json_arginfo.h
@@ -1,5 +1,5 @@
/* This is a generated file, edit the .stub.php file instead.
- * Stub hash: 2d1e6c422221ec7efbbd540ee777a5ce2c639943 */
+ * Stub hash: bb9d306951484ce32054dff31dde37638f2841dc */
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_json_encode, 0, 1, MAY_BE_STRING|MAY_BE_FALSE)
ZEND_ARG_TYPE_INFO(0, value, IS_MIXED, 0)
@@ -43,3 +43,29 @@ static const zend_function_entry class_JsonSerializable_methods[] = {
ZEND_ABSTRACT_ME_WITH_FLAGS(JsonSerializable, jsonSerialize, arginfo_class_JsonSerializable_jsonSerialize, ZEND_ACC_PUBLIC|ZEND_ACC_ABSTRACT)
ZEND_FE_END
};
+
+
+static const zend_function_entry class_JsonException_methods[] = {
+ ZEND_FE_END
+};
+
+zend_class_entry *register_class_JsonSerializable()
+{
+ zend_class_entry ce, *class_entry;
+
+ INIT_CLASS_ENTRY(ce, "JsonSerializable", class_JsonSerializable_methods);
+ class_entry = zend_register_internal_interface(&ce);
+
+ return class_entry;
+}
+
+zend_class_entry *register_class_JsonException(zend_class_entry *class_entry_Exception)
+{
+ zend_class_entry ce, *class_entry;
+
+ INIT_CLASS_ENTRY(ce, "JsonException", class_JsonException_methods);
+ class_entry = zend_register_internal_class_ex(&ce, class_entry_Exception);
+
+ return class_entry;
+}
+