The ending of Martin Scorsese’s Taxi Driver is widely believed to take place in Travis Bickle’s imagination in his dying moments, but that doesn’t necessarily reflect the filmmakers’ intentions. Taxi Driver stars Robert De Niro as Travis, a Vietnam War veteran with PTSD and insomnia. After returning from Vietnam, driving a cab around New York, and being disgusted by the rampant crime on the streets of his city, Travis decides to take the law into his own hands. This vigilante crusade culminates in a deadly shootout at a brothel where Travis attempts to save 12-year-old sex worker Iris.
https://screenrant.com/taxi-driver-is-travis-bickle-dead-at-end/