【问题标题】:String parameters case on phpphp上的字符串参数大小写
【发布时间】:2021-08-05 21:30:24
【问题描述】:

php 7+中,当我使用字符串参数时,正确的方法是Stringstring

 public function my_function(string $parameters):string{

       return "foo";
 }

 public function my_function(String $parameters):String{

       return "foo";
 }

【问题讨论】:

标签: php


【解决方案1】:

在 PHP 中,Stringstring 在定义上没有区别。

最常见的是第二种,string

$stringValue = "Hello world";
echo gettype($stringValue);
string

【讨论】:

    猜你喜欢
    • 2015-11-08
    • 2017-11-27
    • 1970-01-01
    • 2019-08-04
    • 1970-01-01
    • 2016-01-25
    • 1970-01-01
    • 1970-01-01
    • 2012-07-20
    相关资源
    最近更新 更多