generator
generator copied to clipboard
Parse Error with Immediately Invoked Function Expression (IIFE)
I have the following function that fails parsing because of the ()
call at the end:
$container = $container ?: ( function() {
// logic here
} )();
IIFE are supported as of PHP 7.0 and up.
Can you explain a bit more? How does this relate to this library?
Ah is that code inside your application that you're scanning with this library? In that case the error is probably because the hooks parser library that's used in this library is quite out of date and needs to be updated. See #4.
Thank you, I will update to wp-hooks/wordpress-core
This won't be enough, bc the library this depends on is outdated/not maintained anymore.
There are tons of similar issues with all kinds of code that cause issues here. A possible solution (besides maintaining that other library) is to just remove all code that causes issues. I currently pre-parse all files and remove all code that causes issues and is irrelevant for hooks anyway.