Re: constructors in PHP

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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

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


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux