You are here: Re: [PHP] constructors in PHP « PHP « IT news, forums, messages
Re: [PHP] constructors in PHP

Posted by "Richard Lynch" on 07/12/05 09:05

On Mon, July 11, 2005 10:04 am, Alessandro Rosa said:
>> > As far as I know, its not a security issue, but a structure/design
> issue.
>>
>> The issue is that in php you can't definitely say what type a variable
>> is , whereas in c++ you can say this variable is a string, this one a
>> int, ….
>
> But, right because PHP is weakly typed, multiple constructors could be
> handled easier, I suppose ... isn't true?

It wouldn't be any easier/harder, really...

Your method/function definition would still have specific data types it
expected to receive.

Your function call would still know what data types it is dealing with,
and would call the right one.

Actually, it's a bit "harder" in weakly-typed languages, as the
interpreter has to do more work at the instant the function is called, to
determine what types are used. In C++, you're the compiler *KNOWS* what
the types are at compile time.

--
Like Music?
http://l-i-e.com/artists.htm

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация