]> granicus.if.org Git - php/commitdiff
Generate method entries from stubs for Zend classes
authorMáté Kocsis <kocsismate@woohoolabs.com>
Sat, 25 Apr 2020 21:10:07 +0000 (23:10 +0200)
committerMáté Kocsis <kocsismate@woohoolabs.com>
Sun, 26 Apr 2020 09:13:14 +0000 (11:13 +0200)
Closes GH-5459

14 files changed:
Zend/zend_exceptions.c
Zend/zend_exceptions.stub.php
Zend/zend_exceptions_arginfo.h
Zend/zend_generators.c
Zend/zend_generators.stub.php
Zend/zend_generators_arginfo.h
Zend/zend_interfaces.c
Zend/zend_interfaces.h
Zend/zend_interfaces.stub.php
Zend/zend_interfaces_arginfo.h
Zend/zend_weakrefs.c
Zend/zend_weakrefs.stub.php
Zend/zend_weakrefs_arginfo.h
sapi/cli/tests/005.phpt

index 60893095aed1bf97d25db97ac658812b62f00762..4fc283755c99a2efa52964a63fd3c53a06605a4c 100644 (file)
@@ -258,7 +258,7 @@ static zend_object *zend_error_exception_new(zend_class_entry *class_type) /* {{
 
 /* {{{ proto Exception|Error Exception|Error::__clone()
    Clone the exception object */
