php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #79686 Nullable type hints are undocumented
Submitted: 2020-06-11 00:02 UTC Modified: 2020-06-11 00:18 UTC
From: me at jfr dot im Assigned:
Status: Duplicate Package: Documentation problem
PHP Version: Irrelevant OS: N/A
Private report: No CVE-ID: None
 [2020-06-11 00:02 UTC] 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)


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2020-06-11 00:18 UTC] requinix@php.net
-Status: Open +Status: Duplicate
 [2020-06-11 00:18 UTC] requinix@php.net
Duplicate of bug #74024
 
PHP Copyright © 2001-2020 The PHP Group
All rights reserved.
Last updated: Wed Sep 23 03:01:23 2020 UTC