[php-src] Issue #9691: php has a problem to report namespace "\" correct as string

From: Date: Sat, 08 Oct 2022 11:58:00 +0000
Subject: [php-src] Issue #9691: php has a problem to report namespace "\" correct as string
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-242543@lists.php.net to get a copy of this message
Issue: https://github.com/php/php-src/issues/9691 Author: aotto1968 ### Description The following code is use to test an error-report from PHP into my extension. the error new Exception('my error') have to be reported but I figure out that the _namespace_ names are **not** separated by \ ```php <?php use phpmsgque\MqMsgque as mq; class Filter2 extends mq\MqContextC implements mq\iServerSetup { public function __construct($tmpl=NULL) { parent::__construct($tmpl); $this->ConfigSetName('filter'); $this->data = array(); } public function ServerSetup() { $this->ServiceCreate('+FTR', array(&$this, 'FTRcmd')); $this->ServiceProxy('+EOF'); } public function FTRcmd() { throw new Exception('my error'); } } $srv = new Filter2(); try { $srv->LinkCreate($argv); $srv->ProcessEvent(mq\MqWaitOnEventE::FOREVER); } catch (Throwable $ex) { $srv->ErrorCatch($ex); } finally { $srv->Exit(); } ?> ``` Resulted in this output: ```---- Result was: CHILDSTATUS-1 C> (split) [service-call-error] <Tok|+FTR> <Num|1> S> (filter) [main] Exception: my error in .../NHI1/theLink/example/php/Filter2.php:27 Stack trace: #0 [internal function]: Filter2->FTRcmd(NULL) #1 .../NHI1/theLink/example/php/Filter2.php(33): phpmsgqueMqMsgqueMqContextC->ProcessEvent(Object(phpmsgqueMqMsgqueMqWaitOnEventE)) #2 {main} C> (split) | 825 | send_mq.c | MqSendEND_AND_WAIT C> (split) | 212 | asplit.c | split C> (split) | 257 | asplit.c | SplitCreate C> (split) use '-h' or '--help' for usage C> (split) | 114 | atool.c | main ---- Result should have been (updateTS matching): CHILDSTATUS-1 [Cc]> (split) [service-call-error] <Tok|+FTR> <Num|1> [Ss]> (filter) [main] Exception: my error in */Filter2.php(31): MqContextC->ProcessEvent(3) #2 {main}* [Cc]> (split) use '-h' or '--help' for usage* ``` The __namespace__ \ character disappear But I expected this output instead: ``` phpmsgque\MqMsgque\MqContextC->ProcessEvent(Object(phpmsgque\MqMsgque\MqWaitOnEventE)) ``` for reporting I use the zval_get_string_func function. ### PHP Version 8.1.10 cli ### Operating System openSUSE Tumbleweed

« previous php.bugs (#242543) next »