Skip to content

arginfo soft-breaks with namespaced class return type if the class name starts with N #12558

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
nielsdos opened this issue Oct 29, 2023 · 2 comments

Comments

@nielsdos
Copy link
Member

Description

Make the following change on master to the test.stub.php file:

diff --git a/ext/zend_test/test.stub.php b/ext/zend_test/test.stub.php
index cc76a3a739..fe7a8a0ce2 100644
--- a/ext/zend_test/test.stub.php
+++ b/ext/zend_test/test.stub.php
@@ -267,6 +267,8 @@ class Foo {
         public function method(): void {}
     }
 
+    class Node {}
+
     function namespaced_func(): bool {}
 
     /** @deprecated */
@@ -280,6 +282,8 @@ function namespaced_aliased_func(): void {}
      * @alias zend_test_void_return
      */
     function namespaced_deprecated_aliased_func(): void {}
+
+    function breaks(): Node {}
 }
 
 namespace ZendTestNS2\ZendSubNS {

Now regenerate the arginfo.
Now configure using: CC=clang CXX=clang++ ./configure --enable-debug --enable-zend-test --enable-werror which is the same compiler and same --enable-werror flag that ASAN CI uses.
Now make and you'll get:

ext/zend_test/test_arginfo.h:153:86: error: incomplete universal character name; treating as '\' followed by identifier [-Werror,-Wunicode]
ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_ZendTestNS2_breaks, 0, 0, ZendTestNS2\\Node, 0)

I actually ran into this in my PR #12111 causing the ASAN build to fail.

cc @kocsismate

PHP Version

8.0+

Operating System

No response

@kocsismate
Copy link
Member

Thank you, I'm on it!

@kocsismate
Copy link
Member

Related to #9154. The fix is on its way :)

kocsismate added a commit to kocsismate/php-src that referenced this issue Oct 30, 2023
kocsismate added a commit to kocsismate/php-src that referenced this issue Oct 30, 2023
kocsismate added a commit to kocsismate/php-src that referenced this issue Oct 30, 2023
kocsismate added a commit to kocsismate/php-src that referenced this issue Oct 30, 2023
kocsismate added a commit that referenced this issue Oct 31, 2023
* PHP-8.2:
  Fix GH-12558 Escape \N in generated stubs
kocsismate added a commit that referenced this issue Oct 31, 2023
* PHP-8.3:
  Fix GH-12558 Escape \N in generated stubs
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants