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); }
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(); }
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(); }
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(); }