You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I encountered following issue PHP Notice: Undefined offset: 0 in .../koolphp/koolreport/src/datasources/ArrayDataSource.php on line 111 when used associative array with keys different than integers. As far as I can see, first item of array is used to detect columns type:
foreach($data[0] as $key=>$value)
{
$metaData["columns"][$key]=array(
"type"=>$this->guessType($value),
);
}
I think you could use current($data) function instead of $data[0] so you get first element regardless the key name.
The text was updated successfully, but these errors were encountered:
I agree, this makes sense, since doesnt seem to have any side-effects:
The current() function simply returns the value of the array element that's currently being pointed to by the internal pointer. It does not move the pointer in any way.
@pawelkmpt what's the secific use case for us? Why are non-integer keys better?
I encountered following issue
PHP Notice: Undefined offset: 0 in .../koolphp/koolreport/src/datasources/ArrayDataSource.php on line 111
when used associative array with keys different than integers. As far as I can see, first item of array is used to detect columns type:I think you could use
current($data)
function instead of$data[0]
so you get first element regardless the key name.The text was updated successfully, but these errors were encountered: