From e8c781ba9435c4d46340c989d7ea593d88a47d86 Mon Sep 17 00:00:00 2001 From: Roy Verrips Date: Wed, 5 Jan 2022 23:21:49 -0600 Subject: [PATCH] PHP 8.1: Implicit incompatible float to int conversion is deprecated In PHP 8.1 floats are not implicitly converted to integers as before. The array_slice on line 139 requires an integer as the third parameter (the $count variable) so added line 117 to do the conversion of $count. --- src/LoremIpsum.php | 1 + 1 file changed, 1 insertion(+) diff --git a/src/LoremIpsum.php b/src/LoremIpsum.php index a48304b..487610b 100644 --- a/src/LoremIpsum.php +++ b/src/LoremIpsum.php @@ -114,6 +114,7 @@ class LoremIpsum */ public function words($count = 1, $tags = false, $array = false) { + $count = (int) $count; $words = array(); $word_count = 0;