You are here: Re: Object Oriented PHP « PHP Programming Language « IT news, forums, messages
Re: Object Oriented PHP

Posted by Tony Marston on 06/25/06 08:30

"Jerry Stuckle" <jstucklex@attglobal.net> wrote in message
news:4K2dnSM18oD9YQDZnZ2dnUVZ_oWdnZ2d@comcast.com...
> David Haynes wrote:
>> Jerry Stuckle wrote:
>>
< snip >

> I really don't know how hard it would be to add - but I would like to see
> it added. One thing I don't like all that much is the untyped variables.
> It makes things "easy" - but leads to some sloppy programming.
>
> It also means you can't overload functions - at least not with the same
> number of parms. Typing the constructor arguments is a good start. But
> expanding that to other functions without breaking existing code might be
> more difficult.

You don't need function overloading in PHP. Why? First you need to look at
why other languages need it:
(a) To accept arguments of different types.
(b) To make some arguments optional.

With PHP you can accept an argument of any type and then cast it to the one
you want, so item (a) is irrelevant.

With PHP you can define a default value for an argument if it is not
supplied, so item (b) is irrelevant.

--
Tony Marston

http://www.tonymarston.net
http://www.radicore.org

 

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

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