Answer: Doctor Who

Although the idea of virtual reality serving as an alternative to our reality is a common trope in movies and television shows these days, decades ago, it was less frequently used and, in fact, didn’t make an appearance in television until 1976.

In the 1976 Dr. Who story arc “The Deadly Assassin”, writers introduced a dream-like and computer-generated alternate reality known as, in a rather juicy bit of foreshadowing, The Matrix. Within the story line, The Matrix was a huge electronic neural network which turned a user’s thought patterns into reality. Users entered the Matrix via a device connected to, or enclosing their head (or physically, via special doors into which the user walked) and the massive computer system they stepped into was a giant repository of the combined knowledge of all the Time Lords.

Everything within The Matrix was an illusion created in part by the user’s mind and in part by the computers controlling the network. Although users were not physically in The Matrix (unless they entered through one of the special doors), if they died within the illusions created by it, then they died in real life.

In another interesting bit that foreshadowed the plot of future virtual-reality based stories, the Doctor’s enemies found that they could not best him in the virtual environment, so they sent someone to kill him while he was plugged into The Matrix.

A bit of bonus trivia: “The Deadly Assassin” series is the only televised classic Doctor Who series in which the Doctor did not have a traveling companion. Scriptwriters have noted that it was very difficult to write the scripts for the story arc since the Doctor lacked a companion to share his thoughts and plans with.