I think this question is kinda dumb and maybe its already asked somewhere.
I came across this problem many times before and because of my lack of knowledge i couldnt go over it.So I'm asking now how is it possible.
PHP Code:
public asd()
{
if(smth == 1)
{
a++
}
public adf()
{
if(a == 2) // line X
{
...
}
Of course on line X it will bring up error for undefined symbol and if i define it in adf() it will not have the same value as asd().
If i define it out of the both functions, again it will ot have the same value.