FiberResumedAfterTermination
error native on by default PHP ≥ 8.1Group: Probable bugs
Identify resume on a locally allocated Fiber whose inline arrow or closure callback completes with a literal return, without calls, branches, loops, nested callbacks or suspension, and whose start completed on the same unconditional path. Unknown or more complex callbacks do not establish termination.
Detection
- Report resume on a locally allocated Fiber whose inline arrow or closure callback completes with a literal return, without calls, branches, loops, nested callbacks or suspension, and whose start completed on the same unconditional path. Unknown or more complex callbacks do not establish termination.
- Resolve builtin functions, classes, constants and methods, including imports and supported named arguments. Follow only bounded local facts within one lexical scope. Receiver and argument provenance must establish the specific API contract; variable names and comments never prove intent.
- Report one finding per violating operation. A reachable path, unchanged value identity and applicable API behavior are required. Intervening mutation, unknown calls involving tracked values, escaped aliases or exhausted analysis budgets invalidate proof.
- Only an executed call counts. A first-class callable such as
$fiber->resume(...)or$fiber->start(...)creates a closure and runs nothing: the former is never reported and the latter does not establish that the fiber started.
Exceptions (no report)
- Exclude unresolved required symbols, user-defined lookalikes, incomplete syntax, unknown required values and unsupported versions.
- Both
@custos-ignore FiberResumedAfterTerminationand@noinspection FiberResumedAfterTerminationsuppress this native rule. - The receiver must be a plain local variable that still holds the allocated fiber. No report when, between the allocation and the resume, the variable is a
foreachkey or value target, an array orlist()destructuring target, acatchvariable, astaticvariable or anunset()operand, or when anywhere before the resume it is bound by reference (reference assignment, by-reference closure capture,global).
Fix
None. A repair requires a semantic decision or application error-handling policy.
PHP versions
Requires PHP 8.1 or later. Do not apply extension contracts when the resolved API is unavailable. Gate syntax and version-specific behavior to the configured target.
Configure
In custos.json:
json
{
"rules": {
"FiberResumedAfterTermination": {
"enabled": false
}
}
}Suppress
Before the statement or declaration (or the first statement of the file):
php
// @custos-ignore FiberResumedAfterTermination