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 callback refers to an undefined function or if some arguments are missing.

BadFunctioncallException are 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