Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

PHP 8.4 deprecation: UnicodeString ArrayAccess methods are missing void return types #8

Copy link
Copy link
@savinmikhail

Description

@savinmikhail
Issue body actions

Hi,

we are seeing PHP 8.4 deprecation notices coming from opis/string when UnicodeString is loaded.

Environment:

  • PHP 8.4.x
  • opis/json-schema 2.6.0
  • opis/string 2.1.0

The deprecations point to Opis\String\UnicodeString implementing ArrayAccess without the updated return types on:

  • offsetSet()
  • offsetUnset()

Current methods appear to be:

public function offsetSet($offset, $value)                                                                                                                                                                                        
public function offsetUnset($offset)                                                                                                                                                                                              
                                                                                                                                                                                                                                  
With PHP 8.4 we get deprecation notices like:                                                                                                                                                                                     
                                                                                                                                                                                                                                  
- Method "ArrayAccess::offsetSet()" might add "void" as a native return type declaration in the future. Do the same in implementation "Opis\String\UnicodeString" now to avoid errors or add an explicit @return annotation to    
  suppress this message.                                                                                                                                                                                                          
- Method "ArrayAccess::offsetUnset()" might add "void" as a native return type declaration in the future. Do the same in implementation "Opis\String\UnicodeString" now to avoid errors or add an explicit @return annotation to  
  suppress this message.                                                                                                                                                                                                          
                                                                                                                                                                                                                                  
From our side this is reproducible while using opis/json-schema, because it pulls in opis/string. 
Reactions are currently unavailable

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.