Doc #79686 [Opn->Dup]: Nullable type hints are undocumented

From: Date: Thu, 11 Jun 2020 00:18:17 +0000
Subject: Doc #79686 [Opn->Dup]: Nullable type hints are undocumented
References: 1  Groups: php.doc.bugs 
Request: Send a blank email to doc-bugs+get-17644@lists.php.net to get a copy of this message
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)

« previous php.doc.bugs (#17644) next »