SyntaxFix
Write A Post
Hire A Developer
Questions
It means one of your arrays isn't actually an array.
By the way, your if check is unnecessary. If $varsCount is 0 the for loop won't execute anyway.