Open BusterNeece opened 3 years ago
Hi, thanks for the report! It seems to be caused by https://github.com/opis/closure/issues/90 and unfortunately I don't see any pull request to support that yet in opis/closure.
@mnapoli looking into that issue, it looks like they did actually merge a fix for it into their 4.x branch, which is intended to support the new PHP 8.x features like this one.
Is that 4.x branch already in use on the beta branch of PHP-DI? I wouldn't have any issue switching over to that for now.
No currently PHP-DI uses v3. Maybe it could be possible to support v3 and v4 if they haven't changed the API that PHP-DI uses?
@mnapoli I'm worried that may be the only way to actually take advantage of PHP 8.0-level features inside the closures that are compiled, since they've closed PRs that would add PHP 8.0 functionality to 3.x, saying those features were reserved exclusively for 4.x.
The problem, though, is that 4.x seems to require the php-ffi
extension be installed. That would be a huge BC break and is a pretty significant roadblock to jumping to that version.
Oh… yeah very good point, thanks for bringing that up.
I've asked for some clarification in https://github.com/opis/closure/issues/59#issuecomment-874279069 as I see Laravel is also using opis/closure.
Hello! I'm using PHP-DI 6.3.4 and we're in the process of updating our app to make better use of new PHP 8.0 best practices. I discovered when including the following code in my service definition:
...that the compiled container yielded this result:
This yields the error:
Presumably this is because it's detecting the named method argument as something it should be namespacing, which is causing parsing errors down the line.