PHP write csv UTF-8 with BOM character

<?php

$fp = fopen('php://temp', 'w');

fputs( $fp, $bom = chr(0xEF) . chr(0xBB) . chr(0xBF) );

fputcsv($fp, ['test', 'deneme', 'örnek'], ',');

fclose( $fp );