In Photoshop 24.7.0 (and for several past versions), when using "Save for web":
First, use "save for web" to save a file named "This-file.jpg"
Next, use "save for web" to save a file named "This file.jpg", the first file will get overwritten without a warning that the file already exists, because in the dialog box the file names are different, however "save for web" converts spaces in file names to dashes (-), which creates the conflict in my example.
Using macOS 13.4.1 (but this problem has existed since earlier versions)