RE: [PHP] How many copies
| From: | Martin Towell | Date: | Thu, 20 Jun 2002 23:23:34 +0000 |
| Subject: | RE: [PHP] How many copies | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-103214@lists.php.net to get a copy of this message | ||
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:uros@sir-mag.com]
Sent: Thursday, June 20, 2002 7:02 PM
To: php-general@lists.php.net
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:uros.gruber@sir-mag.com
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php