【问题标题】:Is there anything similar to the pass keyword from python in php [duplicate]php中是否有类似于python中的pass关键字的东西[重复]
【发布时间】:2021-08-25 05:52:23
【问题描述】:

如果我想忽略 python 中的某些内容,我通常只输入 pass

例子

if a > b:
   pass

我如何在 php 中做类似的事情?

【问题讨论】:

标签: php


【解决方案1】:

不需要类似的东西。

https://www.w3schools.com/python/ref_keyword_pass.asp 状态:

当 pass 语句被执行时,什么也没有发生,但是你避免 不允许空代码时出现错误。空代码不 允许在循环、函数定义、类定义或 if 中 声明。

但在 PHP 中允许使用空代码。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2020-04-23
    • 2014-08-16
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2011-06-03
    • 1970-01-01
    相关资源
    最近更新 更多