`f` in your example is a global function that cannot be redefined.
It's really that simple.
function f($x) { return $x*$x; }
...in your code, you know that you can always call f() to get the square of something. Hallelujah. Functions as they are meant to be.