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

Fix ForwardCompatAuthenticatorTrait with OPCache preload #1134

Merged
merged 1 commit into from
Apr 11, 2023

Conversation

elavrom
Copy link
Contributor

@elavrom elavrom commented Mar 30, 2023

Hi there,

Since the eval() in the ForwardCompatAuthenticatorTrait is creating problems when OPCache preload is enabled, here is a quick fix to avoid eval()'ing multiple times.

(Issue ref : #996)

P.S. : First time making a PR, feel free to tell me if I did something wrong

@Amegatron
Copy link

I still wonder, why there is need for eval. It seems to be OK to have just normal Trait declarations. Instead, eval indeed may cause problems with different kinds of static analysis and caching.

@chalasr
Copy link
Collaborator

chalasr commented Apr 10, 2023

The reason is that the v2 of this package supports a wide range of PHP versions including legacy ones that do not support some type declarations. Using eval is the only way to make php skip interpreting it and avoid ending up with a fatal error.

@chalasr
Copy link
Collaborator

chalasr commented Apr 11, 2023

Thank you @elavrom.

@chalasr chalasr merged commit fa3a02a into lexik:2.x Apr 11, 2023
@Amegatron
Copy link

@chalasr Thanks for clarification. I believe this reason now especially highlights what I described in the mentioned issue: #996 (comment)

In brief, my belief is that another compatibility approach should be chosen.

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

Successfully merging this pull request may close these issues.

3 participants