示例#1
0
Variant f_func_get_args() {
  EagerCallerFrame cf;
  ActRec* ar = cf.actRecForArgs();
  if (ar && ar->hasVarEnv() && ar->getVarEnv()->isGlobalScope()) {
    raise_warning(
      "func_get_args():  Called from the global scope - no function context"
    );
    return false;
  }
  return hhvm_get_frame_args(ar);
}
示例#2
0
int64_t f_func_num_args() {
  EagerCallerFrame cf;
  ActRec* ar = cf.actRecForArgs();
  if (ar == NULL) {
    return -1;
  }
  if (ar->hasVarEnv() && ar->getVarEnv()->isGlobalScope()) {
    raise_warning(
      "func_num_args():  Called from the global scope - no function context"
    );
    return -1;
  }
  return ar->numArgs();
}
示例#3
0
int64_t HHVM_FUNCTION(func_num_args) {
  EagerCallerFrame cf;
  ActRec* ar = cf.actRecForArgs();
  if (ar == nullptr) {
    return -1;
  }
  if (ar->func()->isPseudoMain()) {
    raise_warning(
      "func_num_args():  Called from the global scope - no function context"
    );
    return -1;
  }
  return ar->numArgs();
}
示例#4
0
ALWAYS_INLINE
static int64_t func_num_args_impl() {
  EagerCallerFrame cf;
  ActRec* ar = cf.actRecForArgs();
  if (ar == nullptr) {
    return -1;
  }
  if (ar->func()->isPseudoMain()) {
    raise_warning(
      "func_num_args():  Called from the global scope - no function context"
    );
    return -1;
  }
  return ar->numArgs();
}