Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update to PHP 8.0 #76

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

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.

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.

None yet

3 participants