Skip to content

PHP 8.1 passing null to scalar arguments deprecated #258

Description

@thekid

After php/php-src#6475 has been merged, there are a couple of places that need fixing:

  • strlen(): Passing null to parameter 1 ($string) of type string is deprecated" in ::strlen() (Reader.class.php, line 95, occured once)
  • iconv(): Passing null to parameter 2 ($to_encoding) of type string is deprecated" in ::iconv() (TextWriter.class.php, line 76, occured once)
  • iconv(): Passing null to parameter 2 ($to_encoding) of type string is deprecated" in ::iconv() (TextWriter.class.php, line 76, occured once)
  • ReflectionClass::hasConstant(): Passing null to parameter 1 ($name) of type string is deprecated" in ReflectionClass::hasConstant() (XPClass.class.php, line 355, occured once)
  • strlen(): Passing null to parameter 1 ($string) of type string is deprecated" in ::strlen() (Type.class.php, line 211, occured once)
  • strlen(): Passing null to parameter 1 ($string) of type string is deprecated" in ::strlen() (Bytes.class.php, line 39, occured once)
  • strlen(): Passing null to parameter 1 ($string) of type string is deprecated" in ::strlen() (Type.class.php, line 211, occured once)
  • ucfirst(): Passing null to parameter 1 ($string) of type string is deprecated" in ::ucfirst() (Environment.class.php, line 122, occured once)

See https://wiki.php.net/rfc/deprecate_null_to_scalar_internal_arg

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions