Doc #80479 [Opn->Fbk]: Exception code is defaulted (apparently) to integer zero, but not documented
| From: | cmb@php.net | Date: | Thu, 03 Dec 2020 13:43:31 +0000 |
| Subject: | Doc #80479 [Opn->Fbk]: Exception code is defaulted (apparently) to integer zero, but not documented | ||
| References: | 1 | Groups: | php.doc.bugs |
| Request: | Send a blank email to doc-bugs+get-18186@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=80479&edit=1
ID: 80479
Updated by: cmb@php.net
Reported by: scott at scott-corcoran dot com
Summary: Exception code is defaulted (apparently) to integer
zero, but not documented
-Status: Open
+Status: Feedback
Type: Documentation Problem
Package: Documentation problem
Operating System: Debian
PHP Version: 7.3.25
-Assigned To:
+Assigned To: cmb
Block user comment: N
Private report: N
New Comment:
This appears to be properly documented: <https://www.php.net/manual/en/exception.construct.php>.
Is this perhaps about an out-dated translation? Which one?
Previous Comments:
------------------------------------------------------------------------
[2020-12-03 13:40:44] peehaa@php.net
It is documented:
https://www.php.net/manual/en/exception.construct.php
https://www.php.net/manual/en/class.exception.php
Where did you find those docs?
------------------------------------------------------------------------
[2020-12-03 13:27:00] scott at scott-corcoran dot com
Description:
------------
<?php
try
{
throw new Exception('xxxx');
}
catch(Exception $x)
{
echo serialize($x->getCode());
}
?>
i:0;
Documentation,
class Exception:
Methods
o public Exception::__construct NULL ([string $message = ""], [int $code],
[Exception $previous])
Test script:
---------------
As in the description:
try
{
throw new Exception('xxxx');
}
catch(Exception $x)
{
if (serialize($x->getCode() == 's:0;')
exit(0);
throw new Exception('Invalid exception code default');
}
Expected result:
----------------
silence
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=80479&edit=1