Whaaat? You can do that?! You need phototransistors or photodiodes silly! Turns out, you don’t. IT’S A CONSPIRACY!
Seriously though, LEDs can be used as photo detectors. It’s not as simple as using a proper photodiode, but it’s a pretty neat trick and can save you a few parts if you’re working on a budget.