Page 1 of 1

can arrays have functions/methods in them?

Posted: Thu Jul 24, 2008 3:20 pm
by dhinge
I got a strangely worded job quiz today. It says:

Write a PHP5 object whose instantiation creates an array (which is a property of that object) that contains a bunch of values.
The Display method of the property should output that array so that each element would appear on a different line on an HTML page.

This sounds like it's saying that "Display" is a method of the array... does that make any sense? Can arrays have methods? Or did they word it weird?

Re: can arrays have functions/methods in them?

Posted: Fri Jul 25, 2008 7:04 pm
by ghurtado
You are right, it is worded weird. I would assume they meant "the display method of the object"