Doc #77034 [ReO->Csd]: Casting null to int undefined
| From: | cmb@php.net | Date: | Fri, 19 Oct 2018 13:34:55 +0000 |
| Subject: | Doc #77034 [ReO->Csd]: Casting null to int undefined | ||
| References: | 1 | Groups: | php.doc.bugs |
| Request: | Send a blank email to doc-bugs+get-16094@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=77034&edit=1
ID: 77034
Updated by: cmb@php.net
Reported by: casey dot mcginty at gmail dot com
Summary: Casting null to int undefined
-Status: Re-Opened
+Status: Closed
Type: Documentation Problem
Package: Documentation problem
PHP Version: 7.2.11
Assigned To: cmb
Block user comment: N
Private report: N
New Comment:
This bug has been fixed in the documentation's XML sources. Since the
online and downloadable versions of the documentation need some time
to get updated, we would like to ask you to be a bit patient.
Thank you for the report, and for helping us make our documentation better.
Previous Comments:
------------------------------------------------------------------------
[2018-10-19 13:34:27] cmb@php.net
Automatic comment from SVN on behalf of cmb
Revision: http://svn.php.net/viewvc/?view=revision&revision=345850
Log: Fix #77034: Casting null to int undefined
------------------------------------------------------------------------
[2018-10-19 12:42:09] cmb@php.net
> But is casting null to integer really supposed to be undefined,
> or is it just that the doc doesn't mention null?
IMO, the latter. Converting to string[1] explicitly mentions
the behavior of (string)NULL.
[1] <http://php.net/manual/en/language.types.string.php#language.types.string.casting>
------------------------------------------------------------------------
[2018-10-18 20:43:24] requinix@php.net
But is casting null to integer really supposed to be undefined, or is it just that the doc
doesn't mention null? The spec says it should be 0, which is the common sense answer.
https://github.com/php/php-langspec/blob/master/spec/08-conversions.md#user-content-converting-to-integer-type
------------------------------------------------------------------------
[2018-10-18 20:22:22] salathe@php.net
See the section "Converting to integer" on the page you linked, particularly under the
"From other types" subheading.
------------------------------------------------------------------------
[2018-10-18 17:44:01] requinix@php.net
Are you actually asking that question or just implying you'd like the docs to say it?
------------------------------------------------------------------------
The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
https://bugs.php.net/bug.php?id=77034
--
Edit this bug report at https://bugs.php.net/bug.php?id=77034&edit=1