Re: [PHP] class constructor & polymorphism

2005-04-08 Thread Josip Dzolonga
[EMAIL PROTECTED] wrote:

Hi to all,
I'm a C++ programmer and I've to convert some simple classes
from C++ to PHP. My toolbar_button class must have two or more
constructors so I ask you if this is possible with PHP:
You can't overload a constructor, I mean a function in PHP.  Maybe 
extending two classes from the base would be a good work-around.

Hope this helps,
--
Josip Dzolonga
http://josip.dotgeek.org
jdzolonga[at]gmail.com
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] class constructor & polymorphism

2005-04-07 Thread silverio . di




Hi to all,
I'm a C++ programmer and I've to convert some simple classes
from C++ to PHP. My toolbar_button class must have two or more
constructors so I ask you if this is possible with PHP:

class toolbar_button
{
   CString m_name, m_tooltip, m_image, m_action;
   bool m_state, m_is_separator;

   toolbar_button(void) { /* my code here */ };
   toolbar_button(AnsiString name, bool state) { /* my code here */ };
   toolbar_button(toolbar_button *abutton) { /* my code here */ };

   
}

I'm using PHP 5.0.4 for Windows.
Thank you very much
Silverio

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