Skip to content

Deprecations in php8.5 #242

@shu-yusa

Description

@shu-yusa

Description

PHP 8.5 deprecates calling ord() with a string longer than one byte: https://www.php.net/manual/en/migration85.deprecated.php#migration85.deprecated.standard

Passing a string which is not a single byte to ord() is now deprecated, this is indicative of a bug.

Also, deprecates using null as an array offset: https://www.php.net/manual/en/migration85.deprecated.php#migration85.deprecated.core.using-null-as-an-array-offset

Using null as an array offset or when calling array_key_exists() is now deprecated. Instead an empty string should be used.

Steps to reproduce

Expected behaviour

Code is executed without deprecation warning

Environment

  • Version [e.g. 1.0.1] 1.1.1
  • Server OS: [e.g. Ubuntu 20.04] Mac OS 15.7.4
  • PHP: [version, extensions loaded] 8.5.5
  • Packages: [list of packages from composer.json] same as the original one

Backtrace

ord without first byte:

simplejwt/src/SimpleJWT/Util/ASN1/DER.php:289
ord(): Providing a string that is not one byte long is deprecated. Use ord($str[0]) instead

KeySet::get without kid:

simplejwt/src/SimpleJWT/Keys/KeySet.php:327
Using null as an array offset is deprecated, use an empty string instead

Additional information

The official doc for deprecations in php8.5: https://www.php.net/manual/en/migration85.deprecated.php

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions