3v4l.org

run code in 200+ PHP versions simultaneously
<?php $row = array(); $row[] = 'a\\"'; $row[] = 'bbb'; $fp = fopen('php://memory', 'w+'); fputcsv($fp, $row, ',', '"', '~'); rewind($fp); var_dump(stream_get_contents($fp)); fclose($fp);
based on WpRE9
Output for 5.6.38 - 7.4.1
string(11) ""a\""",bbb "