barcode icon indicating copy to clipboard operation
barcode copied to clipboard

Trying to access array offset on value of type int

Open klimenttoshkov opened this issue 4 years ago • 5 comments

Trying to access array offset on value of type int at vendor/milon/barcode/src/Milon/Barcode/QRcode.php:1246, ErrorException(code: 0): Trying to access array offset on value of type int at vendor/milon/barcode/src/Milon/Barcode/QRcode.php:1246)

Laravel Framework 5.5.40 PHP 7.4.3 "milon/barcode": "^5.3"

klimenttoshkov avatar Mar 23 '21 15:03 klimenttoshkov

Here as well (in v8): DNS1D.php, ln 1299:

$tmpchr = ord($seq[1][0]);

NPellet avatar Apr 06 '21 09:04 NPellet

Also having this issue.

Trying to access array offset on value of type int in /vendor/milon/barcode/src/Milon/Barcode/DNS1D.php:1299

EDIT: Just tested this issue. It appears to only occur with numbers that are 3 digits or less. When i set the barcode to contain a number of 4 digits or more this issue disappears.

RalpinMcDjango avatar Jul 28 '21 11:07 RalpinMcDjango

@RalpinMcDjango The issue is the value your are tying to write is int and it requires string e.g. do this to convert it to string DNS2D::getBarcodeHTML(ucwords(2), "QRCODE", 5, 5, '#555')

johnngondi avatar Dec 15 '21 22:12 johnngondi

Do we have any fix here? This issue occurs on PHP > 7.4, working fine with PHP 7.3.

Array-style access of non-arrays bool generates a notice in PHP 7.4 and above.

ankitjain0269 avatar Jan 17 '22 17:01 ankitjain0269

Do we have any fix here? This issue occurs on PHP > 7.4, working fine with PHP 7.3.

Array-style access of non-arrays bool generates a notice in PHP 7.4 and above.

Not sure if this will fix it for you but i found i ran into this when the strings i threw in were <= 3 digits long. So if i used a 4 digit string such as '1000' instead of '100' it works.

RalpinMcDjango avatar Jan 17 '22 19:01 RalpinMcDjango