0

Just curious, using LAMP.

In the following

public function zhou(array $shenme){

}

What is the purpose of "array" there?

Cheers

Jason

2 Answers 2

1

It is Type Hinting (EN) or Tipos Sugeridos (ES) as explained in the manual.

Sign up to request clarification or add additional context in comments.

Comments

1

In php you can force a function parameter to be of a certain class. In this case it must be an array. Keep in mind that you can only do this for class names and array not string or boolean or integer.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.