|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #80479 Exception code is defaulted (apparently) to integer zero, but not documented
Submitted: 2020-12-03 13:27 UTC Modified: 2020-12-03 14:09 UTC
From: scott at scott-corcoran dot com Assigned: cmb (profile)
Status: Not a bug Package: Documentation problem
PHP Version: 7.3.25 OS: Debian
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.
Block user comment
Status: Assign to:
Bug Type:
From: scott at scott-corcoran dot com
New email:
PHP Version: OS:


 [2020-12-03 13:27 UTC] scott at scott-corcoran dot com

		throw new Exception('xxxx');
	catch(Exception $x)
		echo serialize($x->getCode());
class Exception:

       o public Exception::__construct NULL ([string  $message = ""], [int  $code], [Exception  $previous])

Test script:
As in the description:
		throw new Exception('xxxx');
	catch(Exception $x)
		if (serialize($x->getCode() == 's:0;')
                throw new Exception('Invalid exception code default');

Expected result:


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2020-12-03 13:43 UTC]
-Status: Open +Status: Feedback -Assigned To: +Assigned To: cmb
 [2020-12-03 13:43 UTC]
This appears to be properly documented: <>.

Is this perhaps about an out-dated translation?  Which one?
 [2020-12-03 14:04 UTC] scott at scott-corcoran dot com
Never mind. Close it. It must have been fixed between the php7
 docs I downloaded maybe before 7.3.19 and now.
 [2020-12-03 14:09 UTC]
-Status: Feedback +Status: Not a bug
 [2020-12-03 14:09 UTC]
Thanks for the swift reply! :)
PHP Copyright © 2001-2021 The PHP Group
All rights reserved.
Last updated: Thu Jul 29 08:01:23 2021 UTC