Skip to content
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

gen_stub.php #12063

Closed
remicollet opened this issue Aug 28, 2023 · 4 comments
Closed

gen_stub.php #12063

remicollet opened this issue Aug 28, 2023 · 4 comments

Comments

@remicollet
Copy link
Contributor

remicollet commented Aug 28, 2023

Using master branch (8.3.0-dev), gen_stub.php start using simple quote string (which is obviously bad in C)

Ex, using ecma_intl ext:

$ php build/gen_stub.php  -f
Saved ./src/php/ecma_intl_arginfo.h
$ git diff
...
-       zend_string *enum_case_Calendar_value_str = zend_string_init("calendar", strlen("calendar"), 1);
+       zend_string *enum_case_Calendar_value_str = zend_string_init('calendar', strlen('calendar'), 1);
...
@remicollet
Copy link
Contributor Author

P.S. 8.3.0beta3 also affected

@remicollet
Copy link
Contributor Author

@kocsismate help welcome on this one, may be related to nikic/php-parser v5 ?

remicollet added a commit to remicollet/ecma_intl that referenced this issue Aug 28, 2023
@remicollet
Copy link
Contributor Author

remicollet commented Aug 28, 2023

It seems gen_stub uses value as written in the stub.php, where single quotes are fine

A possible workaround is to use double quotes in stub, ex:

-        case Calendar = 'calendar';
+        case Calendar = "calendar";

@remicollet
Copy link
Contributor Author

See PR #12064

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

1 participant