Skip to content

Commit b197e52

Browse files
committed
build/gen_stub.php: fix collision of namespaced functions
1 parent 56302dd commit b197e52

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

build/gen_stub.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -793,7 +793,7 @@ public function getNonNamespacedName(): string {
793793
}
794794

795795
public function getDeclarationName(): string {
796-
return $this->name->getLast();
796+
return strtr($this->name->toString(), "\\", "_");
797797
}
798798

799799
public function getDeclaration(): string {
@@ -1152,8 +1152,8 @@ public function getFunctionEntry(): string {
11521152
if ($namespace) {
11531153
// Render A\B as "A\\B" in C strings for namespaces
11541154
return sprintf(
1155-
"\tZEND_NS_FE(\"%s\", %s, %s)\n",
1156-
addslashes($namespace), $declarationName, $this->getArgInfoName());
1155+
"\tZEND_NS_RAW_FENTRY(\"%s\", \"%s\", ZEND_FN(%s), %s, 0)\n",
1156+
addslashes($namespace), substr((string)$this->name, strlen($namespace)+1), $declarationName, $this->getArgInfoName());
11571157
} else {
11581158
return sprintf("\tZEND_FE(%s, %s)\n", $declarationName, $this->getArgInfoName());
11591159
}

0 commit comments

Comments
 (0)