0

In php 7+ when I use string parameters , the correct way its String or string

 public function my_function(string $parameters):string{

       return "foo";
 }

or

 public function my_function(String $parameters):String{

       return "foo";
 }
1

1 Answer 1

0

In PHP there is no difference between String and string on definitions.

Most common is the second, string

$stringValue = "Hello world";
echo gettype($stringValue);
string
Sign up to request clarification or add additional context in comments.

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.