Hi
On 2026-09-22 17:21, Seifeddine Gmati wrote:
Just to confirm my understanding: when the file is included from
another script, the closure would still be returned without being
executed,
so the following would continue to work as it does today:
```php
$callable = require 'script_file.php';
$callable();
```
Is that correct?
Yes. The only change is that the PHP CLI SAPI will make use of the
return value of the main script rather than ignoring it. No changes for
any other SAPI and no changes to `include`/`require`. Please see the
tests in the PR, and in particular
`sapi/cli/tests/primary_script_closure_004.phpt`.
Best regards
Tim Düsterhus