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]
|