我在PHP7中看到了以下新行,但没有人真正解释它的含义。我用谷歌搜索了它,他们谈论的只是你会启用它还是不喜欢投票类型的东西。declare(strict_types=1);它有什么作用?它如何影响我的代码?我应该这样做吗?解释一下就好了。 最佳答案 来自Treehouseblog:WithPHP7wenowhaveaddedScalartypes.Specifically:int,float,string,andbool.Byaddingscalartypehintsandenablingstrictrequirements,iti
我在PHP7中看到了以下新行,但没有人真正解释它的含义。我用谷歌搜索了它,他们谈论的只是你会启用它还是不喜欢投票类型的东西。declare(strict_types=1);它有什么作用?它如何影响我的代码?我应该这样做吗?解释一下就好了。 最佳答案 来自Treehouseblog:WithPHP7wenowhaveaddedScalartypes.Specifically:int,float,string,andbool.Byaddingscalartypehintsandenablingstrictrequirements,iti