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
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Password:
Status:
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: Tue May 07 21:01:30 2024 UTC