-ZEND_COLD ZEND_METHOD(exception, __clone)
+ZEND_COLD ZEND_METHOD(Exception, __clone)
 {
        /* Should never be executable */
        zend_throw_exception(NULL, "Cannot clone object using __clone()", 0);
@@ -267,7 +267,7 @@ ZEND_COLD ZEND_METHOD(exception, __clone)
 
 /* {{{ proto Exception|Error::__construct(string message, int code [, Throwable previous])
    Exception constructor */
-ZEND_METHOD(exception, __construct)
+ZEND_METHOD(Exception, __construct)
 {
        zend_string *message = NULL;
        zend_long   code = 0;
@@ -305,7 +305,7 @@ ZEND_METHOD(exception, __construct)
                zend_unset_property(i_get_exception_base(object), object, ZSTR_VAL(ZSTR_KNOWN(id)), ZSTR_LEN(ZSTR_KNOWN(id))); \
        }
 
-ZEND_METHOD(exception, __wakeup)
+ZEND_METHOD(Exception, __wakeup)
 {
        zval value, *pvalue;
        zval *object = ZEND_THIS;
@@ -326,7 +326,7 @@ ZEND_METHOD(exception, __wakeup)
 
 /* {{{ proto ErrorException::__construct(string message, int code, int severity [, string filename [, int lineno [, Throwable previous]]])
    ErrorException constructor */
-ZEND_METHOD(error_exception, __construct)
+ZEND_METHOD(ErrorException, __construct)
 {
        zend_string *message = NULL, *filename = NULL;
        zend_long   code = 0, severity = E_ERROR, lineno;
@@ -377,7 +377,7 @@ ZEND_METHOD(error_exception, __construct)
 
 /* {{{ proto string Exception|Error::getFile()
    Get the file in which the exception occurred */
-ZEND_METHOD(exception, getFile)
+ZEND_METHOD(Exception, getFile)
 {
        zval *prop, rv;
 
@@ -391,7 +391,7 @@ ZEND_METHOD(exception, getFile)
 
 /* {{{ proto int Exception|Error::getLine()
    Get the line in which the exception occurred */
-ZEND_METHOD(exception, getLine)
+ZEND_METHOD(Exception, getLine)
 {
        zval *prop, rv;
 
@@ -405,7 +405,7 @@ ZEND_METHOD(exception, getLine)
 
 /* {{{ proto string Exception|Error::getMessage()
    Get the exception message */
-ZEND_METHOD(exception, getMessage)
+ZEND_METHOD(Exception, getMessage)
 {
        zval *prop, rv;
 
@@ -419,7 +419,7 @@ ZEND_METHOD(exception, getMessage)
 
 /* {{{ proto int Exception|Error::getCode()
    Get the exception code */
-ZEND_METHOD(exception, getCode)
+ZEND_METHOD(Exception, getCode)
 {
        zval *prop, rv;
 
@@ -433,7 +433,7 @@ ZEND_METHOD(exception, getCode)
 
 /* {{{ proto array Exception|Error::getTrace()
    Get the stack trace for the location in which the exception occurred */
-ZEND_METHOD(exception, getTrace)
+ZEND_METHOD(Exception, getTrace)
 {
        zval *prop, rv;
 
@@ -447,7 +447,7 @@ ZEND_METHOD(exception, getTrace)
 
 /* {{{ proto int ErrorException::getSeverity()
    Get the exception severity */
-ZEND_METHOD(error_exception, getSeverity)
+ZEND_METHOD(ErrorException, getSeverity)
 {
        zval *prop, rv;
 
@@ -590,7 +590,7 @@ static void _build_trace_string(smart_str *str, HashTable *ht, uint32_t num) /*
 
 /* {{{ proto string Exception|Error::getTraceAsString()
    Obtain the backtrace for the exception as a string (instead of an array) */
-ZEND_METHOD(exception, getTraceAsString)
+ZEND_METHOD(Exception, getTraceAsString)
 {
        zval *trace, *frame, rv;
        zend_ulong index;
@@ -629,7 +629,7 @@ ZEND_METHOD(exception, getTraceAsString)
 
 /* {{{ proto Throwable Exception|Error::getPrevious()
    Return previous Throwable or NULL. */
-ZEND_METHOD(exception, getPrevious)
+ZEND_METHOD(Exception, getPrevious)
 {
        zval rv;
 
@@ -640,7 +640,7 @@ ZEND_METHOD(exception, getPrevious)
 
 /* {{{ proto string Exception|Error::__toString()
    Obtain the string representation of the Exception object */
-ZEND_METHOD(exception, __toString)
+ZEND_METHOD(Exception, __toString)
 {
        zval trace, *exception;
        zend_class_entry *base_ce;
@@ -733,51 +733,6 @@ ZEND_METHOD(exception, __toString)
 }
 /* }}} */
 
-/** {{{ Throwable method definition */
-static const zend_function_entry zend_funcs_throwable[] = {
-       ZEND_ABSTRACT_ME(throwable, getMessage,       arginfo_class_Throwable_getMessage)
-       ZEND_ABSTRACT_ME(throwable, getCode,          arginfo_class_Throwable_getCode)
-       ZEND_ABSTRACT_ME(throwable, getFile,          arginfo_class_Throwable_getFile)
-       ZEND_ABSTRACT_ME(throwable, getLine,          arginfo_class_Throwable_getLine)
-       ZEND_ABSTRACT_ME(throwable, getTrace,         arginfo_class_Throwable_getTrace)
-       ZEND_ABSTRACT_ME(throwable, getPrevious,      arginfo_class_Throwable_getPrevious)
-       ZEND_ABSTRACT_ME(throwable, getTraceAsString, arginfo_class_Throwable_getTraceAsString)
-       ZEND_FE_END
-};
-/* }}} */
-
-/* {{{ internal structs */
-/* All functions that may be used in uncaught exception handlers must be final
- * and must not throw exceptions. Otherwise we would need a facility to handle
- * such exceptions in that handler.
- * Also all getXY() methods are final because thy serve as read only access to
- * their corresponding properties, no more, no less. If after all you need to
- * override something then it is method __toString().
- * And never try to change the state of exceptions and never implement anything
- * that gives the user anything to accomplish this.
- */
-static const zend_function_entry default_exception_functions[] = {
-       ZEND_ME(exception, __clone, arginfo_class_Exception___clone, ZEND_ACC_PRIVATE|ZEND_ACC_FINAL)
-       ZEND_ME(exception, __construct, arginfo_class_Exception___construct, ZEND_ACC_PUBLIC)
-       ZEND_ME(exception, __wakeup, arginfo_class_Exception___wakeup, ZEND_ACC_PUBLIC)
-       ZEND_ME(exception, getMessage, arginfo_class_Exception_getMessage, ZEND_ACC_PUBLIC|ZEND_ACC_FINAL)
-       ZEND_ME(exception, getCode, arginfo_class_Exception_getCode, ZEND_ACC_PUBLIC|ZEND_ACC_FINAL)
-       ZEND_ME(exception, getFile, arginfo_class_Exception_getFile, ZEND_ACC_PUBLIC|ZEND_ACC_FINAL)
-       ZEND_ME(exception, getLine, arginfo_class_Exception_getLine, ZEND_ACC_PUBLIC|ZEND_ACC_FINAL)
-       ZEND_ME(exception, getTrace, arginfo_class_Exception_getTrace, ZEND_ACC_PUBLIC|ZEND_ACC_FINAL)
-       ZEND_ME(exception, getPrevious, arginfo_class_Exception_getPrevious, ZEND_ACC_PUBLIC|ZEND_ACC_FINAL)
-       ZEND_ME(exception, getTraceAsString, arginfo_class_Exception_getTraceAsString, ZEND_ACC_PUBLIC|ZEND_ACC_FINAL)
-       ZEND_ME(exception, __toString, arginfo_class_Exception___toString, 0)
-       ZEND_FE_END
-};
-
-static const zend_function_entry error_exception_functions[] = {
-       ZEND_ME(error_exception, __construct, arginfo_class_ErrorException___construct, ZEND_ACC_PUBLIC)
-       ZEND_ME(error_exception, getSeverity, arginfo_class_ErrorException_getSeverity, ZEND_ACC_PUBLIC|ZEND_ACC_FINAL)
-       ZEND_FE_END
-};
-/* }}} */
-
 void zend_register_default_exception(void) /* {{{ */
 {
        zend_class_entry ce;
@@ -788,7 +743,7 @@ void zend_register_default_exception(void) /* {{{ */
        memcpy(&default_exception_handlers, &std_object_handlers, sizeof(zend_object_handlers));
        default_exception_handlers.clone_obj = NULL;
 
-       INIT_CLASS_ENTRY(ce, "Exception", default_exception_functions);
+       INIT_CLASS_ENTRY(ce, "Exception", class_Exception_methods);
        zend_ce_exception = zend_register_internal_class_ex(&ce, NULL);
        zend_ce_exception->create_object = zend_default_exception_new;
        zend_class_implements(zend_ce_exception, 1, zend_ce_throwable);
@@ -801,12 +756,12 @@ void zend_register_default_exception(void) /* {{{ */
        zend_declare_property_null(zend_ce_exception, "trace", sizeof("trace")-1, ZEND_ACC_PRIVATE);
        zend_declare_property_null(zend_ce_exception, "previous", sizeof("previous")-1, ZEND_ACC_PRIVATE);
 
-       INIT_CLASS_ENTRY(ce, "ErrorException", error_exception_functions);
+       INIT_CLASS_ENTRY(ce, "ErrorException", class_ErrorException_methods);
        zend_ce_error_exception = zend_register_internal_class_ex(&ce, zend_ce_exception);
        zend_ce_error_exception->create_object = zend_error_exception_new;
        zend_declare_property_long(zend_ce_error_exception, "severity", sizeof("severity")-1, E_ERROR, ZEND_ACC_PROTECTED);
 
-       INIT_CLASS_ENTRY(ce, "Error", default_exception_functions);
+       INIT_CLASS_ENTRY(ce, "Error", class_Error_methods);
        zend_ce_error = zend_register_internal_class_ex(&ce, NULL);
        zend_ce_error->create_object = zend_default_exception_new;
        zend_class_implements(zend_ce_error, 1, zend_ce_throwable);
@@ -819,31 +774,31 @@ void zend_register_default_exception(void) /* {{{ */
        zend_declare_property_null(zend_ce_error, "trace", sizeof("trace")-1, ZEND_ACC_PRIVATE);
        zend_declare_property_null(zend_ce_error, "previous", sizeof("previous")-1, ZEND_ACC_PRIVATE);
 
-       INIT_CLASS_ENTRY(ce, "CompileError", NULL);
+       INIT_CLASS_ENTRY(ce, "CompileError", class_CompileError_methods);
        zend_ce_compile_error = zend_register_internal_class_ex(&ce, zend_ce_error);
        zend_ce_compile_error->create_object = zend_default_exception_new;
 
-       INIT_CLASS_ENTRY(ce, "ParseError", NULL);
+       INIT_CLASS_ENTRY(ce, "ParseError", class_ParseError_methods);
        zend_ce_parse_error = zend_register_internal_class_ex(&ce, zend_ce_compile_error);
        zend_ce_parse_error->create_object = zend_default_exception_new;
 
-       INIT_CLASS_ENTRY(ce, "TypeError", NULL);
+       INIT_CLASS_ENTRY(ce, "TypeError", class_TypeError_methods);
        zend_ce_type_error = zend_register_internal_class_ex(&ce, zend_ce_error);
        zend_ce_type_error->create_object = zend_default_exception_new;
 
-       INIT_CLASS_ENTRY(ce, "ArgumentCountError", NULL);
+       INIT_CLASS_ENTRY(ce, "ArgumentCountError", class_ArgumentCountError_methods);
        zend_ce_argument_count_error = zend_register_internal_class_ex(&ce, zend_ce_type_error);
        zend_ce_argument_count_error->create_object = zend_default_exception_new;
 
-       INIT_CLASS_ENTRY(ce, "ValueError", NULL);
+       INIT_CLASS_ENTRY(ce, "ValueError", class_ValueError_methods);
        zend_ce_value_error = zend_register_internal_class_ex(&ce, zend_ce_error);
        zend_ce_value_error->create_object = zend_default_exception_new;
 
-       INIT_CLASS_ENTRY(ce, "ArithmeticError", NULL);
+       INIT_CLASS_ENTRY(ce, "ArithmeticError", class_ArithmeticError_methods);
        zend_ce_arithmetic_error = zend_register_internal_class_ex(&ce, zend_ce_error);
        zend_ce_arithmetic_error->create_object = zend_default_exception_new;
 
-       INIT_CLASS_ENTRY(ce, "DivisionByZeroError", NULL);
+       INIT_CLASS_ENTRY(ce, "DivisionByZeroError", class_DivisionByZeroError_methods);
        zend_ce_division_by_zero_error = zend_register_internal_class_ex(&ce, zend_ce_arithmetic_error);
        zend_ce_division_by_zero_error->create_object = zend_default_exception_new;
 }
index 83e3a3ba451910a0e3f1eae6765cf9c7d1c256a9..c467f36ecb584692b27e9f5d0e4321e0d80a7002 100644 (file)
@@ -1,5 +1,7 @@
 <?php
 
+/** @generate-function-entries */
+
 interface Throwable extends Stringable
 {
     /** @return string */
@@ -32,26 +34,20 @@ class Exception implements Throwable
 
     public function __wakeup() {}
 
-    /** @return string */
-    final public function getMessage() {}
+    final public function getMessage(): string {}
 
     /** @return int */
     final public function getCode() {}
 
-    /** @return string */
-    final public function getFile() {}
+    final public function getFile(): string {}
 
-    /** @return int */
-    final public function getLine() {}
+    final public function getLine(): int {}
 
-    /** @return array */
-    final public function getTrace() {}
+    final public function getTrace(): array {}
 
-    /** @return ?Throwable */
-    final public function getPrevious() {}
+    final public function getPrevious(): ?Throwable {}
 
-    /** @return string */
-    final public function getTraceAsString() {}
+    final public function getTraceAsString(): string {}
 
     public function __toString(): string {}
 }
@@ -60,6 +56,72 @@ class ErrorException extends Exception
 {
     public function __construct(string $message = UNKNOWN, int $code = 0, int $severity = E_ERROR, string $filename = UNKNOWN, int $lineno = 0, ?Throwable $previous = null) {}
 
-    /** @return int */
-    final public function getSeverity() {}
+    final public function getSeverity(): int {}
+}
+
+class Error implements Throwable
+{
+    /** @alias Exception::__clone */
+    final private function __clone() {}
+
+    /** @alias Exception::__construct */
+    public function __construct(string $message = UNKNOWN, int $code = 0, ?Throwable $previous = null) {}
+
+    /** @alias Exception::__wakeup */
+    public function __wakeup() {}
+
+    /** @alias Exception::getMessage */
+    final public function getMessage(): string {}
+
+    /**
+     * @return int
+     * @alias Exception::getCode
+     */
+    final public function getCode() {}
+
+    /** @alias Exception::getFile */
+    final public function getFile(): string {}
+
+    /** @alias Exception::getLine */
+    final public function getLine(): int {}
+
+    /** @alias Exception::getTrace */
+    final public function getTrace(): array {}
+
+    /** @alias Exception::getPrevious */
+    final public function getPrevious(): ?Throwable {}
+
+    /** @alias Exception::getTraceAsString */
+    final public function getTraceAsString(): string {}
+
+    /** @alias Exception::__toString */
+    public function __toString(): string {}
+}
+
+class CompileError extends Error
+{
+}
+
+class ParseError extends CompileError
+{
+}
+
+class TypeError extends Error
+{
+}
+
+class ArgumentCountError extends TypeError
+{
+}
+
+class ValueError extends Error
+{
+}
+
+class ArithmeticError extends Error
+{
+}
+
+class DivisionByZeroError extends ArithmeticError
+{
 }
index b264a925dda9368d550140b79432a27a078bd613..3f8ceb833b11a48b071596132a74446d226abcd3 100644 (file)
@@ -25,22 +25,25 @@ ZEND_END_ARG_INFO()
 
 #define arginfo_class_Exception___wakeup arginfo_class_Throwable_getMessage
 
-#define arginfo_class_Exception_getMessage arginfo_class_Throwable_getMessage
+ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Exception_getMessage, 0, 0, IS_STRING, 0)
+ZEND_END_ARG_INFO()
 
 #define arginfo_class_Exception_getCode arginfo_class_Throwable_getMessage
 
-#define arginfo_class_Exception_getFile arginfo_class_Throwable_getMessage
+#define arginfo_class_Exception_getFile arginfo_class_Exception_getMessage
 
-#define arginfo_class_Exception_getLine arginfo_class_Throwable_getMessage
+ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Exception_getLine, 0, 0, IS_LONG, 0)
+ZEND_END_ARG_INFO()
 
-#define arginfo_class_Exception_getTrace arginfo_class_Throwable_getMessage
+ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Exception_getTrace, 0, 0, IS_ARRAY, 0)
+ZEND_END_ARG_INFO()
 
-#define arginfo_class_Exception_getPrevious arginfo_class_Throwable_getMessage
+ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_class_Exception_getPrevious, 0, 0, Throwable, 1)
+ZEND_END_ARG_INFO()
 
-#define arginfo_class_Exception_getTraceAsString arginfo_class_Throwable_getMessage
+#define arginfo_class_Exception_getTraceAsString arginfo_class_Exception_getMessage
 
-ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Exception___toString, 0, 0, IS_STRING, 0)
-ZEND_END_ARG_INFO()
+#define arginfo_class_Exception___toString arginfo_class_Exception_getMessage
 
 ZEND_BEGIN_ARG_INFO_EX(arginfo_class_ErrorException___construct, 0, 0, 0)
        ZEND_ARG_TYPE_INFO(0, message, IS_STRING, 0)
@@ -51,4 +54,127 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_class_ErrorException___construct, 0, 0, 0)
        ZEND_ARG_OBJ_INFO_WITH_DEFAULT_VALUE(0, previous, Throwable, 1, "null")
 ZEND_END_ARG_INFO()
 
-#define arginfo_class_ErrorException_getSeverity arginfo_class_Throwable_getMessage
+#define arginfo_class_ErrorException_getSeverity arginfo_class_Exception_getLine
+
+#define arginfo_class_Error___clone arginfo_class_Throwable_getMessage
+
+#define arginfo_class_Error___construct arginfo_class_Exception___construct
+
+#define arginfo_class_Error___wakeup arginfo_class_Throwable_getMessage
+
+#define arginfo_class_Error_getMessage arginfo_class_Exception_getMessage
+
+#define arginfo_class_Error_getCode arginfo_class_Throwable_getMessage
+
+#define arginfo_class_Error_getFile arginfo_class_Exception_getMessage
+
+#define arginfo_class_Error_getLine arginfo_class_Exception_getLine
+
+#define arginfo_class_Error_getTrace arginfo_class_Exception_getTrace
+
+#define arginfo_class_Error_getPrevious arginfo_class_Exception_getPrevious
+
+#define arginfo_class_Error_getTraceAsString arginfo_class_Exception_getMessage
+
+#define arginfo_class_Error___toString arginfo_class_Exception_getMessage
+
+
+ZEND_METHOD(Exception, __clone);
+ZEND_METHOD(Exception, __construct);
+ZEND_METHOD(Exception, __wakeup);
+ZEND_METHOD(Exception, getMessage);
+ZEND_METHOD(Exception, getCode);
+ZEND_METHOD(Exception, getFile);
+ZEND_METHOD(Exception, getLine);
+ZEND_METHOD(Exception, getTrace);
+ZEND_METHOD(Exception, getPrevious);
+ZEND_METHOD(Exception, getTraceAsString);
+ZEND_METHOD(Exception, __toString);
+ZEND_METHOD(ErrorException, __construct);
+ZEND_METHOD(ErrorException, getSeverity);
+
+
+static const zend_function_entry class_Throwable_methods[] = {
+       ZEND_ABSTRACT_ME_WITH_FLAGS(Throwable, getMessage, arginfo_class_Throwable_getMessage, ZEND_ACC_PUBLIC|ZEND_ACC_ABSTRACT)
+       ZEND_ABSTRACT_ME_WITH_FLAGS(Throwable, getCode, arginfo_class_Throwable_getCode, ZEND_ACC_PUBLIC|ZEND_ACC_ABSTRACT)
+       ZEND_ABSTRACT_ME_WITH_FLAGS(Throwable, getFile, arginfo_class_Throwable_getFile, ZEND_ACC_PUBLIC|ZEND_ACC_ABSTRACT)
+       ZEND_ABSTRACT_ME_WITH_FLAGS(Throwable, getLine, arginfo_class_Throwable_getLine, ZEND_ACC_PUBLIC|ZEND_ACC_ABSTRACT)
+       ZEND_ABSTRACT_ME_WITH_FLAGS(Throwable, getTrace, arginfo_class_Throwable_getTrace, ZEND_ACC_PUBLIC|ZEND_ACC_ABSTRACT)
+       ZEND_ABSTRACT_ME_WITH_FLAGS(Throwable, getPrevious, arginfo_class_Throwable_getPrevious, ZEND_ACC_PUBLIC|ZEND_ACC_ABSTRACT)
+       ZEND_ABSTRACT_ME_WITH_FLAGS(Throwable, getTraceAsString, arginfo_class_Throwable_getTraceAsString, ZEND_ACC_PUBLIC|ZEND_ACC_ABSTRACT)
+       ZEND_FE_END
+};
+
+
+static const zend_function_entry class_Exception_methods[] = {
+       ZEND_ME(Exception, __clone, arginfo_class_Exception___clone, ZEND_ACC_PRIVATE|ZEND_ACC_FINAL)
+       ZEND_ME(Exception, __construct, arginfo_class_Exception___construct, ZEND_ACC_PUBLIC)
+       ZEND_ME(Exception, __wakeup, arginfo_class_Exception___wakeup, ZEND_ACC_PUBLIC)
+       ZEND_ME(Exception, getMessage, arginfo_class_Exception_getMessage, ZEND_ACC_PUBLIC|ZEND_ACC_FINAL)
+       ZEND_ME(Exception, getCode, arginfo_class_Exception_getCode, ZEND_ACC_PUBLIC|ZEND_ACC_FINAL)
+       ZEND_ME(Exception, getFile, arginfo_class_Exception_getFile, ZEND_ACC_PUBLIC|ZEND_ACC_FINAL)
+       ZEND_ME(Exception, getLine, arginfo_class_Exception_getLine, ZEND_ACC_PUBLIC|ZEND_ACC_FINAL)
+       ZEND_ME(Exception, getTrace, arginfo_class_Exception_getTrace, ZEND_ACC_PUBLIC|ZEND_ACC_FINAL)
+       ZEND_ME(Exception, getPrevious, arginfo_class_Exception_getPrevious, ZEND_ACC_PUBLIC|ZEND_ACC_FINAL)
+       ZEND_ME(Exception, getTraceAsString, arginfo_class_Exception_getTraceAsString, ZEND_ACC_PUBLIC|ZEND_ACC_FINAL)
+       ZEND_ME(Exception, __toString, arginfo_class_Exception___toString, ZEND_ACC_PUBLIC)
+       ZEND_FE_END
+};
+
+
+static const zend_function_entry class_ErrorException_methods[] = {
+       ZEND_ME(ErrorException, __construct, arginfo_class_ErrorException___construct, ZEND_ACC_PUBLIC)
+       ZEND_ME(ErrorException, getSeverity, arginfo_class_ErrorException_getSeverity, ZEND_ACC_PUBLIC|ZEND_ACC_FINAL)
+       ZEND_FE_END
+};
+
+
+static const zend_function_entry class_Error_methods[] = {
+       ZEND_MALIAS(Exception, __clone, __clone, arginfo_class_Error___clone, ZEND_ACC_PRIVATE|ZEND_ACC_FINAL)
+       ZEND_MALIAS(Exception, __construct, __construct, arginfo_class_Error___construct, ZEND_ACC_PUBLIC)
+       ZEND_MALIAS(Exception, __wakeup, __wakeup, arginfo_class_Error___wakeup, ZEND_ACC_PUBLIC)
+       ZEND_MALIAS(Exception, getMessage, getMessage, arginfo_class_Error_getMessage, ZEND_ACC_PUBLIC|ZEND_ACC_FINAL)
+       ZEND_MALIAS(Exception, getCode, getCode, arginfo_class_Error_getCode, ZEND_ACC_PUBLIC|ZEND_ACC_FINAL)
+       ZEND_MALIAS(Exception, getFile, getFile, arginfo_class_Error_getFile, ZEND_ACC_PUBLIC|ZEND_ACC_FINAL)
+       ZEND_MALIAS(Exception, getLine, getLine, arginfo_class_Error_getLine, ZEND_ACC_PUBLIC|ZEND_ACC_FINAL)
+       ZEND_MALIAS(Exception, getTrace, getTrace, arginfo_class_Error_getTrace, ZEND_ACC_PUBLIC|ZEND_ACC_FINAL)
+       ZEND_MALIAS(Exception, getPrevious, getPrevious, arginfo_class_Error_getPrevious, ZEND_ACC_PUBLIC|ZEND_ACC_FINAL)
+       ZEND_MALIAS(Exception, getTraceAsString, getTraceAsString, arginfo_class_Error_getTraceAsString, ZEND_ACC_PUBLIC|ZEND_ACC_FINAL)
+       ZEND_MALIAS(Exception, __toString, __toString, arginfo_class_Error___toString, ZEND_ACC_PUBLIC)
+       ZEND_FE_END
+};
+
+
+static const zend_function_entry class_CompileError_methods[] = {
+       ZEND_FE_END
+};
+
+
+static const zend_function_entry class_ParseError_methods[] = {
+       ZEND_FE_END
+};
+
+
+static const zend_function_entry class_TypeError_methods[] = {
+       ZEND_FE_END
+};
+
+
+static const zend_function_entry class_ArgumentCountError_methods[] = {
+       ZEND_FE_END
+};
+
+
+static const zend_function_entry class_ValueError_methods[] = {
+       ZEND_FE_END
+};
+
+
+static const zend_function_entry class_ArithmeticError_methods[] = {
+       ZEND_FE_END
+};
+
+
+static const zend_function_entry class_DivisionByZeroError_methods[] = {
+       ZEND_FE_END
+};
index 7bb35384d27540a389393605348c4aab6991c761..b3261842eb02cc1c905649340553457776887e7c 100644 (file)
@@ -1189,23 +1189,11 @@ zend_object_iterator *zend_generator_get_iterator(zend_class_entry *ce, zval *ob
 }
 /* }}} */
 
-static const zend_function_entry generator_functions[] = {
-       ZEND_ME(Generator, rewind,   arginfo_class_Generator_rewind, ZEND_ACC_PUBLIC)
-       ZEND_ME(Generator, valid,    arginfo_class_Generator_valid, ZEND_ACC_PUBLIC)
-       ZEND_ME(Generator, current,  arginfo_class_Generator_current, ZEND_ACC_PUBLIC)
-       ZEND_ME(Generator, key,      arginfo_class_Generator_key, ZEND_ACC_PUBLIC)
-       ZEND_ME(Generator, next,     arginfo_class_Generator_next, ZEND_ACC_PUBLIC)
-       ZEND_ME(Generator, send,     arginfo_class_Generator_send, ZEND_ACC_PUBLIC)
-       ZEND_ME(Generator, throw,    arginfo_class_Generator_throw, ZEND_ACC_PUBLIC)
-       ZEND_ME(Generator, getReturn,arginfo_class_Generator_getReturn, ZEND_ACC_PUBLIC)
-       ZEND_FE_END
-};
-
 void zend_register_generator_ce(void) /* {{{ */
 {
        zend_class_entry ce;
 
-       INIT_CLASS_ENTRY(ce, "Generator", generator_functions);
+       INIT_CLASS_ENTRY(ce, "Generator", class_Generator_methods);
        zend_ce_generator = zend_register_internal_class(&ce);
        zend_ce_generator->ce_flags |= ZEND_ACC_FINAL;
        zend_ce_generator->create_object = zend_generator_create;
index 7f45f726b5e407f1121b21236d6785a85f570593..5fb485895c59631433de3236d8bfbd1e9f73acbe 100644 (file)
@@ -1,5 +1,7 @@
 <?php
 
+/** @generate-function-entries */
+
 final class Generator implements Iterator
 {
     public function rewind(): void {}
index a65d6b1b12a219bc96f6dd397b442d0d484b9d50..214595e580adf0c31e87ea46551eddcafa812623 100644 (file)
@@ -22,3 +22,26 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Generator_throw, 0, 0, 1)
 ZEND_END_ARG_INFO()
 
 #define arginfo_class_Generator_getReturn arginfo_class_Generator_current
+
+
+ZEND_METHOD(Generator, rewind);
+ZEND_METHOD(Generator, valid);
+ZEND_METHOD(Generator, current);
+ZEND_METHOD(Generator, key);
+ZEND_METHOD(Generator, next);
+ZEND_METHOD(Generator, send);
+ZEND_METHOD(Generator, throw);
+ZEND_METHOD(Generator, getReturn);
+
+
+static const zend_function_entry class_Generator_methods[] = {
+       ZEND_ME(Generator, rewind, arginfo_class_Generator_rewind, ZEND_ACC_PUBLIC)
+       ZEND_ME(Generator, valid, arginfo_class_Generator_valid, ZEND_ACC_PUBLIC)
+       ZEND_ME(Generator, current, arginfo_class_Generator_current, ZEND_ACC_PUBLIC)
+       ZEND_ME(Generator, key, arginfo_class_Generator_key, ZEND_ACC_PUBLIC)
+       ZEND_ME(Generator, next, arginfo_class_Generator_next, ZEND_ACC_PUBLIC)
+       ZEND_ME(Generator, send, arginfo_class_Generator_send, ZEND_ACC_PUBLIC)
+       ZEND_ME(Generator, throw, arginfo_class_Generator_throw, ZEND_ACC_PUBLIC)
+       ZEND_ME(Generator, getReturn, arginfo_class_Generator_getReturn, ZEND_ACC_PUBLIC)
+       ZEND_FE_END
+};
index acebe0a1fb729a5f5c39f62994c0584505153d15..8fffde76ff795b156efcc8968b7ee2179b5e77fd 100644 (file)
@@ -484,48 +484,6 @@ static int zend_implement_serializable(zend_class_entry *interface, zend_class_e
 }
 /* }}}*/
 
-/* {{{ function tables */
-static const zend_function_entry zend_funcs_aggregate[] = {
-       ZEND_ABSTRACT_ME(iterator, getIterator, arginfo_class_IteratorAggregate_getIterator)
-       ZEND_FE_END
-};
-
-static const zend_function_entry zend_funcs_iterator[] = {
-       ZEND_ABSTRACT_ME(iterator, current,  arginfo_class_Iterator_current)
-       ZEND_ABSTRACT_ME(iterator, next,     arginfo_class_Iterator_next)
-       ZEND_ABSTRACT_ME(iterator, key,      arginfo_class_Iterator_key)
-       ZEND_ABSTRACT_ME(iterator, valid,    arginfo_class_Iterator_valid)
-       ZEND_ABSTRACT_ME(iterator, rewind,   arginfo_class_Iterator_rewind)
-       ZEND_FE_END
-};
-
-static const zend_function_entry *zend_funcs_traversable = NULL;
-
-static const zend_function_entry zend_funcs_arrayaccess[] = {
-       ZEND_ABSTRACT_ME(arrayaccess, offsetExists, arginfo_class_ArrayAccess_offsetExists)
-       ZEND_ABSTRACT_ME(arrayaccess, offsetGet,    arginfo_class_ArrayAccess_offsetGet)
-       ZEND_ABSTRACT_ME(arrayaccess, offsetSet,    arginfo_class_ArrayAccess_offsetSet)
-       ZEND_ABSTRACT_ME(arrayaccess, offsetUnset,  arginfo_class_ArrayAccess_offsetUnset)
-       ZEND_FE_END
-};
-
-static const zend_function_entry zend_funcs_serializable[] = {
-       ZEND_ABSTRACT_ME(serializable, serialize, arginfo_class_Serializable_serialize)
-       ZEND_FENTRY(unserialize, NULL, arginfo_class_Serializable_unserialize, ZEND_ACC_PUBLIC|ZEND_ACC_ABSTRACT)
-       ZEND_FE_END
-};
-
-static const zend_function_entry zend_funcs_countable[] = {
-       ZEND_ABSTRACT_ME(Countable, count, arginfo_class_Countable_count)
-       ZEND_FE_END
-};
-
-static const zend_function_entry zend_funcs_stringable[] = {
-       ZEND_ABSTRACT_ME(Stringable, __toString, arginfo_class_Stringable___toString)
-       ZEND_FE_END
-};
-/* }}} */
-
 /* {{{ zend_register_interfaces */
 ZEND_API void zend_register_interfaces(void)
 {
@@ -540,13 +498,13 @@ ZEND_API void zend_register_interfaces(void)
        REGISTER_MAGIC_INTERFACE(serializable, Serializable);
 
        zend_class_entry ce;
-       INIT_CLASS_ENTRY(ce, "ArrayAccess", zend_funcs_arrayaccess);
+       INIT_CLASS_ENTRY(ce, "ArrayAccess", class_ArrayAccess_methods);
        zend_ce_arrayaccess = zend_register_internal_interface(&ce);
 
-       INIT_CLASS_ENTRY(ce, "Countable", zend_funcs_countable);
+       INIT_CLASS_ENTRY(ce, "Countable", class_Countable_methods);
        zend_ce_countable = zend_register_internal_interface(&ce);
 
-       INIT_CLASS_ENTRY(ce, "Stringable", zend_funcs_stringable);
+       INIT_CLASS_ENTRY(ce, "Stringable", class_Stringable_methods);
        zend_ce_stringable = zend_register_internal_interface(&ce);
 }
 /* }}} */
index c79495eca3f55425ad1ba3b41f9058123da381ca..dbdcd2a0742a466608765ac5727e532394e6f538 100644 (file)
@@ -52,7 +52,7 @@ ZEND_API zval* zend_call_method(zend_object *object, zend_class_entry *obj_ce, z
 #define REGISTER_MAGIC_INTERFACE(class_name, class_name_str) \
        {\
                zend_class_entry ce;\
-               INIT_CLASS_ENTRY(ce, # class_name_str, zend_funcs_ ## class_name) \
+               INIT_CLASS_ENTRY(ce, # class_name_str, class_ ## class_name_str ## _methods) \
                zend_ce_ ## class_name = zend_register_internal_interface(&ce);\
                zend_ce_ ## class_name->interface_gets_implemented = zend_implement_ ## class_name;\
        }
index 1deb28a3843764b385f43a22d5d642c1a3bf1582..2865aace08fae05bd9773732aea28a3b0f795e7f 100644 (file)
@@ -1,5 +1,7 @@
 <?php
 
+/** @generate-function-entries */
+
 interface Traversable {}
 
 interface IteratorAggregate extends Traversable
index e96104719aeedb9fd4140891d888389e80b61f58..c8f78ce3bd91d91f8278a0d4300a3c54f8a39b10 100644 (file)
@@ -36,3 +36,54 @@ ZEND_END_ARG_INFO()
 
 ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Stringable___toString, 0, 0, IS_STRING, 0)
 ZEND_END_ARG_INFO()
+
+
+
+
+static const zend_function_entry class_Traversable_methods[] = {
+       ZEND_FE_END
+};
+
+
+static const zend_function_entry class_IteratorAggregate_methods[] = {
+       ZEND_ABSTRACT_ME_WITH_FLAGS(IteratorAggregate, getIterator, arginfo_class_IteratorAggregate_getIterator, ZEND_ACC_PUBLIC|ZEND_ACC_ABSTRACT)
+       ZEND_FE_END
+};
+
+
+static const zend_function_entry class_Iterator_methods[] = {
+       ZEND_ABSTRACT_ME_WITH_FLAGS(Iterator, current, arginfo_class_Iterator_current, ZEND_ACC_PUBLIC|ZEND_ACC_ABSTRACT)
+       ZEND_ABSTRACT_ME_WITH_FLAGS(Iterator, next, arginfo_class_Iterator_next, ZEND_ACC_PUBLIC|ZEND_ACC_ABSTRACT)
+       ZEND_ABSTRACT_ME_WITH_FLAGS(Iterator, key, arginfo_class_Iterator_key, ZEND_ACC_PUBLIC|ZEND_ACC_ABSTRACT)
+       ZEND_ABSTRACT_ME_WITH_FLAGS(Iterator, valid, arginfo_class_Iterator_valid, ZEND_ACC_PUBLIC|ZEND_ACC_ABSTRACT)
+       ZEND_ABSTRACT_ME_WITH_FLAGS(Iterator, rewind, arginfo_class_Iterator_rewind, ZEND_ACC_PUBLIC|ZEND_ACC_ABSTRACT)
+       ZEND_FE_END
+};
+
+
+static const zend_function_entry class_ArrayAccess_methods[] = {
+       ZEND_ABSTRACT_ME_WITH_FLAGS(ArrayAccess, offsetExists, arginfo_class_ArrayAccess_offsetExists, ZEND_ACC_PUBLIC|ZEND_ACC_ABSTRACT)
+       ZEND_ABSTRACT_ME_WITH_FLAGS(ArrayAccess, offsetGet, arginfo_class_ArrayAccess_offsetGet, ZEND_ACC_PUBLIC|ZEND_ACC_ABSTRACT)
+       ZEND_ABSTRACT_ME_WITH_FLAGS(ArrayAccess, offsetSet, arginfo_class_ArrayAccess_offsetSet, ZEND_ACC_PUBLIC|ZEND_ACC_ABSTRACT)
+       ZEND_ABSTRACT_ME_WITH_FLAGS(ArrayAccess, offsetUnset, arginfo_class_ArrayAccess_offsetUnset, ZEND_ACC_PUBLIC|ZEND_ACC_ABSTRACT)
+       ZEND_FE_END
+};
+
+
+static const zend_function_entry class_Serializable_methods[] = {
+       ZEND_ABSTRACT_ME_WITH_FLAGS(Serializable, serialize, arginfo_class_Serializable_serialize, ZEND_ACC_PUBLIC|ZEND_ACC_ABSTRACT)
+       ZEND_ABSTRACT_ME_WITH_FLAGS(Serializable, unserialize, arginfo_class_Serializable_unserialize, ZEND_ACC_PUBLIC|ZEND_ACC_ABSTRACT)
+       ZEND_FE_END
+};
+
+
+static const zend_function_entry class_Countable_methods[] = {
+       ZEND_ABSTRACT_ME_WITH_FLAGS(Countable, count, arginfo_class_Countable_count, ZEND_ACC_PUBLIC|ZEND_ACC_ABSTRACT)
+       ZEND_FE_END
+};
+
+
+static const zend_function_entry class_Stringable_methods[] = {
+       ZEND_ABSTRACT_ME_WITH_FLAGS(Stringable, __toString, arginfo_class_Stringable___toString, ZEND_ACC_PUBLIC|ZEND_ACC_ABSTRACT)
+       ZEND_FE_END
+};
index c3f7bf5bb2f15f18b4b1d2ba01c7a2b26daf311e..db5ffde2fdcf12bd522e4a303fec93aeb63352e5 100644 (file)
@@ -298,13 +298,6 @@ ZEND_METHOD(WeakReference, get)
        zend_weakref_get(getThis(), return_value);
 }
 
-static const zend_function_entry zend_weakref_methods[] = {
-       ZEND_ME(WeakReference, __construct, arginfo_class_WeakReference___construct, ZEND_ACC_PUBLIC)
-       ZEND_ME(WeakReference, create, arginfo_class_WeakReference_create, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC)
-       ZEND_ME(WeakReference, get, arginfo_class_WeakReference_get, ZEND_ACC_PUBLIC)
-       ZEND_FE_END
-};
-
 static zend_object *zend_weakmap_create_object(zend_class_entry *ce)
 {
        zend_weakmap *wm = zend_object_alloc(sizeof(zend_weakmap), ce);
@@ -620,20 +613,11 @@ ZEND_METHOD(WeakMap, count)
        RETURN_LONG(count);
 }
 
-static const zend_function_entry zend_weakmap_methods[] = {
-       ZEND_ME(WeakMap, offsetGet, arginfo_class_WeakMap_offsetGet, ZEND_ACC_PUBLIC)
-       ZEND_ME(WeakMap, offsetSet, arginfo_class_WeakMap_offsetSet, ZEND_ACC_PUBLIC)
-       ZEND_ME(WeakMap, offsetExists, arginfo_class_WeakMap_offsetExists, ZEND_ACC_PUBLIC)
-       ZEND_ME(WeakMap, offsetUnset, arginfo_class_WeakMap_offsetUnset, ZEND_ACC_PUBLIC)
-       ZEND_ME(WeakMap, count, arginfo_class_WeakMap_count, ZEND_ACC_PUBLIC)
-       ZEND_FE_END
-};
-
 void zend_register_weakref_ce(void) /* {{{ */
 {
        zend_class_entry ce;
 
-       INIT_CLASS_ENTRY(ce, "WeakReference", zend_weakref_methods);
+       INIT_CLASS_ENTRY(ce, "WeakReference", class_WeakReference_methods);
        zend_ce_weakref = zend_register_internal_class(&ce);
        zend_ce_weakref->ce_flags |= ZEND_ACC_FINAL;
 
@@ -652,7 +636,7 @@ void zend_register_weakref_ce(void) /* {{{ */
        zend_weakref_handlers.get_property_ptr_ptr = zend_weakref_no_read_ptr;
        zend_weakref_handlers.clone_obj = NULL;
 
-       INIT_CLASS_ENTRY(ce, "WeakMap", zend_weakmap_methods);
+       INIT_CLASS_ENTRY(ce, "WeakMap", class_WeakMap_methods);
        zend_ce_weakmap = zend_register_internal_class(&ce);
        zend_ce_weakmap->ce_flags |= ZEND_ACC_FINAL;
 
index aada11bc79e02e1dc249ddeb0cd066dd150037ef..4cf189b064b2ff83ce075a9555c38a4c8de66af2 100644 (file)
@@ -1,33 +1,35 @@
 <?php
 
-final class WeakReference {
-    public function __construct();
+/** @generate-function-entries */
 
-    public static function create(): WeakReference;
+final class WeakReference
+{
+    public function __construct() {}
 
-    public function get(): ?object;
-}
+    public static function create(): WeakReference {}
 
-final class WeakMap implements ArrayAccess, Countable, Traversable {
-    //public function __construct();
+    public function get(): ?object {}
+}
 
+final class WeakMap implements ArrayAccess, Countable, Traversable
+{
     /**
      * @param object $object
      * @return mixed
      */
-    public function offsetGet($object);
+    public function offsetGet($object) {}
 
     /**
      * @param object $object
      * @param mixed $value
      */
-    public function offsetSet($object, $value): void;
+    public function offsetSet($object, $value): void {}
 
     /** @param object $object */
-    public function offsetExists($object): bool;
+    public function offsetExists($object): bool {}
 
     /** @param object $object */
-    public function offsetUnset($object): void;
+    public function offsetUnset($object): void {}
 
-    public function count(): int;
+    public function count(): int {}
 }
index b10c1b63b5de3cbebad22d3fe3967e718d2b066d..44516352515457a77fd8a458093f763dbc6d0f10 100644 (file)
@@ -28,3 +28,31 @@ ZEND_END_ARG_INFO()
 
 ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_WeakMap_count, 0, 0, IS_LONG, 0)
 ZEND_END_ARG_INFO()
+
+
+ZEND_METHOD(WeakReference, __construct);
+ZEND_METHOD(WeakReference, create);
+ZEND_METHOD(WeakReference, get);
+ZEND_METHOD(WeakMap, offsetGet);
+ZEND_METHOD(WeakMap, offsetSet);
+ZEND_METHOD(WeakMap, offsetExists);
+ZEND_METHOD(WeakMap, offsetUnset);
+ZEND_METHOD(WeakMap, count);
+
+
+static const zend_function_entry class_WeakReference_methods[] = {
+       ZEND_ME(WeakReference, __construct, arginfo_class_WeakReference___construct, ZEND_ACC_PUBLIC)
+       ZEND_ME(WeakReference, create, arginfo_class_WeakReference_create, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC)
+       ZEND_ME(WeakReference, get, arginfo_class_WeakReference_get, ZEND_ACC_PUBLIC)
+       ZEND_FE_END
+};
+
+
+static const zend_function_entry class_WeakMap_methods[] = {
+       ZEND_ME(WeakMap, offsetGet, arginfo_class_WeakMap_offsetGet, ZEND_ACC_PUBLIC)
+       ZEND_ME(WeakMap, offsetSet, arginfo_class_WeakMap_offsetSet, ZEND_ACC_PUBLIC)
+       ZEND_ME(WeakMap, offsetExists, arginfo_class_WeakMap_offsetExists, ZEND_ACC_PUBLIC)
+       ZEND_ME(WeakMap, offsetUnset, arginfo_class_WeakMap_offsetUnset, ZEND_ACC_PUBLIC)
+       ZEND_ME(WeakMap, count, arginfo_class_WeakMap_count, ZEND_ACC_PUBLIC)
+       ZEND_FE_END
+};
index 51b957dd7b684e032b4505bda52fd3dcb06250f4..530b6cf29b8b510b831f400f9dc9af9ffff26308 100644 (file)
@@ -37,7 +37,7 @@ string(183) "Class [ <internal:Core> class stdClass ] {
 }
 
 "
-string(2003) "Class [ <internal:Core> class Exception implements Throwable, Stringable ] {
+string(2159) "Class [ <internal:Core> class Exception implements Throwable, Stringable ] {
 
   - Constants [0] {
   }
@@ -84,6 +84,7 @@ string(2003) "Class [ <internal:Core> class Exception implements Throwable, Stri
 
       - Parameters [0] {
       }
+      - Return [ string ]
     }
 
     Method [ <internal:Core, prototype Throwable> final public method getCode ] {
@@ -96,30 +97,35 @@ string(2003) "Class [ <internal:Core> class Exception implements Throwable, Stri
 
       - Parameters [0] {
       }
+      - Return [ string ]
     }
 
     Method [ <internal:Core, prototype Throwable> final public method getLine ] {
 
       - Parameters [0] {
       }
+      - Return [ int ]
     }
 
     Method [ <internal:Core, prototype Throwable> final public method getTrace ] {
 
       - Parameters [0] {
       }
+      - Return [ array ]
     }
 
     Method [ <internal:Core, prototype Throwable> final public method getPrevious ] {
 
       - Parameters [0] {
       }
+      - Return [ ?Throwable ]
     }
 
     Method [ <internal:Core, prototype Throwable> final public method getTraceAsString ] {
 
       - Parameters [0] {
       }
+      - Return [ string ]
     }
 
     Method [ <internal:Core, prototype Stringable> public method __toString ] {