Re: [PHP-DEV] Object Constructors in PHP

2001-04-05 Thread Carsten Gehling

From: "Steven Roussey" <[EMAIL PROTECTED]>
Sent: Friday, April 06, 2001 2:19 AM
Subject: [PHP-DEV] Object Constructors in PHP


> Don't ask why it is this way, but say we have these files:



Bad bad BAD programmer! Go to your corner. :-)

> It runs fine printing 'hi' (though not with APC, but fine with Zend
Cache).
>
> BUT, What _should_ happen?

You mean from a PHP perspective or from an OOP perspective?

Your example runs as expected. The contructur Outline_ForumStyle() calls the
inherited method ForumStyle(). Nothing wrong with that.

I think what would be more interesting is, what happens if you instantiate
ForumStyle?

$f = new ForumStyle();

>From an OOP POV, there is no contructor, so nothing should happen. PHP OTOH
recognises the inherited method ForumStyle() as having the same name as the
class, thereby making it a contructor.

Not good IMHO, but i think it stems from the fact that PHP does not have a
keyword for explicitly defining contructors, like you find in Java or C++.

One of the areas in PHP that still need some work is IMHO the OOP area. Some
things are a bit too loosly defined - even for a script language.

- Carsten



-- 
PHP Development Mailing List <http://www.php.net/>
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP-DEV] Object Constructors in PHP

2001-04-05 Thread Steven Roussey

Don't ask why it is this way, but say we have these files:

::
inc1.php
::

::
inc2.php
::

::
inc3.php
::
ForumStyle();
}
}

?>
::
test.php
::
http://network54.com/?pp=e


-- 
PHP Development Mailing List 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]