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
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: me at jfr dot im
New email:
PHP Version: OS:

 

 [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-2024 The PHP Group
All rights reserved.
Last updated: Fri Apr 26 04:01:30 2024 UTC