php - 左大括号后的分号有什么作用
问题描述
我很难找出这个分号的目的是什么for (;
。我在网上的搜索只带来了不相关的结果。有人可以解释一下吗?
for (; $this->foo <=10; $this->foo++) {}
解决方案
这基本上跳过了迭代器变量的初始化。通常你会输入这样的内容:
for ($i = 0; $this->foo <= 10; $i++) {}
但是,在您的示例中,您访问的对象$this
只是将 foo 累加了 1;
推荐阅读
- python - numpy 中是否有一种方法可以验证一个数组是否包含在另一个数组中?
- twilio - Twilio Flex,拦截传入消息以发送 Slack 通知
- python - PyCharm 和 IDLE 中内存利用率的差异
- laravel-6.2 - 输入名称而不是用户 ID
- c# - Entity Framework Core 中的数据库独立性
- c# - 如何从 iis 上上传的 c# 代码将文件上传到谷歌云存储
- python - 用 two_datetime 转换两种格式的时间戳
- python - 在python中大写而不用小写字符串
- office-js - 使用带有 typescript 的 VSCode 的 OfficeJS 的 IIS 部署和托管
- laravel - 响应必须是社交名媛 Facebook 上的字符串