Error when killing script: Object of class UnwindExit could not be converted to string
Nobody has claimed this yet.
- Dominant language
- C
- Stars
- 40.4k
- Forks
- 8.1k
- Avg merge
- 2d 13h
- Merged PRs (30d)
- 96
Description
Description
I am running PHP 8.2.8 and PHP 8.3.0 Beta 1, and at times, I get this error when killing a cli script:
Object of class UnwindExit could not be converted to string
It's been tricky to reproduce, but I can intermittently get the error by:
- Unzip attached code.zip.
- Run: php -n test.php
- Immediately press Ctrl-C.
If no errors appear, repeat running the script and pressing Ctrl-C.
The error I get is:
Warning: Uncaught Error: Object of class UnwindExit could not be converted to string in /tmp/test/a.php:2
Stack trace:
#0 /tmp/test/test.php(4): require()
#1 /tmp/test/test.php(14): {closure}('a')
#2 {main}
thrown in /tmp/test/a.php on line 2
Fatal error: During class fetch: Uncaught in /tmp/test/a.php on line 2
I believe the error comes up when the script is killed while one of the classes is being loaded.
Please let me know if I can provide more information to narrow it down.
Thanks for your help.
PHP Version
PHP 8.2.8 and PHP 8.3.0 Beta 1
Operating System
Linux
Contributor guide
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
Unpack code.zip and start with /tmp/test/test.php and /tmp/test/a.php; run php -n test.php and press Ctrl-C while the script is loading classes. Trace the CLI interruption and class-loading path around this reproduction. Done means the intermittent UnwindExit conversion error no longer occurs when the script is killed.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- c, php
- Domain
- backend, cli
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100