I'm currently reading php & mysql web development. I was wondering, how do you know which kind of parameter that pass(type .. int, string, array, etc) Let's say you have included some library that contains the following function function foo($prices) { for($i=0;$i<count($prices);$i++) { echo $prices[$i]; } } How do you know that the function must take an array ? A user could easily pass a string or an int .... isn't there a problem there? EDIT: Another question ... how do you know what type of variable is returned from a function call? you might want a function to return an array of int .. but instead ... it returns a string ...??