[Below, keeping your choice of metric signature (+,-,-,-)]
> t^2 - x^2 - y^2 - z^2
Off by a constant factor (c).
> distance = [above]
distance^2.
This is still not quite right since we're interested in how coordinate changes affect the spacetime interval. So take distance -> S, the spacetime interval instead of the Euclidean distance, and then sprinkle in the deltas: dS^2 = c dt^2 - dx^2 - dy^2 - dz^2. That is the Minkowski metric (the flat metric of special relativity) in Minkowski coordinates.
The right hand side can be positive (for a timelike spacetime interval), negative (for a spacelike spacetime interval), or zero (for a null spacetime interval). Massless particles, when not accelerated, travel on null spacetime intervals, as do other solutions of massless wave equations. Light is rarely accelerated. However a null interval does not mean no distance, it only means that there is an exact balance between the spacelike portion of the spacetime interval and the timelike portion of the spacetime interval. An object moving against the t and x coordinates at speed "c" will (choosing units for clarity) tick off one second along the t-axis for every light-second it travels along the x-axis. A timelike trajectory ticks off more than one second per light-second along the x-axis; and a spacelike trajectory ticks off fewer seconds per light-second along the x-axis.
So, with light always in inertial motion, and always moving at "c", the spacetime interval for an element of light (classical or quantum) will always be zero. That does not imply in any way that the element of light does not travel at all. Also it does not imply that if we split the spacetime interval into timelike and spacelike components, that we find that the photon experiences "no time".
The confusion arises frequently because the usual way one splits a timelike spacetime interval (e.g. for a massive particle) into its timelike and spacelike components is to use the proper time interval (and that leaves us with proper lengths). Proper time is a specific affine time which can be caluclated for non-null spacetime intervals, but not for null spacetime intervals. We can use a different affine time for those instead (leaving us with affine lengths that are not "proper lengths"). But even so there are changes in coordinates (e.g. (t=0,x=0)->(t=10,x=10); the photon is ten seconds older and ten light-seconds further away along x).
[Experts who already know about invariance under coordinate transformations etc. should also know not to pick too hard at that last sentence. The point is that if we do c \def = 1, then 1dt^2 - dx^2 = 0 for arbitrary photon displacements along x and this is true at least up to rescaling.]