Skip to content

Commit 70bce42

Browse files
authored
Merge pull request #2 from xPaw/php7.4
Fix "Array offset access syntax with curly braces is deprecated" on PHP 7.4
2 parents b8b1e97 + 5d4dda8 commit 70bce42

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

Idna.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -423,7 +423,7 @@ protected function _decode($encoded)
423423
$delim_pos = strrpos($encoded, '-');
424424
if ($delim_pos > self::byteLength($this->_punycode_prefix)) {
425425
for ($k = self::byteLength($this->_punycode_prefix); $k < $delim_pos; ++$k) {
426-
$decoded[] = ord($encoded{$k});
426+
$decoded[] = ord($encoded[$k]);
427427
}
428428
}
429429
$deco_len = count($decoded);
@@ -437,7 +437,7 @@ protected function _decode($encoded)
437437

438438
for ($enco_idx = ($delim_pos) ? ($delim_pos + 1) : 0; $enco_idx < $enco_len; ++$deco_len) {
439439
for ($old_idx = $idx, $w = 1, $k = $this->_base; 1 ; $k += $this->_base) {
440-
$digit = $this->_decode_digit($encoded{$enco_idx++});
440+
$digit = $this->_decode_digit($encoded[$enco_idx++]);
441441
$idx += $digit * $w;
442442
$t = ($k <= $bias) ? $this->_tmin :
443443
(($k >= $bias + $this->_tmax) ? $this->_tmax : ($k - $bias));
@@ -829,7 +829,7 @@ protected function _utf8_to_ucs4($input)
829829
$mode = 'next';
830830
$test = 'none';
831831
for ($k = 0; $k < $inp_len; ++$k) {
832-
$v = ord($input{$k}); // Extract byte from input string
832+
$v = ord($input[$k]); // Extract byte from input string
833833
if ($v < 128) { // We found an ASCII char - put into stirng as is
834834
$output[$out_len] = $v;
835835
++$out_len;
@@ -960,7 +960,7 @@ protected function _ucs4_string_to_ucs4($input)
960960
$out_len++;
961961
$output[$out_len] = 0;
962962
}
963-
$output[$out_len] += ord($input{$i}) << (8 * (3 - ($i % 4) ) );
963+
$output[$out_len] += ord($input[$i]) << (8 * (3 - ($i % 4) ) );
964964
}
965965
return $output;
966966
}

0 commit comments

Comments
 (0)