[php-src] Issue #11821: Error when killing script: Object of class UnwindExit could not be converted to string
| From: | rbro | Date: | Sat, 29 Jul 2023 12:47:48 +0000 |
| Subject: | [php-src] Issue #11821: Error when killing script: Object of class UnwindExit could not be converted to string | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-245065@lists.php.net to get a copy of this message | ||
Issue: https://github.com/php/php-src/issues/11821
Author: rbro
### 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:
1) Unzip attached [code.zip](https://github.com/php/php-src/files/12207150/code.zip).
2) Run: php -n test.php
3) 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