milon / barcode

Laravel Barcode Generator
Other
1.32k stars 318 forks source link

Array and string offset access syntax with curly braces is deprecated #98

Closed alamgircsejnu closed 4 years ago

alamgircsejnu commented 4 years ago

I am getting this error mesage when I am trying to get png barcode of type C128 .

Here is the screenshot of the issue.

Screenshot (45)

760524mkfa00 commented 4 years ago

I had to change all the curly braces in the file to get it working again.

760524mkfa00 commented 4 years ago

$code{0};

you will need to go through the file and change all occurrences where there is curly braces to square braces:

$code[0];

The file below I have already done this. DNS1D.txt

twf-nikhila commented 4 years ago

Getting the same error.

Array and string offset access syntax with curly braces is deprecated

vendor/milon/barcode/src/Milon/Barcode/DNS1D.phpLine:560

So the curly braces here is deprecated and needs to be changed to tuple format. Reference: https://wiki.php.net/rfc/deprecate_curly_braces_array_access

neilcrookes commented 4 years ago

Duplicate of #94

Fixed by https://github.com/milon/barcode/pull/92

Looks like @milon just needs to tag a release with these changes in as requested by @daaner https://github.com/milon/barcode/pull/92#issuecomment-573281213

Could you do that please @milon, then you could close this and #94

milon commented 4 years ago

I already added a new tag. please use that.

mnazmi23 commented 4 years ago

Hi, how do I use this fix using the release 6.0. I am currently using laravel 6.18 and the error are only fixed when I use the dev-master version and if possible I would like to avoid that. I wamt to use the version that works with my laravel version, but with this fixes. Installing 7.0 version was unsuccessful of course.

Thank you.

tfevan commented 3 years ago

Easy fix, After upgrade to PHP 7.4 I'm getting this error. To fix this issue then replace vendor/milon/barcode/src/Milon/Barcode/DNS1D.php file with DNS1D.php