I'll start with the confession: I'm not going to read all of Book 7 of the Kitab al-Manazir. Experimental papers are best read when they have the diagrams on the same pages as the main text, not when you have to flip around constantly to find diagrams and tables. Not to mention that he got a lot of stuff wrong, and according to the translator's preface he probably didn't do all of the experiments that he described. But I did want to see if he presaged the Principle of Least Time.
So I read the translator's preface. One fascinating tidbit is that Ibn al-Haytham did measurements of the effect of refraction in the atmosphere on the apparent positions of stars near the horizon. That was pretty amazing. He was able to show that the atmosphere refracts light, implying that its optical properties are different from the more distant medium separating the earth from the celestial sphere that they believed the stars inhabited. I didn't know that.
The translator mentioned a discussion of "easiest paths" at the end of chapter 2, so I read the first two chapters. I skimmed the experimental section because (as I said above) it's hard to read. I did carefully read the theoretical discussion in the last few pages, and it is definitely interesting. Ibn al-Haytham thinks of refraction as occurring because the light encounters difficulty in piercing an interface, and we know that when chopping wood it is easiest to piece the wood if the ax strikes it perpendicularly rather than at a glancing angle. He talks about breaking up motion into components perpendicular and parallel to the interface, and if the perpendicular component is small then it is difficult to pierce the interface. In Ibn al-Haytham's view, when light encounters a denser medium (higher index) light tries to incline toward an easier direction. There's a vague concept of a "path of least resistance" in here, but he doesn't actually use the word "path." Rather, he talks about the direction that is easiest to move in. That is a purely local description of the dynamics of the light (whether it's a ray or particle), based entirely on things that happen at the interface. Likewise, the rest of the discussion involves only the interfaces, components of motion at interfaces, and analogies to mechanical phenomena that involve changes in motion at interfaces. Fermat's Principle of Least Time, on the other hand, is a global principle, one that involves a consideration of the entire path that light will take from one location to another. There's no hint of a global principle here.
Also, he has a much fuzzier explanation of what happens when you go from a high-index medium to a low-index medium. There's no principle of time-reversal here.
Now, I haven't read any of Fermat's work. I don't know if he read Ibn al-Haytham. Maybe he really liked Ibn al-Haytham's idea about picking a direction that makes motion easier and then generalized it to a global principle. Maybe not. I don't know. What I do know is that there's no hint of the Principle of Least Time in Ibn al-Haytham's work, because the Principle of Least Time is (1) global rather than local and (2) based on a model of a medium-dependent speed rather than a medium-dependent resistance. The second point is less important, because I'm drawing a distinction that isn't really salient until you appreciate inertia and the fact that light doesn't have mass (not points that are required to do important things in an optics class) but still, I see none of the seeds of Fermat's work here.
Sorry to be the bearer of bad news.
DISCLAIMER: I only read a translation of the Latin text. Maybe the Arabic text has something better. However, the translator noted a number of errors in the translation from the original Arabic text to the Latin edition, and this section wasn't mentioned. Barring some additional evidence from a historian who knows medieval Arabic I consider it very unlikely that Ibn al-Haytham can be credited with the Principle of Least Time.