Page 1 of 1
[SOLVED]What type of values can you pass as an argument...
Posted: Wed Oct 03, 2007 12:02 pm
by figaro11
What type of value can you pass as an argument to a function, in php? I believe JavaScript has a more flexable variety then php, but I'm not sure.
That's pretty much all I'm asking. I don't want to get into to much detail, otherwise I might become unclear.
Thanks for reading.

Posted: Wed Oct 03, 2007 12:09 pm
by John Cartwright
You can pass anything you wish to a function or method.
Posted: Wed Oct 03, 2007 12:15 pm
by figaro11
Jcart wrote:You can pass anything you wish to a function or method.
Would that include a function value, such as javascript can:
Code: Select all
myCustumFunction(function () {
echo "whatever";
});
?
Posted: Wed Oct 03, 2007 12:17 pm
by John Cartwright
I don't understand what you are asking.
What have you tried? Examples?
Posted: Wed Oct 03, 2007 12:23 pm
by figaro11
Jcart wrote:I don't understand what you are asking.
What have you tried? Examples?
Your right. What would be the use of passing functions in php. It's more useful in javascript because functions are, in a way, objects.
Unless it's possible to pass functions in php, I still don't see a reason to do so.
Again, functions aren't values in php, like they are in javascript.