can arrays have functions/methods in them?

Ye' old general discussion board. Basically, for everything that isn't covered elsewhere. Come here to shoot the breeze, shoot your mouth off, or whatever suits your fancy.
This forum is not for asking programming related questions.

Moderator: General Moderators

Post Reply
dhinge
Forum Newbie
Posts: 12
Joined: Mon Jan 08, 2007 1:56 pm

can arrays have functions/methods in them?

Post 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?
User avatar
ghurtado
Forum Contributor
Posts: 334
Joined: Wed Jul 23, 2008 12:19 pm

Re: can arrays have functions/methods in them?

Post by ghurtado »

You are right, it is worded weird. I would assume they meant "the display method of the object"
Post Reply