Problem with testfor command: "expected '{' as first char"

Solution 1:

Your problem is the space between @p and [r=3].

Try the following command:

/testfor @p[r=3]