鍍金池/ 問答/PHP/ 為什么php -rf <函數(shù)名>, 在有些php函數(shù)上卻找不到相關(guān)信

為什么php -rf <函數(shù)名>, 在有些php函數(shù)上卻找不到相關(guān)信息?

當(dāng)我在命令行下,使用php -rf is_array 的命令, 能夠打印出相關(guān)的is_array的信息, 但當(dāng)我使用同樣的方式,想獲取isset函數(shù),empty函數(shù)的相關(guān)信息, 卻顯示了isset函數(shù)不存在,empty函數(shù)不存在;

 C:\Users\longxiangde>php --rf is_array
Function [ <internal:standard> function is_array ] {

  - Parameters [1] {
    Parameter #0 [ <required> $var ]
  }
}

C:\Users\longxiangde>php --rf empty
Exception: Function empty() does not exist


C:\Users\longxiangde>php --rf isset
Exception: Function isset() does not exist
    

請(qǐng)問,php -rf 能夠打印出哪類的函數(shù)呢? 謝謝了!

回答
編輯回答
莓森

empty,isset不是函數(shù)

2017年5月20日 16:54
編輯回答
脾氣硬

isset、empty是語言結(jié)構(gòu)

/Zend/zend_language_parser.h
/* Tokens.  */
#define T_EMPTY 359
#define T_ISSET 358
/Zend/zend_language_parser.y
T_EMPTY '(' expr ')' { $$ = zend_ast_create(ZEND_AST_EMPTY, $3); }
T_ISSET '(' isset_variables ')' { $$ = $3; }

is_array是位于核心擴(kuò)展standard中的內(nèi)部函數(shù)

/ext/standard/type.c
PHP_FUNCTION(is_array)
{
    php_is_type(INTERNAL_FUNCTION_PARAM_PASSTHRU, IS_ARRAY);
}
2017年11月16日 11:23