Water – Is this T&P relief valve discharge pipe installed correctly

code-compliancewater-heater

I had a plumber install a new water heater the other day, and he said it's up to 2018 (US) code, but I've been wondering if the T&P relief valve discharge pipe really is correct, because it seems to me like discharge pipes shouldn't flow upwards:

discharge pipe

The hole in the wall that the discharge pipe goes out of is the one used by the original water heater's pipe, and I don't know why they made it so high – I'm guessing because there's not a lot of room in this corner of my garage and they needed the pipe to go above the water heater.

Best Answer

Illegal. Your photo shows a TPV outlet pipe with a trap. Last I checked, UPC 608.5 says "No part of such drain pipe shall be trapped ..."
Similarly, IPC (2012) 504.6 (8) Discharge piping serving a TPV shall "Not be trapped."