Home > Backend Development > PHP Tutorial > 为什么此段PHP foreach 时打印的值是这样? (2)

为什么此段PHP foreach 时打印的值是这样? (2)

WBOY
Release: 2016-06-06 20:11:49
Original
944 people have browsed it

 为什么此段PHP foreach 时打印的值是这样?  (2)

输出为int(1) int(1) int(1)
为何?求解谢谢

这个问题已被关闭,原因:与已有问题重复

回复内容:

 为什么此段PHP foreach 时打印的值是这样?  (2)

输出为int(1) int(1) int(1)
为何?求解谢谢

foreach每次循环创建一个新的变量保存当前原始,并未改变$a的实际下标

Related labels:
c php
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