On Wed, 2004-04-07 at 17:07, Richard Lewis wrote:
> What do members think that this code should do:
>
> class A
> {
> var $a, $b;
> function A($a)
> {
> $this->$a = $a;
> }
> function prnt()
> {
> echo "a=" . $this->$a;
> }
> }
>
> class B extends A
> {
> function B($a, $b
Just noticed a small glitch in the attach() method - check_object will not
be called for the first object. Use this attach() / check_object()
implementation instead. The "var $class" instance variable of CTeeObject
can be omitted.
function attach(&$hObj) {
if (!$this->check_object($hObj))
At 08:39 01.06.2003, Jackson Miller said:
[snip]
>Is it possible to reference two instances of an object at once with a
>single variable name while retaining the ability to reference the
>objects seperately?
[snip]
No
On Sat, 1 Jun 2003, Jackson Miller wrote:
> Is it possible to reference two instances of an object at once with a
> single variable name while retaining the ability to reference the
> objects seperately?
No chance. Well, you could hack it with some really fancy object
overloading, but in general,
"Scott Hurring" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Depends ;-)
yea, really depnds, but as you mentioned, having parameterless
constructors are more generic, especially when it comes to derive the
classes.
>
> instead (with option #2), you could
On Wed, Jun 05, 2002 at 10:32:39PM +0100, Henry Blackman wrote:
> Do I create a new document and pass the primary key as it's a variable in
> the
>
> $document = new Document(number);
>
> and have the constructor retrieve the appropriate data from MySQL and fill
> the attribute variables.
>
> O
Depends ;-)
I'd say that the second way is probably "best", becuase
it avoids implied behaviour, which sometimes can cause
problems (lets say you want to init. a document object,
but not get anything from the DB). If you want to create
a brand new Document, obviously it won't be in the DB
alread
On Mon, Mar 19, 2001 at 01:58:39PM -0500, Altunergil, Oktay wrote:
> As far as I know a class can extend multiple classes. What you can't do -in
> PHP- is two create a class that inherits from multiple parent classes
> (multiple inheritence). I believe this is available in C++ and Java and
> othe
As far as I know a class can extend multiple classes. What you can't do -in
PHP- is two create a class that inherits from multiple parent classes
(multiple inheritence). I believe this is available in C++ and Java and
others. I also think the reason it is not available in PHP is because
inheriting
9 matches
Mail list logo