On Monday 02 March 2009 20:50:56 Sancar Saran wrote:
> Hello list.
>
> I'm trying to implement someting on OO way.
>
> I got 2 classes
>
> class a {
>   var $config = array();
>   var $b = '';
>
>   function  __construct {
>    $this->b = new b($this->config);
>  }
>
> }
>
> class b {
>   var $config = array();
>   function foo() {
>     switch($this->config['bar']) {
>
>    }
>   }
> }
>
>
> some where in class a
>
>
>
> and when I call
>
> $bar = new a();
>
> $bar->b->foo();
>
> I got
>
> Fatal error: Using $this when not in object context in
>
> Could you givme some clue what is wrong ?
>
>
> I'm using Ubuntu and PHP 5.2.0-8+etch13
>
> Regards
>
> Sancar


Sorry guys. My Bad

for this kind of operations. method must not be static.


Sancar

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

Reply via email to