One has to decide first what exactly we call philosophy. The meaning of this term substantially changed with time. There was a time when all people doing mathematics and sciences could be called philosophers, and what they were doing could be called philosophy.
(That the scientific degree in physics and mathematics still called PhD in many countries,
is a reminder of that time).
Evidence shows that this practice only ended in the early 19-th century.
The modern meaning of "philosophy" can be roughly defined as "speculations on those matters which are not covered by exact science". So with this definition, the area of philosophy shrinks with time.
On my opinion, philosophy ends just where the science begins. For example, physics was a part of philosophy until Descartes (including him, but not including Galileo), but since the time of Newton, it is firmly science, not philosophy.
After that transition, philosophy
either stops discussing the subject, or continues, in which case its influence is usually harmful.
Examples: Aristotle's philosophy which Galileo and Kepler had to fight. Attacks of philosophers like E. During on Riemann, non-Euclidean geometry and n>3 dimensional spaces.
Attacks of philosophers like E. Mach on atomic theory and statistical mechanics, and so on.
On the positive side I can mention Bolzano, Frege and Russell, who were probably the last mathematicians who were also called philosophers. These were the last examples in mathematics, I guess. (In physics, Einstein was apparently somewhat influenced by philosophy of Hume and perhaps Mach).
Mathematics actually separated from philosophy earlier than other sciences: this happened probably at the time of Plato. His contemporaries like Eudoxos and Theaetetus were already mathematicians, not philosophers, when they wrote about mathematics.
Another matter is that sometimes mathematicians and physicists use the word philosophy for
the kind of speculations in their sciences which are not rigorous. Examples: Complementarity Principle (Bohr), Bloch's Principle, Continuity Principle (in mathematics), etc., or to take an older example, that "the Nature abhors the vacuum". But this is different from philosophy done by professional philosophers.