Document when PHP automatically sets the $previous value in new Throwables
Nobody has claimed this yet.
- Dominant language
- XML
- Stars
- 596
- Forks
- 890
- Avg merge
- 1d 15h
- Merged PRs (30d)
- 55
Description
As far as I see, php.net doesn't document in what circumstances the $previous value is automatically set when the caller doesn't provide one in the Exception/Error constructor. As far as I know, that happens when new exceptions are thrown in finally blocks, in deconstructors and I guess in any other code somehow run outside of a catch block while the Throwable is still bubbling up the call stack. I expected to find that mentioned in one or more of these pages:
- https://www.php.net/manual/en/language.exceptions.php
- https://www.php.net/manual/en/exception.construct.php
- https://www.php.net/manual/en/error.construct.php
- https://www.php.net/manual/en/throwable.getprevious.php
- https://www.php.net/manual/en/exception.getprevious.php
- https://www.php.net/manual/en/error.getprevious.php
- https://www.php.net/manual/en/class.exception.php#exception.props.previous
- https://www.php.net/manual/en/class.error.php#error.props.previous
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Review the listed PHP manual pages, especially language.exceptions.php and the constructor and getprevious references, to determine where the behavior belongs and which cases are documented. Verify the circumstances described in the issue against PHP behavior, then update the relevant English documentation so the automatic $previous behavior and its scope are explicit.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- php
- Domain
- documentation
- Issue type
- Documentation
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100