You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: Zend/tests/parameter_default_values/internal_declaration_error_class_const.phpt
+2-2
Original file line number
Diff line number
Diff line change
@@ -4,10 +4,10 @@ The default value is a class constant in the parent class method's signature.
4
4
<?php
5
5
class MyDateTimeZone extends DateTimeZone
6
6
{
7
-
publicstaticfunctionlistIdentifiers()
7
+
publicstaticfunctionlistIdentifiers(): array
8
8
{
9
9
}
10
10
}
11
11
?>
12
12
--EXPECTF--
13
-
Fatal error: Declaration of MyDateTimeZone::listIdentifiers()must be compatible with DateTimeZone::listIdentifiers(int $timezoneGroup = DateTimeZone::ALL, ?string $countryCode = null) in %s on line %d
13
+
Fatal error: Declaration of MyDateTimeZone::listIdentifiers(): array must be compatible with DateTimeZone::listIdentifiers(int $timezoneGroup = DateTimeZone::ALL, ?string $countryCode = null): array in %s on line %d
Copy file name to clipboardExpand all lines: Zend/tests/parameter_default_values/internal_declaration_error_const.phpt
+2-2
Original file line number
Diff line number
Diff line change
@@ -4,10 +4,10 @@ The default value is a constant in the parent class method's signature.
4
4
<?php
5
5
class MyDateTimeZone extends DateTimeZone
6
6
{
7
-
publicfunctiongetTransitions()
7
+
publicfunctiongetTransitions(): array|false
8
8
{
9
9
}
10
10
}
11
11
?>
12
12
--EXPECTF--
13
-
Fatal error: Declaration of MyDateTimeZone::getTransitions()must be compatible with DateTimeZone::getTransitions(int $timestampBegin = PHP_INT_MIN, int $timestampEnd = PHP_INT_MAX) in %s on line %d
13
+
Fatal error: Declaration of MyDateTimeZone::getTransitions(): array|false must be compatible with DateTimeZone::getTransitions(int $timestampBegin = PHP_INT_MIN, int $timestampEnd = PHP_INT_MAX): array|false in %s on line %d
Fatal error: Declaration of MyDateTimeInterface::diff()must be compatible with DateTimeInterface::diff(DateTimeInterface $targetObject, bool $absolute = false) in %s on line %d
12
+
Fatal error: Declaration of MyDateTimeInterface::diff(): DateInterval must be compatible with DateTimeInterface::diff(DateTimeInterface $targetObject, bool $absolute = false): DateInterval in %s on line %d
Fatal error: Declaration of MyDateTime::setTime(int $hour, int $minute, int $second = 0, bool $microsecond = false)must be compatible with DateTime::setTime(int $hour, int $minute, int $second = 0, int $microsecond = 0) in %s on line %d
13
+
Fatal error: Declaration of MyDateTime::setTime(int $hour, int $minute, int $second = 0, bool $microsecond = false): DateTime must be compatible with DateTime::setTime(int $hour, int $minute, int $second = 0, int $microsecond = 0): DateTime in %s on line %d
Fatal error: Declaration of MyDateTime::createFromFormat()must be compatible with DateTime::createFromFormat(string $format, string $datetime, ?DateTimeZone $timezone = null) in %s on line %d
13
+
Fatal error: Declaration of MyDateTime::createFromFormat(): DateTime|false must be compatible with DateTime::createFromFormat(string $format, string $datetime, ?DateTimeZone $timezone = null): DateTime|false in %s on line %d
Test that no notice is emitted when the return type/value of the overriding method is compatible with the tentative return type/value of the overridden method
Test that a notice is emitted when the return type/value of the overriding method is incompatible with the tentative return type/value of the overridden method
Deprecated: Declaration of MyDateTimeZone::listIdentifiers(int $timezoneGroup = DateTimeZone::ALL, ?string $countryCode = null): string should be compatible with DateTimeZone::listIdentifiers(int $timezoneGroup = DateTimeZone::ALL, ?string $countryCode = null): array in %s on line %d
Deprecated: Declaration of MyDateTimeZone::listIdentifiers(int $timezoneGroup = DateTimeZone::ALL, ?string $countryCode = null) should be compatible with DateTimeZone::listIdentifiers(int $timezoneGroup = DateTimeZone::ALL, ?string $countryCode = null): array in %s on line %d
Fatal error: Could not check compatibility between Test::createFromFormat($format, $datetime, ?Wrong $timezone = null): DateTime|false and DateTime::createFromFormat(string $format, string $datetime, ?DateTimeZone $timezone = null): DateTime|false, because class Wrong is not available in %s on line %d
Fatal error: Could not check compatibility between Test::createFromFormat($format, $datetime, $timezone = null): Wrong and DateTime::createFromFormat(string $format, string $datetime, ?DateTimeZone $timezone = null): DateTime|false, because class Wrong is not available in %s on line %d
Test that the notice can be suppressed when the return type/value of the overriding method is incompatible with the tentative return type/value of the overridden method
0 commit comments