hi

have look at this code:

class test {
  function test(){
     //$this->a = 10;
     print_r($this);
  }

  function test2(){
     print_r($this);
  }
}

$t=new test();
$t->test2();

what do you see? empty object twice...
now uncomment the commented line. now the object got a variable - which is
quite unusual, because what`s the reason for declaring them with var keyword
except nice looking code? i uderstand on-the-flight creation of local
variables, but class variables? hmmmmm... can someone explain the reason of
enabling this possibility?

rash




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to