[PHP] Confused with constructors

2004-11-19 Thread Gerald Wharney
I'm trying the example at:

http://www.php.net/manual/en/language.oop.constructor.php

\n";
   }
   function B()
   {
   echo "I am a regular function named B in class
A.\n";
   echo "I am not a constructor in A.\n";
   }
}

class B extends A
{
   function C()
   {
   echo "I am a regular function.\n";
   }
}
// This will call B() as a constructor.
$b = new B;

?>

Running this on 4.3.9 both as an apache module and
from CLI I get:

I am a regular function named B in class A.
I am not a constructor in A.

This is contrary to what the manual says:

"This is fixed in PHP 4 by modifying the rule to: 'A
constructor is a function of the same name as the
class it is being defined in.'. Thus in PHP 4, the
class B would have no constructor function of its own
and the constructor of the base class would have been
called, printing 'I am the constructor of A.'."

Is this an error in the manual?
Or a bug in php 4.3.9?
Or just me being stupid?

-- 
G W (no bush)






___ 
ALL-NEW Yahoo! Messenger - all new features - even more fun! 
http://uk.messenger.yahoo.com

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



Re: [PHP] Re: Confused with constructors

2004-11-19 Thread Gerald Wharney
 --- Sebastian Mendel <[EMAIL PROTECTED]>
wrote: 

> as i understand it exactly as you, it must be a
> bug/error

OK, I see that it is a known issue:

http://bugs.php.net/bug.php?id=28459

thanks

-- 
G W (no bush)



___ 
Moving house? Beach bar in Thailand? New Wardrobe? Win £10k with Yahoo! Mail to 
make your dream a reality. 
Get Yahoo! Mail www.yahoo.co.uk/10k

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