Home > Backend Development > PHP Tutorial > 返回值设计的有关问题

返回值设计的有关问题

WBOY
Release: 2016-06-13 12:43:22
Original
822 people have browsed it

返回值设计的问题
问一下简单的问题
如果设计一个函数

操作失败 大家习惯返回 0 还是 false 还是 -1?

我习惯返回 -1

只是觉得好判定 
不过不知道具体哪个更好点

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template