Skip to content

Commit 28810a5

Browse files
authored
Update object.class.php (#384)
We need an explicit cast to array in the sizeOf for PHP8 to avoid error : PHP Fatal error: Uncaught TypeError: sizeof(): Argument #1 ($value) must be of type Countable|array, null given in /var/www/html/testlink-code-testlink_1_9_20_fixed/lib/functions/object.class.php:600
1 parent da36677 commit 28810a5

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

lib/functions/object.class.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -597,7 +597,7 @@ static public function createObjectsFromDB(&$db,$ids,$className,$returnAsMap = f
597597
$items = self::bulkCreateObjectsFromDB($db,$ids,$className,$returnAsMap,$detailLevel);
598598
else
599599
{
600-
for($i = 0;$i < sizeof($ids);$i++)
600+
for($i = 0;$i < sizeof((array)$ids);$i++)
601601
{
602602
$id = $ids[$i];
603603
$item = self::createObjectFromDB($db,$id,$className,self::TLOBJ_O_SEARCH_BY_ID,$detailLevel);

0 commit comments

Comments
 (0)