You are here: Re: [PHP] Function Overloading « PHP « IT news, forums, messages
Re: [PHP] Function Overloading

Posted by David Tulloh on 12/19/05 01:57

PHP doesn't natively support function redefining.

Functions with variable length arguments are a different ballgame in
PHP. Have a look at func_num_args[1] and the other functions in the
"Function handling" section of the manual.

1: http://php.net/func_num_args


Labunski wrote:
> "PHP does not support function overloading."
> So, is there any other way of getting a number of parameters(variables)
> passed to a function?
>
> aka.
> function fruits($apple, $banana, $kiwi, $grape){
>
> #should (somehow) output 4
>
> }
>
> OK. if it was an array, than I could use count($array), but now I'm stuck!
>
> Thanks in advance!
>

 

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

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