数组到字符串转换错误行11

I get and error array to string conversion error on line 11 I need to compare $result array with $file array and then over write FILE with $result data. In other words, FILE and the data it contains is continuously being updated with $result

compare -> overwrite -> repeat at next execution.

Note: .db file is empty at first cycle but becomes populated at first write.

sample code with Array to string conversion error:

<?php
$id = $argv[1];  //variable for inbound
$result = array(
    'return' => array(
        array(1,2,3),
        array(6,2,3),
        array(3,2,3),
    )
);
function getdiff($new, $old) {
   $diff = array_intersect($new, $old);
   return $diff;
}
$old = file_exists('1.db') ? json_decode(file_get_contents('1.db'), 1) : array();
$arrayDiffresult = getdiff( $result, $old);
file_put_contents('1.db', json_encode($result));
print_r(
    getdiff($result, $old)
);
?>

I have a second method I have tried and I get the same error, at the comparison point line 9.

$result = array(
    'return' => array(
        array(1,2,3),
        array(5,2,3),
        array(3,2,3),
    )
);
$lines = file("myDB.db");
$arrayDiffresult = array_diff ( $result['return'], $lines);
file_put_contents('myDB.db', print_r($result['return'], true));

I believe array_intersect is only used in one dimensional arrays, and it is attempting to treat the nested arrays as a string for equality comparison. However looking at the documentation show the function array_uintersect where you can write your own comparison function as a callback. You didn't provide much information as to what the requirements are but if you do I'd be happy to help