Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

BadFunctioncallException

The BadFunctioncallException exception is thrown if the callback refers to an undefined function or if some arguments are missing.

BadFunctioncallException is defined by the SPL extension. It is not natively used.

<?php

    function foo(string $s) {
        if (empty($s)) {
           throw new \UnexpectedValueException('Foo() expects a non-empty string');
        }
    }

?>

Documentation

See Also