Doc #80479 [Com]: Exception code is defaulted (apparently) to integer zero, but not documented

From: Date: Thu, 03 Dec 2020 14:04:20 +0000
Subject: Doc #80479 [Com]: 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-18187@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 Comment by: scott at scott-corcoran dot com Reported by: scott at scott-corcoran dot com Summary: Exception code is defaulted (apparently) to integer zero, but not documented Status: Feedback Type: Documentation Problem Package: Documentation problem Operating System: Debian PHP Version: 7.3.25 Assigned To: cmb Block user comment: N Private report: N New Comment: Never mind. Close it. It must have been fixed between the php7 docs I downloaded maybe before 7.3.19 and now. Previous Comments: ------------------------------------------------------------------------ [2020-12-03 13:43:31] cmb@php.net 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? ------------------------------------------------------------------------ [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

« previous php.doc.bugs (#18187) next »