当前位置:网站首页>解决PHP提示Warning: Division by zero in错误
解决PHP提示Warning: Division by zero in错误
2022-07-28 11:24:00 【历史老师-】
原因:division by zero 是"除数是0"导致的错误
1、解决方法、运行前判断 如果除数为0,则不要计算(推荐)
if ($divisor!= 0) {
$subTime = round($cutTime / $divisor);
}
2、使用@符号 屏蔽掉错误。
最好不要使用,使用@是非常糟糕的编程习惯,因为它不会使错误消失,它只是隐藏它们,并且它使调试变得更糟,因为我们无法看到我们的代码实际上有什么问题。
边栏推荐
- 15. User web layer services (III)
- Saltstack command injection vulnerability analysis (cve-2020-16846)
- ObjectAnimator使用注意点
- Character function and string function (Part 1)
- Introduction to the usage of SAP ui5 image display control avatar trial version
- Specific functions of some multi parameter functions
- 瑞吉外卖——Day01
- async await如何实现并发
- Static proxy instance
- DNS series (III): how to avoid DNS spoofing
猜你喜欢

Lyscript get previous and next instructions

Training mode and practice of digital applied talents in Colleges and Universities under the integration of industry and education

Pycharm debugging mode

Untiy中控制Animation的播放速度

Lua 中 __index、__newindex、rawget、rawset的理解

从0开发一个自己的npm包

Deployment and use of Minio distributed object storage

STL concept and its application

Untiy controls the playback speed of animation

Introduction to the usage of SAP ui5 image display control avatar trial version
随机推荐
Loongarch Godson architecture document collection
Redis安装
Some knowledge concepts
Hcip (condition matching and OSPF packet related knowledge)
Modify the running container port mapping
15、用户web层服务(三)
WebView details
P5472 [NOI2019] 斗主地(期望、数学)
DNS series (III): how to avoid DNS spoofing
Upgrading of computing power under the coordination of software and hardware, redefining productivity
Idea replication module
OSCache cache monitoring Refresh Tool
Lua对table进行深拷贝
Globalthis is not defined solution
Service Workers让网站动态加载Webp图片
15. User web layer services (III)
从零开始Blazor Server(2)--整合数据库
Hcip day 1
Traversal and copy of files in jar package
301. Delete invalid brackets