• 首页
  • vue
  • TypeScript
  • JavaScript
  • scss
  • css3
  • html5
  • php
  • MySQL
  • redis
  • jQuery
  • BadFunctionCallException()

    (PHP 5 >= 5.1.0, PHP 7)

    简介

    Exception thrown if a callback refers to an undefined function or if some arguments are missing.

    类摘要

    BadFunctionCallExceptionextendsLogicException{/*继承的属性*/protectedstring $message;protectedint $code;protectedstring $file;protectedint $line;/*继承的方法*/
    finalpublicException::getMessage(void): string
    finalpublicException::getPrevious(void): Throwable
    finalpublicException::getCode(void): int
    finalpublicException::getFile(void): string
    finalpublicException::getLine(void): int
    finalpublicException::getTrace(void): array
    finalpublicException::getTraceAsString(void): string
    publicException::__toString(void): string
    finalprivateException::__clone(void): void
    }
    A typical use for this exception, is in conjunction with the is_callable() function.
    For example: 
    function foo($arg) {
      $func = 'do' . $arg;
      if (!is_callable($func)) {
        throw new BadFunctionCallException('Function ' . $func . ' is not callable');
      }
    }