diff --git a/ext/reflection/php_reflection.c b/ext/reflection/php_reflection.c index 8ef0269481cf7..707e7b7fcdf26 100644 --- a/ext/reflection/php_reflection.c +++ b/ext/reflection/php_reflection.c @@ -2035,7 +2035,7 @@ ZEND_METHOD(ReflectionFunctionAbstract, getDocComment) RETURN_STR_COPY(((zend_internal_function *) fptr)->doc_comment); } - RETURN_FALSE; + RETURN_EMPTY_STRING(); } /* }}} */ @@ -4006,7 +4006,7 @@ ZEND_METHOD(ReflectionClassConstant, getDocComment) if (ref->doc_comment) { RETURN_STR_COPY(ref->doc_comment); } - RETURN_FALSE; + RETURN_EMPTY_STRING(); } /* }}} */ @@ -4411,7 +4411,7 @@ ZEND_METHOD(ReflectionClass, getDocComment) if (ce->doc_comment) { RETURN_STR_COPY(ce->doc_comment); } - RETURN_FALSE; + RETURN_EMPTY_STRING(); } /* }}} */ @@ -6335,7 +6335,7 @@ ZEND_METHOD(ReflectionProperty, getDocComment) if (ref->prop && ref->prop->doc_comment) { RETURN_STR_COPY(ref->prop->doc_comment); } - RETURN_FALSE; + RETURN_EMPTY_STRING(); } /* }}} */ diff --git a/ext/reflection/php_reflection.stub.php b/ext/reflection/php_reflection.stub.php index 63518b446ad86..1a2e02c7f5cf8 100644 --- a/ext/reflection/php_reflection.stub.php +++ b/ext/reflection/php_reflection.stub.php @@ -60,7 +60,7 @@ public function getClosureCalledClass(): ?ReflectionClass {} public function getClosureUsedVariables(): array {} /** @tentative-return-type */ - public function getDocComment(): string|false {} + public function getDocComment(): string {} /** @tentative-return-type */ public function getEndLine(): int|false {} @@ -286,7 +286,7 @@ public function getStartLine(): int|false {} public function getEndLine(): int|false {} /** @tentative-return-type */ - public function getDocComment(): string|false {} + public function getDocComment(): string {} /** @tentative-return-type */ public function getConstructor(): ?ReflectionMethod {} @@ -537,7 +537,7 @@ public function getModifiers(): int {} public function getDeclaringClass(): ReflectionClass {} /** @tentative-return-type */ - public function getDocComment(): string|false {} + public function getDocComment(): string {} /** @tentative-return-type */ public function setAccessible(bool $accessible): void {} @@ -615,7 +615,7 @@ public function getModifiers(): int {} public function getDeclaringClass(): ReflectionClass {} /** @tentative-return-type */ - public function getDocComment(): string|false {} + public function getDocComment(): string {} public function getAttributes(?string $name = null, int $flags = 0): array {} diff --git a/ext/reflection/php_reflection_arginfo.h b/ext/reflection/php_reflection_arginfo.h index d50dc04ae3d15..528e148df7201 100644 --- a/ext/reflection/php_reflection_arginfo.h +++ b/ext/reflection/php_reflection_arginfo.h @@ -1,5 +1,5 @@ /* This is a generated file, edit the .stub.php file instead. - * Stub hash: 7a8d126a96f0115783bd20a9adfc6bdc5ee88fda */ + * Stub hash: 87ead7449f09cabbbece98b8aa19dc8a7c10d5a6 */ ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_INFO_EX(arginfo_class_Reflection_getModifierNames, 0, 1, IS_ARRAY, 0) ZEND_ARG_TYPE_INFO(0, modifiers, IS_LONG, 0) @@ -36,7 +36,7 @@ ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_ReflectionFunctionAbstract_getClosureUsedVariables, 0, 0, IS_ARRAY, 0) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_MASK_EX(arginfo_class_ReflectionFunctionAbstract_getDocComment, 0, 0, MAY_BE_STRING|MAY_BE_FALSE) +ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_INFO_EX(arginfo_class_ReflectionFunctionAbstract_getDocComment, 0, 0, IS_STRING, 0) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_MASK_EX(arginfo_class_ReflectionFunctionAbstract_getEndLine, 0, 0, MAY_BE_LONG|MAY_BE_FALSE) @@ -45,14 +45,14 @@ ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_OBJ_INFO_EX(arginfo_class_ReflectionFunctionAbstract_getExtension, 0, 0, ReflectionExtension, 1) ZEND_END_ARG_INFO() -#define arginfo_class_ReflectionFunctionAbstract_getExtensionName arginfo_class_ReflectionFunctionAbstract_getDocComment +ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_MASK_EX(arginfo_class_ReflectionFunctionAbstract_getExtensionName, 0, 0, MAY_BE_STRING|MAY_BE_FALSE) +ZEND_END_ARG_INFO() -#define arginfo_class_ReflectionFunctionAbstract_getFileName arginfo_class_ReflectionFunctionAbstract_getDocComment +#define arginfo_class_ReflectionFunctionAbstract_getFileName arginfo_class_ReflectionFunctionAbstract_getExtensionName -ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_INFO_EX(arginfo_class_ReflectionFunctionAbstract_getName, 0, 0, IS_STRING, 0) -ZEND_END_ARG_INFO() +#define arginfo_class_ReflectionFunctionAbstract_getName arginfo_class_ReflectionFunctionAbstract_getDocComment -#define arginfo_class_ReflectionFunctionAbstract_getNamespaceName arginfo_class_ReflectionFunctionAbstract_getName +#define arginfo_class_ReflectionFunctionAbstract_getNamespaceName arginfo_class_ReflectionFunctionAbstract_getDocComment ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_INFO_EX(arginfo_class_ReflectionFunctionAbstract_getNumberOfParameters, 0, 0, IS_LONG, 0) ZEND_END_ARG_INFO() @@ -62,7 +62,7 @@ ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_INFO_EX(arginfo_class_ReflectionFunctionAbstract_getParameters, 0, 0, IS_ARRAY, 0) ZEND_END_ARG_INFO() -#define arginfo_class_ReflectionFunctionAbstract_getShortName arginfo_class_ReflectionFunctionAbstract_getName +#define arginfo_class_ReflectionFunctionAbstract_getShortName arginfo_class_ReflectionFunctionAbstract_getDocComment #define arginfo_class_ReflectionFunctionAbstract_getStartLine arginfo_class_ReflectionFunctionAbstract_getEndLine @@ -193,7 +193,7 @@ ZEND_END_ARG_INFO() #define arginfo_class_ReflectionClass___toString arginfo_class_ReflectionFunction___toString -#define arginfo_class_ReflectionClass_getName arginfo_class_ReflectionFunctionAbstract_getName +#define arginfo_class_ReflectionClass_getName arginfo_class_ReflectionFunctionAbstract_getDocComment #define arginfo_class_ReflectionClass_isInternal arginfo_class_ReflectionFunctionAbstract_inNamespace @@ -205,7 +205,7 @@ ZEND_END_ARG_INFO() #define arginfo_class_ReflectionClass_isCloneable arginfo_class_ReflectionFunctionAbstract_inNamespace -#define arginfo_class_ReflectionClass_getFileName arginfo_class_ReflectionFunctionAbstract_getDocComment +#define arginfo_class_ReflectionClass_getFileName arginfo_class_ReflectionFunctionAbstract_getExtensionName #define arginfo_class_ReflectionClass_getStartLine arginfo_class_ReflectionFunctionAbstract_getEndLine @@ -356,13 +356,13 @@ ZEND_END_ARG_INFO() #define arginfo_class_ReflectionClass_getExtension arginfo_class_ReflectionFunctionAbstract_getExtension -#define arginfo_class_ReflectionClass_getExtensionName arginfo_class_ReflectionFunctionAbstract_getDocComment +#define arginfo_class_ReflectionClass_getExtensionName arginfo_class_ReflectionFunctionAbstract_getExtensionName #define arginfo_class_ReflectionClass_inNamespace arginfo_class_ReflectionFunctionAbstract_inNamespace -#define arginfo_class_ReflectionClass_getNamespaceName arginfo_class_ReflectionFunctionAbstract_getName +#define arginfo_class_ReflectionClass_getNamespaceName arginfo_class_ReflectionFunctionAbstract_getDocComment -#define arginfo_class_ReflectionClass_getShortName arginfo_class_ReflectionFunctionAbstract_getName +#define arginfo_class_ReflectionClass_getShortName arginfo_class_ReflectionFunctionAbstract_getDocComment #define arginfo_class_ReflectionClass_getAttributes arginfo_class_ReflectionFunctionAbstract_getAttributes @@ -379,7 +379,7 @@ ZEND_END_ARG_INFO() #define arginfo_class_ReflectionProperty___toString arginfo_class_ReflectionFunction___toString -#define arginfo_class_ReflectionProperty_getName arginfo_class_ReflectionFunctionAbstract_getName +#define arginfo_class_ReflectionProperty_getName arginfo_class_ReflectionFunctionAbstract_getDocComment ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_INFO_EX(arginfo_class_ReflectionProperty_getValue, 0, 0, IS_MIXED, 0) ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, object, IS_OBJECT, 1, "null") @@ -479,7 +479,7 @@ ZEND_END_ARG_INFO() #define arginfo_class_ReflectionClassConstant___toString arginfo_class_ReflectionFunction___toString -#define arginfo_class_ReflectionClassConstant_getName arginfo_class_ReflectionFunctionAbstract_getName +#define arginfo_class_ReflectionClassConstant_getName arginfo_class_ReflectionFunctionAbstract_getDocComment #define arginfo_class_ReflectionClassConstant_getValue arginfo_class_ReflectionProperty_getDefaultValue @@ -516,7 +516,7 @@ ZEND_END_ARG_INFO() #define arginfo_class_ReflectionParameter___toString arginfo_class_ReflectionFunction___toString -#define arginfo_class_ReflectionParameter_getName arginfo_class_ReflectionFunctionAbstract_getName +#define arginfo_class_ReflectionParameter_getName arginfo_class_ReflectionFunctionAbstract_getDocComment #define arginfo_class_ReflectionParameter_isPassedByReference arginfo_class_ReflectionFunctionAbstract_inNamespace @@ -564,7 +564,7 @@ ZEND_END_ARG_INFO() #define arginfo_class_ReflectionType___toString arginfo_class_ReflectionFunction___toString -#define arginfo_class_ReflectionNamedType_getName arginfo_class_ReflectionFunctionAbstract_getName +#define arginfo_class_ReflectionNamedType_getName arginfo_class_ReflectionFunctionAbstract_getDocComment #define arginfo_class_ReflectionNamedType_isBuiltin arginfo_class_ReflectionFunctionAbstract_inNamespace @@ -580,7 +580,7 @@ ZEND_END_ARG_INFO() #define arginfo_class_ReflectionExtension___toString arginfo_class_ReflectionFunction___toString -#define arginfo_class_ReflectionExtension_getName arginfo_class_ReflectionFunctionAbstract_getName +#define arginfo_class_ReflectionExtension_getName arginfo_class_ReflectionFunctionAbstract_getDocComment #define arginfo_class_ReflectionExtension_getVersion arginfo_class_ReflectionParameter_getDefaultValueConstantName @@ -609,15 +609,15 @@ ZEND_END_ARG_INFO() #define arginfo_class_ReflectionZendExtension___toString arginfo_class_ReflectionFunction___toString -#define arginfo_class_ReflectionZendExtension_getName arginfo_class_ReflectionFunctionAbstract_getName +#define arginfo_class_ReflectionZendExtension_getName arginfo_class_ReflectionFunctionAbstract_getDocComment -#define arginfo_class_ReflectionZendExtension_getVersion arginfo_class_ReflectionFunctionAbstract_getName +#define arginfo_class_ReflectionZendExtension_getVersion arginfo_class_ReflectionFunctionAbstract_getDocComment -#define arginfo_class_ReflectionZendExtension_getAuthor arginfo_class_ReflectionFunctionAbstract_getName +#define arginfo_class_ReflectionZendExtension_getAuthor arginfo_class_ReflectionFunctionAbstract_getDocComment -#define arginfo_class_ReflectionZendExtension_getURL arginfo_class_ReflectionFunctionAbstract_getName +#define arginfo_class_ReflectionZendExtension_getURL arginfo_class_ReflectionFunctionAbstract_getDocComment -#define arginfo_class_ReflectionZendExtension_getCopyright arginfo_class_ReflectionFunctionAbstract_getName +#define arginfo_class_ReflectionZendExtension_getCopyright arginfo_class_ReflectionFunctionAbstract_getDocComment ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_class_ReflectionReference_fromArrayElement, 0, 2, ReflectionReference, 1) ZEND_ARG_TYPE_INFO(0, array, IS_ARRAY, 0) diff --git a/ext/reflection/tests/005.phpt b/ext/reflection/tests/005.phpt index 58411f98c847c..31d06637f7a07 100644 --- a/ext/reflection/tests/005.phpt +++ b/ext/reflection/tests/005.phpt @@ -49,6 +49,6 @@ foreach($r->getMethods() as $m) --EXPECT-- string(19) "Comment for class A" string(15) "Method A::bla()" -bool(false) -bool(false) +string(0) "" +string(0) "" string(22) "* Comment for A::baz()" diff --git a/ext/reflection/tests/ReflectionClassConstant_basic1.phpt b/ext/reflection/tests/ReflectionClassConstant_basic1.phpt index 4b8c8a32f7854..4cf5738502618 100644 --- a/ext/reflection/tests/ReflectionClassConstant_basic1.phpt +++ b/ext/reflection/tests/ReflectionClassConstant_basic1.phpt @@ -145,7 +145,7 @@ object(ReflectionClass)#3 (1) { string(9) "TestClass" } getDocComment(): -bool(false) +string(0) "" hasType(): bool(false) getType(): @@ -177,7 +177,7 @@ object(ReflectionClass)#3 (1) { string(9) "TestClass" } getDocComment(): -bool(false) +string(0) "" hasType(): bool(false) getType(): @@ -209,7 +209,7 @@ object(ReflectionClass)#3 (1) { string(9) "TestClass" } getDocComment(): -bool(false) +string(0) "" hasType(): bool(false) getType(): diff --git a/ext/reflection/tests/ReflectionClass_getDocComment_001.phpt b/ext/reflection/tests/ReflectionClass_getDocComment_001.phpt index 28b92abedbbf0..3d1dc693d286c 100644 --- a/ext/reflection/tests/ReflectionClass_getDocComment_001.phpt +++ b/ext/reflection/tests/ReflectionClass_getDocComment_001.phpt @@ -73,19 +73,19 @@ string(26) "/** My DocComment for B */" ---> Doc comment for class C: -bool(false) +string(0) "" ---> Doc comment for class D: -bool(false) +string(0) "" ---> Doc comment for class E: -bool(false) +string(0) "" ---> Doc comment for class F: -bool(false) +string(0) "" ---> Doc comment for class G: diff --git a/ext/reflection/tests/ReflectionClass_toString_001.phpt b/ext/reflection/tests/ReflectionClass_toString_001.phpt index fd5d83e917419..a1e496bcd934f 100644 --- a/ext/reflection/tests/ReflectionClass_toString_001.phpt +++ b/ext/reflection/tests/ReflectionClass_toString_001.phpt @@ -119,7 +119,7 @@ Class [ class ReflectionClass implements Stringable, Refle - Parameters [0] { } - - Tentative return [ string|false ] + - Tentative return [ string ] } Method [ public method getConstructor ] { diff --git a/ext/reflection/tests/ReflectionEnumUnitCase_getDocComment.phpt b/ext/reflection/tests/ReflectionEnumUnitCase_getDocComment.phpt index d51543601d917..1e85cef94f776 100644 --- a/ext/reflection/tests/ReflectionEnumUnitCase_getDocComment.phpt +++ b/ext/reflection/tests/ReflectionEnumUnitCase_getDocComment.phpt @@ -18,6 +18,6 @@ var_dump((new ReflectionClassConstant(Foo::class, 'Baz'))->getDocComment()); ?> --EXPECT-- string(26) "/** Example doc comment */" -bool(false) +string(0) "" string(26) "/** Example doc comment */" -bool(false) +string(0) "" diff --git a/ext/reflection/tests/ReflectionFunction_getDocComment.001.phpt b/ext/reflection/tests/ReflectionFunction_getDocComment.001.phpt index 590f5cfa10d46..e284af60244d6 100644 --- a/ext/reflection/tests/ReflectionFunction_getDocComment.001.phpt +++ b/ext/reflection/tests/ReflectionFunction_getDocComment.001.phpt @@ -38,5 +38,5 @@ dumpFuncInfo('extract'); string(%d) "/** * my doc comment */" -bool(false) -bool(false) +string(0) "" +string(0) "" diff --git a/ext/reflection/tests/ReflectionMethod_getDocComment_basic.phpt b/ext/reflection/tests/ReflectionMethod_getDocComment_basic.phpt index 7cda871c18cf0..688e6a710cf99 100644 --- a/ext/reflection/tests/ReflectionMethod_getDocComment_basic.phpt +++ b/ext/reflection/tests/ReflectionMethod_getDocComment_basic.phpt @@ -88,7 +88,7 @@ string(%d) "/** ---> Doc comment for B::f(): -bool(false) +string(0) "" ---> Doc comment for B::privf(): diff --git a/ext/reflection/tests/ReflectionMethod_getDocComment_property_list.phpt b/ext/reflection/tests/ReflectionMethod_getDocComment_property_list.phpt index 94fbc3daec745..4dd65c3e68a02 100644 --- a/ext/reflection/tests/ReflectionMethod_getDocComment_property_list.phpt +++ b/ext/reflection/tests/ReflectionMethod_getDocComment_property_list.phpt @@ -36,6 +36,6 @@ string(24) "/** * doc 1 */" X::y -bool(false) +string(0) "" X::z string(12) "/** doc 2 */" diff --git a/ext/reflection/tests/ReflectionProperty_basic2.phpt b/ext/reflection/tests/ReflectionProperty_basic2.phpt index 1c1361dd72509..c8e253c7f6a1e 100644 --- a/ext/reflection/tests/ReflectionProperty_basic2.phpt +++ b/ext/reflection/tests/ReflectionProperty_basic2.phpt @@ -60,7 +60,7 @@ object(ReflectionClass)#%d (1) { string(9) "TestClass" } getDocComment(): -bool(false) +string(0) "" ********************************** ********************************** @@ -78,7 +78,7 @@ object(ReflectionClass)#%d (1) { string(9) "TestClass" } getDocComment(): -bool(false) +string(0) "" ********************************** ********************************** @@ -116,7 +116,7 @@ object(ReflectionClass)#%d (1) { string(9) "TestClass" } getDocComment(): -bool(false) +string(0) "" ********************************** ********************************** @@ -134,6 +134,6 @@ object(ReflectionClass)#%d (1) { string(9) "TestClass" } getDocComment(): -bool(false) +string(0) "" ********************************** diff --git a/ext/reflection/tests/ReflectionProperty_getDocComment_basic.phpt b/ext/reflection/tests/ReflectionProperty_getDocComment_basic.phpt index 1dc7c9c727924..ccb6dd60d90eb 100644 --- a/ext/reflection/tests/ReflectionProperty_getDocComment_basic.phpt +++ b/ext/reflection/tests/ReflectionProperty_getDocComment_basic.phpt @@ -50,11 +50,11 @@ string(%d) "/** ---> Doc comment for A::$b: -bool(false) +string(0) "" ---> Doc comment for A::$c: -bool(false) +string(0) "" ---> Doc comment for A::$d: @@ -64,7 +64,7 @@ string(%d) "/** ---> Doc comment for A::$e: -bool(false) +string(0) "" ---> Doc comment for A::$f: @@ -74,7 +74,7 @@ string(%d) "/** ---> Doc comment for B::$a: -bool(false) +string(0) "" ---> Doc comment for B::$b: @@ -82,7 +82,7 @@ string(%d) "/** A doc comment for $b */" ---> Doc comment for B::$c: -bool(false) +string(0) "" ---> Doc comment for B::$e: diff --git a/Zend/tests/bug50174.phpt b/ext/reflection/tests/bug50174.phpt similarity index 94% rename from Zend/tests/bug50174.phpt rename to ext/reflection/tests/bug50174.phpt index 5f0bbd7dd49ed..c85de5c9778be 100644 --- a/Zend/tests/bug50174.phpt +++ b/ext/reflection/tests/bug50174.phpt @@ -27,5 +27,5 @@ var_dump($rp->getDocComment()); ?> --EXPECT-- -bool(false) -bool(false) +string(0) "" +string(0) "" diff --git a/Zend/tests/bug55156.phpt b/ext/reflection/tests/bug55156.phpt similarity index 97% rename from Zend/tests/bug55156.phpt rename to ext/reflection/tests/bug55156.phpt index 2dc47a11342cb..aa0ad600c7177 100644 --- a/Zend/tests/bug55156.phpt +++ b/ext/reflection/tests/bug55156.phpt @@ -27,6 +27,6 @@ namespace foo { ?> --EXPECT-- -bool(false) +string(0) "" string(12) "/** test1 */" string(12) "/** test2 */" diff --git a/ext/reflection/tests/bug64936.phpt b/ext/reflection/tests/bug64936.phpt index 537876d1c60cb..e9649ebd586fa 100644 --- a/ext/reflection/tests/bug64936.phpt +++ b/ext/reflection/tests/bug64936.phpt @@ -29,5 +29,5 @@ var_dump(strip_doc_comment($rb->getDocComment())); ?> --EXPECT-- -bool(false) -bool(false) +string(0) "" +string(0) ""