Skip to content

Conversation

@farktronix
Copy link

When running esc2html with PHP v8.2.9 on MacOS I got some warnings and errors:

PHP Deprecated:  Using ${var} in strings is deprecated, use {$var} instead in /Users/pharkas/code/escpos-tools/esc2html.php on line 104
PHP Fatal error:  Uncaught TypeError: implode(): Argument #1 ($separator) must be of type string, array given in /Users/pharkas/code/escpos-tools/esc2html.php:63

It looks like the old implode(array $array, string $separator): string API was removed in PHP 8.0.0, but the fix is simple- just swap the arguments. I also fixed the warning about ${var} in strings being deprecated.

I ran a code style check with php vendor/bin/phpcs --standard=psr2 src/ -n but got an error because php_codesniffer was out of date, so I bumped it up to ^3.0

@michi-s
Copy link

michi-s commented Apr 28, 2024

Reviewd it works well, thank you. Someone should really merge that.

@jayaddison
Copy link

I can also add/confirm that this allowed me to use esc2html with PHP 8.0.

@marcos-devarts
Copy link

marcos-devarts commented Jun 27, 2025

Hello @farktronix , is there any obstacle merging this PR? I can't use the library in my PHP8 software until it's merged, and I'd be super happy to do it :( Thanks in advance.

@farktronix
Copy link
Author

Hello @farktronix , is there any obstacle merging this PR? I can't use the library in my PHP8 software until it's merged, and I'd be super happy to do it :( Thanks in advance.

I don't have the ability to merge this myself, so it's just waiting on the project maintainer (@mike42)

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants