当前位置:网站首页>Usage of PHP interview questions foreach ($arr as $value) and foreach ($arr as $value)
Usage of PHP interview questions foreach ($arr as $value) and foreach ($arr as $value)
2022-07-07 18:24:00 【Southern Song Dynasty x】
Interview questions :
<?php
$arr = [0,1,2,3,4];
foreach ($arr as &$val) {
// nothing
}
foreach ($arr as $val) {
// nothing
}
// What will be output
var_export($arr);
/********* ** answer :** *********/
array (
0 => 1,
1 => 2,
2 => 3,
3 => 8,
4 => 'a',
5 => 'a',
)
For detailed explanation, please refer to :
https://blog.csdn.net/smxdgf/article/details/105370166
边栏推荐
- 你真的理解粘包与半包吗?3分钟搞懂它
- JS pull down the curtain JS special effect display layer
- 简单几步教你如何看k线图图解
- More than 10000 units were offline within ten days of listing, and the strength of Auchan Z6 products was highly praised
- 云安全日报220707:思科Expressway系列和网真视频通信服务器发现远程攻击漏洞,需要尽快升级
- Youth experience and career development
- Deep learning - make your own dataset
- 磁盘存储链式的B树与B+树
- 讨论 | AR 应用落地前,要做好哪些准备?
- Afghan interim government security forces launched military operations against a hideout of the extremist organization "Islamic state"
猜你喜欢
[principle and technology of network attack and Defense] Chapter 1: Introduction
万字保姆级长文——Linkedin元数据管理平台Datahub离线安装指南
Chapter 3 business function development (user login)
Download, installation and development environment construction of "harmonyos" deveco
[principles and technologies of network attack and Defense] Chapter 5: denial of service attack
强化学习-学习笔记8 | Q-learning
【C语言】字符串函数
AI 击败了人类,设计了更好的经济机制
Mobile pixel bird game JS play code
简单几步教你如何看k线图图解
随机推荐
清华、剑桥、UIC联合推出首个中文事实核查数据集:基于证据、涵盖医疗社会等多个领域
Slider plug-in for swiper left and right switching
What skills can you master to be a "master tester" when doing software testing?
海量数据去重的hash,bitmap与布隆过滤器Bloom Filter
Tips for this week 140: constants: safety idioms
“解密”华为机器视觉军团:华为向上,产业向前
回归测试的分类
USB通信协议深入理解
How to open an account for wealth securities? Is it safe to open a stock account through the link
More than 10000 units were offline within ten days of listing, and the strength of Auchan Z6 products was highly praised
Wireshark分析抓包数据*.cap
强化学习-学习笔记8 | Q-learning
[principle and technology of network attack and Defense] Chapter 6: Trojan horse
[principle and technology of network attack and Defense] Chapter 1: Introduction
Click on the top of today's headline app to navigate in the middle
云景网络科技面试题【杭州多测师】【杭州多测师_王sir】
idea彻底卸载安装及配置笔记
Pro2: modify the color of div block
nest. Database for getting started with JS
Some key points in the analysis of spot Silver