php / php/doc-en

Document when PHP automatically sets the $previous value in new Throwables

Open
#3,656 0 comments 0 reactions 0 assignees View on GitHub

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:

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.