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:
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
Subject: [PHP] How many copies


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";

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.

 Uros                          mailto:[EMAIL PROTECTED]

PHP General Mailing List (
To unsubscribe, visit:

PHP General Mailing List (
To unsubscribe, visit:

Reply via email to