Skip to content

Conversation

@xPaw
Copy link
Contributor

@xPaw xPaw commented Feb 19, 2022

Fixes #298

I think there's a different type of cache order issue with __set_state which I suspect comes from using newer PHP version (I run php 8.1). All my caches are updated with keyType and itemType moves above allArrays, not really sure what's up with that.

I think var_export logic changed in what order it dumps properties?
EDIT: Yep, looks like it changed in PHP 8.1 - https://3v4l.org/Zt4tA

@staabm staabm merged commit ce11ba6 into staabm:main Feb 19, 2022
@staabm
Copy link
Owner

staabm commented Feb 19, 2022

Thx

@staabm
Copy link
Owner

staabm commented Feb 19, 2022

I think there's a different type of cache order issue with __set_state which I suspect comes from using newer PHP version (I run php 8.1). All my caches are updated with keyType and itemType moves above allArrays, not really sure what's up with that.

do you mean thats an issue still present - even after merged this PR?

If you know under which circumstances, please open a new issue

@xPaw
Copy link
Contributor Author

xPaw commented Feb 19, 2022

do you mean thats an issue still present - even after merged this PR?

It's a separate issue where the cache will differ when generated under PHP 8.1, I'm not sure you can reasonably fix this because it affects how var_export/serialize orders properties.

See the 3v4l link above, you'll see what I mean (it affects PHPStan\Type\Constant\ConstantArrayType::__set_state( in cache.

So this is only an issue when cache is being generated on different versions of PHP.

@xPaw xPaw deleted the cache-order branch February 19, 2022 20:13
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.

cache item order not stable

2 participants