From 3257862996cea1751fce3703604909014b5381bf Mon Sep 17 00:00:00 2001 From: Patrick Khoo Date: Fri, 4 Jan 2019 16:10:37 +0800 Subject: [PATCH] 1. $args is always an arracy from func_get_args() 2. static::find_by_pk() expects $args to be an array So why are we trying to change an array into a normal variable? This fixes the countable error in PHP 7.2 --- lib/Model.php | 3 --- 1 file changed, 3 deletions(-) diff --git a/lib/Model.php b/lib/Model.php index 99667b41f..936454988 100644 --- a/lib/Model.php +++ b/lib/Model.php @@ -1596,9 +1596,6 @@ public static function find(/* $type, $options */) $args = array_slice($args,1); $num_args--; } - //find by pk - elseif (1 === count($args) && 1 == $num_args) - $args = $args[0]; // anything left in $args is a find by pk if ($num_args > 0 && !isset($options['conditions']))