syntax - PHP: what is actually "parameter 1" in warnings?

18

This may be a basic PHP syntax question, but I could not get any results from search. So, in warning or error messages, what does actually "parameter 1" mean? Like in this example:

Warning: imagecopyresized() expects parameter 1 to be resource, integer given in ...

It is not to solve this special warning, but my question is, to what parameter 1 refers to. Is it imagecopyresized(parameter1,parameter2,...)? Or are these called arguments? I could not really understand the wikipedia article about parameters (http://en.wikipedia.org/wiki/Parameter_(computer_programming))

428

Answer

Solution:

imagecopyresized($a, $b, $c);

$a isparameter 1.$b isparameter 2,$c is ... well I think you got it.

7

Answer

Solution:

Yes, "parameter 1" refers to the first argument (aka parameter) that was passed to the function.

658

Answer

Solution:

The terms arguments and parameters are used interchangeably. Take a look at this php page which talks about them and you will notice they use both terms.

People are also looking for solutions to the problem: php - Validate a domain entity upon setting each property, or all at once later?

Source

Didn't find the answer?

Our community is visited by hundreds of web development professionals every day. Ask your question and get a quick answer for free.

Ask a Question

Write quick answer

Do you know the answer to this question? Write a quick response to it. With your help, we will make our community stronger.

Similar questions

Find the answer in similar questions on our website.