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

PHP 8.1: offset* signature #276

Closed
thekid opened this issue Jul 25, 2021 · 2 comments
Closed

PHP 8.1: offset* signature #276

thekid opened this issue Jul 25, 2021 · 2 comments
Labels

Comments

@thekid
Copy link
Member

thekid commented Jul 25, 2021

With recent PHP 8.1 builds, the following notice occurs:

Return type of util\Bytes::offsetUnset($offset) should either be compatible with ArrayAccess::offsetUnset(mixed $offset): void, or the #[ReturnTypeWillChange] attribute should be used to temporarily suppress the notice

This was suggested in https://wiki.php.net/rfc/internal_method_return_types and introduced in php/php-src#7251

  • Adding void as a return type will break backwards compatibility with PHP 7.0
  • Adding mixed as type will break backwards compatibility with all PHP 7 versions

For the moment, adding #[ReturnTypeWillChange] seems like the way to go.

@thekid thekid added the php label Jul 25, 2021
thekid added a commit that referenced this issue Jul 25, 2021
thekid added a commit that referenced this issue Jul 25, 2021
@thekid
Copy link
Member Author

thekid commented Jul 25, 2021

Fixed w/ some additional commits, see https://github.com/xp-framework/core/actions/runs/1064453514

@thekid thekid closed this as completed Jul 25, 2021
@thekid
Copy link
Member Author

thekid commented Jul 25, 2021

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant