File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed
Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -454,8 +454,9 @@ Making a bowl of raspberry natural yogurt.
454454 dropping the default value, since it will never be used.
455455 One exception to this rule are arguments of the form
456456 <code >Type $param = null</code >, where the &null; default makes the type implicitly
457- nullable. This usage remains allowed, though it is recommended to use an
458- explicit <link linkend =" language.types.declarations.nullable" >nullable type</link > instead.
457+ nullable. This usage is deprecated as of PHP 8.4.0, and an explicit
458+ <link linkend =" language.types.declarations.nullable" >nullable type</link >
459+ should be used instead.
459460 <example >
460461 <title >Declaring optional arguments after mandatory arguments</title >
461462 <programlisting role =" php" >
@@ -464,7 +465,7 @@ Making a bowl of raspberry natural yogurt.
464465 function foo($a = [], $b) {} // Default not used; deprecated as of PHP 8.0.0
465466 function foo($a, $b) {} // Functionally equivalent, no deprecation notice
466467
467- function bar(A $a = null, $b) {} // Still allowed ; $a is required but nullable
468+ function bar(A $a = null, $b) {} // Deprecated as of PHP 8.4.0 ; $a is required but nullable
468469 function bar(?A $a, $b) {} // Recommended
469470 ?>
470471 ]]>
You can’t perform that action at this time.
0 commit comments