[PHP]PHP中申明 declare(strict_types=1)的作用

strict_types=1 针对参数类型开启严格模式,进行数据类型检验,默认是弱类型校验
哪个文件写了declare,哪个文件中的所有代码就需要检查

declare(strict_types=1);
 
function  foo():int{
    return 1.11;
}
 
echo foo();

原文地址:https://www.cnblogs.com/taoshihan/p/12291363.html