For the first question: Will this work?
In class A, you wont get anything when you use $this->bar if the class
hasn't been instantiated.

besides that fact, you'll should get the output of:
settig:bar+foo
if you call A::foo();

As for the second question: How many times A will be made
answer: zero time - you're not instantiating it anywhere


-----Original Message-----
From: Uros Gruber [mailto:[EMAIL PROTECTED]]
Sent: Thursday, June 20, 2002 7:02 PM
To: [EMAIL PROTECTED]
Subject: [PHP] How many copies


Hi!

my example

class A {
  var $bar = "bar";
  function set($data) {
    echo "settig:" .$data;
  }

  function foo() {
    B::get($this->bar) ;
  }
}

class B {
  function get($bar) {
    $bar = $bar . "+foo";
    A::set($bar);
  }
}

My question is. Will this work and how many time class A will
be made. one or 2 times. And is it possible to use properties
from class A in funstion set if i call it from class B, how
do i reference to it.

-- 
lp,
 Uros                          mailto:[EMAIL PROTECTED]


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

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

Reply via email to