why the variable $ replaced changed to array in a function ?
foreach ($rowset as $row)
{
    $replaced = str_replace('$uid',$this->bbcode_uid,$row['first_pass_replace']);
    echo $replaced; // this is a test of the variable error and it's ok
    $this->bbcodes[$row['bbcode_tag']] = array(
        'bbcode_id' => (int) $row['bbcode_id'],
        'regexp'    => array($row['first_pass_match'] => function($replaced){
                return $replaced; //this is not working 
            }
            )
        );
}
 
     
    