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

Parameter $limit of preg_split should be nullable #56

Closed
vhenzl opened this issue Nov 5, 2018 · 3 comments
Closed

Parameter $limit of preg_split should be nullable #56

vhenzl opened this issue Nov 5, 2018 · 3 comments

Comments

@vhenzl
Copy link

vhenzl commented Nov 5, 2018

PHP documentation says:

limit
If specified, then only substrings up to limit are returned with the rest of the string being placed in the last substring. A limit of -1 or 0 means "no limit" and, as is standard across PHP, you can use NULL to skip to the flags parameter.

So $limit should be ?int but in the generated preg_split function it is int only.

@moufmouf
Copy link
Member

moufmouf commented Nov 8, 2018

Absolutely right.
The signature is correct in PHPStan's functionMap (which we use as the primary source of truth for method signatures), so I'll need to understand what is going on here. The problem is definitely in Safe's code generator.

I'll look into it.

@moufmouf
Copy link
Member

moufmouf commented Nov 8, 2018

Fixed in #58.

@moufmouf moufmouf closed this as completed Nov 8, 2018
@vhenzl
Copy link
Author

vhenzl commented Nov 8, 2018

Great, thanks a lot 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants