safe
safe copied to clipboard
Compatibility with multiple php versions at the same time
As described in https://github.com/thecodingmachine/safe/issues/310#issuecomment-1005515855, currently we can only support one exact php version at the time. This is already causing conflicts between php8.0 and php8.1 function signatures.
To solve this, a few things need to happen:
- [ ] Create a delta for the functions we are interested in to keep track of signature changes between PHP versions (ideally take 7.4 as a base and create a delta for 8.0 and 8.1). Example: https://github.com/phpstan/phpstan-src/blob/master/resources/functionMap_php80delta.php
- [ ] Update the generator so it looks at the delta and adds PHP version conditions based on the signature differences (currently manually done in this example: https://github.com/thecodingmachine/safe/pull/316/files#diff-e816c0c7b14543677df94d05d037fd2fa5f7facf73291fb55dd0c6715b1aff61)
- [ ] Create a command that can be run to generate a new delta when a new php version is released
Once the above tasks are achieved, we can expand the php version requirement of this package to anything we have a delta for.