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

//ads -- adsterra.com -- native banner
?>
I am making an adventure map but I have a problem.
For the testfor command I put /testfor @p [r=3]
but it doesn't work.
The command block says:
[13:13:15] Data tag parsing failed: Invalid tag encountered, expected '{' as first char.
I am using Minecraft version 1.8.8.
Best Answer
The Syntax is just a little bit wrong here's yours:
/testfor @p [r=3]
The Correct One:
/testfor @p[r=3]
Side Note: If your using /testfor @p[x=1,y=1,z=1,r=1]
with negative numbers, it won't work.
Pictures about "Problem with testfor command: "expected '{' as first char""



What replaced the Testfor command in Minecraft?
The /testfor command became obsolete in Minecraft 1.13, and has been replaced by the /execute command*. It will do the same as typing /testfor @e {SelectedItem:{id:"<item>"}} and then putting a comparator to the command block with the command, and then running the command which you wanna run.How do I use the Testfor player command?
How to Enter the CommandComparator Testfor Problem fix
Sources: Stack Exchange - This article follows the attribution requirements of Stack Exchange and is licensed under CC BY-SA 3.0.
Images: Brett Sayles, Andrea Piacquadio, RODNAE Productions, Karolina Grabowska