Skip to content

utf8_encode-deprecation in PHP 8.2 #201

@alexgit2k

Description

@alexgit2k

What is this feature about (expected vs actual behaviour)?

Portable UTF-8 is using utf8_encode which is deprecated in PHP 8.2 and should be replaced: https://php.watch/versions/8.2/utf8_encode-utf8_decode-deprecated

/** @noinspection PhpUsageOfSilenceOperatorInspection | TODO for PHP > 8.2: find a replacement for this */
/** @var false|string $str - the polyfill maybe return false */
$str = @\utf8_encode($str);

Does it take minutes, hours or days to fix?

Minutes. Replacement-functions for utf8_encode are listed here: https://php.watch/versions/8.2/utf8_encode-utf8_decode-deprecated#utf8_encode-replace

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions