Home  >  Article  >  Backend Development  >  array_push PHP array_push array function

array_push PHP array_push array function

WBOY
WBOYOriginal
2016-07-29 08:41:321299browse

1.
$arr = array();
$arr[] = '';
2.
$arr = array();
array_push($arr,'');
Just did a 100000 times loop insertion, The result is that the first one is faster! (Loop to insert numbers, 100,000 times, the first type is about 0.04 seconds, the second type is about 0.08 seconds)

The above introduces the array_push PHP array_push array function, including the content of array_push. I hope it will be helpful to friends who are interested in PHP tutorials.

Statement:
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