当前位置:网站首页>解决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、使用@符号 屏蔽掉错误。
最好不要使用,使用@是非常糟糕的编程习惯,因为它不会使错误消失,它只是隐藏它们,并且它使调试变得更糟,因为我们无法看到我们的代码实际上有什么问题。
边栏推荐
- Full resolution of the use of go native plug-ins
- Unity 一键替换场景中的物体
- Upgrading of computing power under the coordination of software and hardware, redefining productivity
- A natural choice
- Distributed system (III) construction of distributed transaction service
- Hcip day 6 (OSPF related knowledge)
- 从零开始Blazor Server(2)--整合数据库
- php⽉份加减最简单的处理⽅法
- Matlab sets the size of graphics window and image and the position of legend
- Direct insert sort and Hill sort
猜你喜欢

Play with poetry - appreciate the beauty of ancient poetry

Lua makes a deep copy of table

Distributed system (III) construction of distributed transaction service

An example of the mandatory measures of Microsoft edge browser tracking prevention
![[pyGame practice] the super interesting bubble game is coming - may you be childlike and always happy and simple~](/img/3b/c06c140cd107b1158056e41b954e2e.png)
[pyGame practice] the super interesting bubble game is coming - may you be childlike and always happy and simple~

"Weilai Cup" 2022 Niuke summer multi school training camp 2

Gecko competition 2.0 is new! Come and show your flexible operation skills!

Service workers let the website dynamically load webp pictures

Reasons and solutions for moving the first column to the last column in El table

Will PFP be the future of digital collections?
随机推荐
tolua之wrap文件的原理与使用
STL の 概念及其应用
Upgrading of computing power under the coordination of software and hardware, redefining productivity
Alexnet - paper analysis and reproduction
Final modifier attribute
2022.07.10 summer training personal qualifying (V)
OSCache cache monitoring Refresh Tool
使用百度飞桨 EasyDL 完成垃圾分类
How is the JS code compiled and executed by the browser engine?
The reflect mechanism obtains the attribute and method information of class
Unity one key replacement of objects in the scene
ES6 knowledge points supplement
Opencv notes sorting [Hough transform]
Specific process of strong cache and negotiation cache
配置Jupyter远程服务器
Use Baidu PaddlePaddle easydl to complete garbage classification
中国业务型CDP白皮书 | 爱分析报告
Application of mobile face stylization Technology
Hcip (configuration of GRE and mGRE and OSPF related knowledge)
Anonymous implementation class object of interface