I have a code as below and I can't remove element for each loop. Do you know why?

PHP Code:
<?php
    $data 
= array(
        array(
'A''C'),
        array(
'B''C''E'),
        array(
'A''B''C''E'),
        array(
'B''E')
    );
    
    
$fi = array( 'C' => 3'B' => 3'E' => 3'A' => 2);
    
$tmp = array();
    
$mfi = array();
        
        for(
$row=0$row<count($data); $row++){
            
$tmp $fi;
            
// each loop, remove element not in $data[$row]
            // and put $tmp into $mfi
            
foreach($fi as $key=>&$value){
                if(!
in_array($tmp[$key], $data[$row])) unset($tmp[$key]);
            }
            
array_push($mfi$tmp);
        }
        
        
print_r($mfi);
?>