From 3ab25d2580d02c9d0567c343a59e6c26796b3cc1 Mon Sep 17 00:00:00 2001 From: Jose Diaz-Gonzalez Date: Tue, 21 Jan 2020 01:31:55 -0500 Subject: [PATCH] fix: drop deprecated string offset access via curly braces --- src/ZackKitzmiller/Tiny.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/ZackKitzmiller/Tiny.php b/src/ZackKitzmiller/Tiny.php index 6068897..6ee5ea7 100644 --- a/src/ZackKitzmiller/Tiny.php +++ b/src/ZackKitzmiller/Tiny.php @@ -17,7 +17,7 @@ public function to($id) $radix = strlen($set); while (true) { $r = $id % $radix; - $hexn = $set{$r} . $hexn; + $hexn = $set[$r] . $hexn; $id = ($id - $r) / $radix; if ($id == 0) { break; @@ -34,7 +34,7 @@ public function from($str) $strlen = strlen($str); $n = 0; for ($i = 0; $i < $strlen; $i++) { - $n += strpos($set, $str{$i}) * pow($radix, ($strlen - $i - 1)); + $n += strpos($set, $str[$i]) * pow($radix, ($strlen - $i - 1)); } return $n; }