[SOLVED]What type of values can you pass as an argument...

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
User avatar
figaro11
Forum Commoner
Posts: 64
Joined: Mon Sep 17, 2007 11:49 pm

[SOLVED]What type of values can you pass as an argument...

Post 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. :D
Last edited by figaro11 on Wed Oct 03, 2007 12:58 pm, edited 1 time in total.
User avatar
John Cartwright
Site Admin
Posts: 11470
Joined: Tue Dec 23, 2003 2:10 am
Location: Toronto
Contact:

Post by John Cartwright »

You can pass anything you wish to a function or method.
User avatar
figaro11
Forum Commoner
Posts: 64
Joined: Mon Sep 17, 2007 11:49 pm

Post 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";
});
?
User avatar
John Cartwright
Site Admin
Posts: 11470
Joined: Tue Dec 23, 2003 2:10 am
Location: Toronto
Contact:

Post by John Cartwright »

I don't understand what you are asking.

What have you tried? Examples?
User avatar
figaro11
Forum Commoner
Posts: 64
Joined: Mon Sep 17, 2007 11:49 pm

Post 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.
Post Reply