I was wondering why php handles the scope of a declared function within a function differently when a function is declared inside a class function.
For example:
function test() // global function
{
function myTest() // global function. Why?
{
print( "Hello world" );
}
}
class CMyTestClass
{
public function test() // method of CMyTestClass
{
function myTest() // This declaration will be global! Why?
{
print( "Hello world" );
}
}
}
}
Can anybody explain this to me why this happen? Thank you for your answer.
Greetz.