views:

227

answers:

1
class One
{
  private function thisfn()
  {}
}
class Two
{
  private function thisfn()
  {}
}

is this legit? btw does it matter if it's a private/public function inside a class?

And also, can I create a new function named thisfn() outside of any class (and make it public)? like:

 function thisfn()
{}
+4  A: 

This is legit as long as you don't redeclare the same method name within the same class.

Declaring a function outside the scope of the classes with the same name is also valid.

cballou