portable-utf8 icon indicating copy to clipboard operation
portable-utf8 copied to clipboard

${var} string interpolation deprecated in php8.2

Open alexandreelise opened this issue 2 years ago • 6 comments

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

its in the title

How can I reproduce it?

install voku/portable-utf8 version ^5.4 on php 8.2.x

Does it take minutes, hours or days to fix?

minutes it's in UTF8.php file

Any additional information?

I don't want to be a hassle, just trying to be helpful and report what might be useful to you.

Here are the logs with php 8.2.x:

PHP message: PHP Deprecated: Using ${var} in strings is deprecated, use {$var} instead in vendor/voku/portable-utf8/src/voku/helper/UTF8.php on line 4653 PHP message: PHP Deprecated: Using ${var} in strings is deprecated, use {$var} instead in vendor/voku/portable-utf8/src/voku/helper/UTF8.php on line 4664 PHP message: PHP Deprecated: Using ${var} in strings is deprecated, use {$var} instead in vendor/voku/portable-utf8/src/voku/helper/UTF8.php on line 5731 PHP message: PHP Deprecated: Using ${var} in strings is deprecated, use {$var} instead in vendor/voku/portable-utf8/src/voku/helper/UTF8.php on line 5742 PHP message: PHP Deprecated: Using ${var} in strings is deprecated, use {$var} instead in vendor/voku/portable-utf8/src/voku/helper/UTF8.php on line 13398 PHP message: PHP Deprecated: Using ${var} in strings is deprecated, use {$var} instead in vendor/voku/portable-utf8/src/voku/helper/UTF8.php on line 13409

https://php.watch/versions/8.2/$%7Bvar%7D-string-interpolation-deprecated might help about what seem be to an issue.

This error came to my log file when using Joomla 4.2.6 which has voku/portable-utf8:^5.4 as composer dependency. Placed in libraries/vendor/voku/portable-utf8 in this repo https://github.com/joomla/joomla-cms.git

alexandreelise avatar Jan 07 '23 00:01 alexandreelise

It would require to backport #181 to version 5.

laoneo avatar Jan 12 '23 07:01 laoneo

I have a branch with this fixed, but I can't merge it back to the 5.4.51 tag. @voku I'm not sure how you want to handle this, or if you just don't want to. :)

Unfortunately, this is a dependency of a dependency, so I am pretty powerless to just upgrade to the latest version.

mrunkel avatar Apr 13 '23 12:04 mrunkel

@mrunkel maybe you can push it as draft and I will merge the changes by hand, what do you think?

voku avatar Apr 13 '23 13:04 voku

Just for people stumbling upon this issue from Google or something... This error also seems to appear in the latest version of Nextcloud (26.0.1) with the "recognize" plugin:

Using ${var} in strings is deprecated, use {$var} instead at /var/www/xxxxx/apps/recognize/vendor/voku/portable-utf8/src/voku/helper/UTF8.php#13409

mwllgr avatar Apr 20 '23 20:04 mwllgr

Curious if there's been any traction on this.

joelra avatar Jun 09 '23 03:06 joelra

For your information, your library is spamming deprecation log in my project because it is used by wamania/php-stemmer and we are using php 8.2.

mcsky avatar Jun 26 '23 14:06 mcsky