History log of /PHP-8.2/Zend/tests/required_param_after_optional.phpt (Results 1 – 3 of 3)
Revision Date Author Comments
# c939bd2f 18-May-2021 Nikita Popov

Handle explicitly nullable types in optional-before-required deprecation

The exception for null default values here exists to keep compatibility
with PHP < 7.1 where "Foo $bar = null" wa

Handle explicitly nullable types in optional-before-required deprecation

The exception for null default values here exists to keep compatibility
with PHP < 7.1 where "Foo $bar = null" was the canonical way to create
a nullable parameter. If the parameter is actually "?Foo $bar = null",
then clearly compatibility with PHP < 7.1 is not a concern, and we
can throw a deprecation notice.

show more ...


# afc4d67c 18-May-2021 Nikita Popov

Consistently treat optional-before-required as required

There was a loophole here when it came to usage with named arguments,
which was not intended. Close the loophole thoroughly by act

Consistently treat optional-before-required as required

There was a loophole here when it came to usage with named arguments,
which was not intended. Close the loophole thoroughly by actually
dropping the default value from the signature entirely. The default
is still used to make the type nullable, but not for anything else.

show more ...


# 3b08f53c 09-Jan-2020 Nikita Popov

Deprecate required param after optional

As an exception, we allow "Type $foo = null" to occur before a
required parameter, because this pattern was used as a replacement
for nullable

Deprecate required param after optional

As an exception, we allow "Type $foo = null" to occur before a
required parameter, because this pattern was used as a replacement
for nullable types in PHP versions older than 7.1.

Closes GH-5067.

show more ...