-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
TypeError thrown in PhpParser\PrettyPrinter\Standard::escapeString() because $string is not a string #710
Comments
Do you have an exception backtrace, so it's possible to see which of the escapeString() calls is responsible? |
I guess this is one of the traces you are asking for
|
I ran the provided file through |
Closing this per Roave/BetterReflection#690. From what I gathered, JSON serialization with JSON_PARTIAL_OUTPUT_ON_ERROR was used, and the string contained invalid UTF-8, which cannot be represented using JSON. |
Thank you, @nikic! |
In a project using
nikic/php-parser:4.9.1
roave/better-reflection:4.9.0
when parsing the following file
we encounter a
TypeError
with the messageaddcslashes() expects parameter 1 to be string, null given
, thrown inPhpParser\PrettyPrinter\Standard::escapeString()
.Perhaps someone has encountered a similar problem? Not sure why the method does not have type declarations, or what should happen when either or both of the arguments are
null
.The text was updated successfully, but these errors were encountered: