You have it defined somewhere else prior to the else-if block. Show the full function.
As a general 'lesson', whenever you're unsure whether there's a bug in the compiler or not, it's good to run a simple code through it:
PHP Code:
public x()
{
new y, z
if(z) { new var; }
else if(y) { new var; }
}
Compiles fine.