You are here: Passing an array as a reference to a function « PHP Programming Language « IT news, forums, messages
Passing an array as a reference to a function

Posted by Bit Byte on 10/10/06 13:43

Noobie here (C++/C/Java experience though) ...

Recently picked up PHP ...

I want to pass an array to a function and then to use count on the
passed variable - is this the way to do it (its an object method) :

public function foo(array& $arr)
{
if (count($arr) < 1)
throw new MyException("Blah blah ...") ;
....
}


I have two questions for the pros:

1). Is the function signature correct (valid syntax?)
2). Can count accept a reference type variable ?

 

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

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