Home > Backend Development > PHP Tutorial > PHP的sizeof和count有什么区别

PHP的sizeof和count有什么区别

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
Release: 2016-06-06 20:51:34
Original
1634 people have browsed it

我看到很多代码里,计算数组大小的时候有人用count,有人用sizeof,这两个函数有什么区别?
功能上和性能上

回复内容:

我看到很多代码里,计算数组大小的时候有人用count,有人用sizeof,这两个函数有什么区别?
功能上和性能上

无区别,手册上是这么说的

sizeof — Alias of count()

没有区别,sizeof是count的别名,所以你懂得:性能和功能都是一样的。。

Related labels:
php
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
Latest Issues
php data acquisition?
From 1970-01-01 08:00:00
0
0
0
PHP extension intl
From 1970-01-01 08:00:00
0
0
0
How to learn php well
From 1970-01-01 08:00:00
0
0
0
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template