1
0
mirror of https://github.com/php/php-src.git synced 2026-03-24 00:02:20 +01:00

Fix escapes for namespaced classes in gen_stub.php

Fix the string generated when the `ns\class` is passed to a macro

    #define ESCAPE(x) #x
    // puts(ESCAPE(ns\class));  // warning: unknown escape sequence: \c
    puts(ESCAPE(ns\\class));  // Properly prints ns\class to stdout.
This commit is contained in:
Tyson Andre
2019-08-22 21:14:00 -04:00
committed by Christoph M. Becker
parent 9b227640c1
commit 0c09089caf

View File

@@ -305,7 +305,7 @@ function funcInfoToCode(FuncInfo $funcInfo): string {
$code .= sprintf(
"ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_%s, %d, %d, %s, %d)\n",
$funcInfo->name, $funcInfo->return->byRef, $funcInfo->numRequiredArgs,
$returnType->name, $returnType->isNullable
str_replace('\\', '\\\\', $returnType->name), $returnType->isNullable
);
}
} else {
@@ -328,7 +328,7 @@ function funcInfoToCode(FuncInfo $funcInfo): string {
$code .= sprintf(
"\tZEND_%s_OBJ_INFO(%d, %s, %s, %d)\n",
$argKind, $argInfo->byRef, $argInfo->name,
$argInfo->type->name, $argInfo->type->isNullable
str_replace('\\', '\\\\', $argInfo->type->name), $argInfo->type->isNullable
);
}
} else {