php / php/doc-en

A "void" function is only checked at compile time, and may still throw

Open
#5,389 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
Dominant language
XML
Stars
596
Forks
890
Avg merge
1d 15h
Merged PRs (30d)
55

Description

Affected page

https://www.php.net/manual/en/language.types.void.php

Current issue
  • There is no mention that a "void" function is only checked by the compiler. And that the check is that "return expression;" is forbidden for a void function.
  • There is no mention that no type inference is performed.
  • There is no mention that a "void" function will never produce a TypeError at runtime.
  • There is no mention that a "void" function can still throw an Exception.
  • There is no mention that "void" is not a type, but only a return-only type.
Suggested improvement

Mention these 5 points, because they are really important.

Additional context (optional)

No response

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

Open the affected PHP manual page at language.types.void.php and read the existing explanation of void functions. Update the page to cover compiler-only checking, the prohibition on return expressions, lack of type inference, runtime TypeError behavior, exceptions, and void as a return-only type.

Written by the indexing model from the issue text.

Assessment

Tech stack
php
Domain
documentation
Issue type
Documentation
Difficulty
1/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
58/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.