Doc #79686 [Opn->Dup]: Nullable type hints are undocumented
Edit report at https://bugs.php.net/bug.php?id=79686&edit=1
ID: 79686
Updated by: requinix@php.net
Reported by: me at jfr dot im
Summary: Nullable type hints are undocumented
-Status: Open
+Status: Duplicate
Type: Documentation Problem
Package: Documentation problem
Operating System: N/A
PHP Version: Irrelevant
Block user comment: N
Private report: N
New Comment:
Duplicate of bug #74024
Previous Comments:
------------------------------------------------------------------------
[2020-06-11 00:02:29] me at jfr dot im
Description:
------------
Hi there,
Searching Google for "php type hints" leads me to https://www.php.net/manual/en/language.oop5.typehinting.php,
which leads to https://www.php.net/manual/en/functions.arguments.php#functions.arguments.type-declaration,
which does not document '?type' hints, and documents that nullable arguments should be
specified by a 'type $var = NULL', which is an exception to soon-deprecated behavior
(https://github.com/php/php-src/blob/master/UPGRADING#L148).
(In fact, that deprecation indicated that it was 'sometimes used' in 'older PHP
versions', as though it isn't the only solution documented!)
(Also, searching the PHP web site for 'type hints' returns no relevant results)
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=79686&edit=1
Thread (2 messages)