Doc #80479 [NEW]: Exception code is defaulted (apparently) to integer zero, but not documented
| From: | scott at scott-corcoran dot com | Date: | Thu, 03 Dec 2020 13:27:00 +0000 |
| Subject: | Doc #80479 [NEW]: Exception code is defaulted (apparently) to integer zero, but not documented | ||
| Groups: | php.doc.bugs | ||
| Request: | Send a blank email to doc-bugs+get-18184@lists.php.net to get a copy of this message | ||
From: scott at scott-corcoran dot com
Operating system: Debian
PHP version: 7.3.25
Package: Documentation problem
Bug Type: Documentation Problem
Bug description:Exception code is defaulted (apparently) to integer zero, but not documented
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 bug report at https://bugs.php.net/bug.php?id=80479&edit=1
--
Fix committed: https://bugs.php.net/fix.php?id=80479&r=fixed
Fixed in release: https://bugs.php.net/fix.php?id=80479&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=80479&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=80479&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=80479&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=80479&r=support
Expected behavior: https://bugs.php.net/fix.php?id=80479&r=notwrong
Not enough info: https://bugs.php.net/fix.php?id=80479&r=notenoughinfo
Submitted twice: https://bugs.php.net/fix.php?id=80479&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=80479&r=globals
PHP version support discontinued: https://bugs.php.net/fix.php?id=80479&r=phptooold
Daylight Savings: https://bugs.php.net/fix.php?id=80479&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=80479&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=80479&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=80479&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=80479&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=80479&r=mysqlcfg