The flower petals aren’t yellow. It looks like a black nightshade. Can anyone confirm this?
This is not a tomato plant.
Although if my assessment is correct, it is of the same nightshade family Solanaceae.
I agree with your assessment black or blackberry nightshade (Solanum nigrum) or as we sometimes know it in Australia... deadly nightshade, due to its toxic effect when grazed by livestock.
The leaves and fruit are also toxic to humans.
This plant is easy to remove by hand. Either wear gloves, or wash your hands thoroughly following removal, preferably both.
Weed killer is unnecessary and most formulations are toxic to humans. Why replace one poison with another?
This website confirms it is a "Black Nightshade"
They grow green or deep purple berries which are poisonous to most animals. Leaves are also poisonous.
If you have any pet I recommend to pull it out with gloves or use a weed killer.