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 trumpet(string $sound) {
        if (empty($sound)) {
           throw new \UnexpectedValueException('trumpet() expects a non-empty string');
        }
    }

?>

Documentation

See Also