Call to Undefined Function

Fatal error: Uncaught Error: Call to undefined function getUsers()

Quick Answer

You are calling a function that does not exist. Check for typos in the function name, ensure the file containing the function is included, or verify the extension is enabled.

Why This Happens

PHP throws this fatal error when it cannot find the function you are trying to call. This happens when the function is misspelled, the file defining it has not been included or autoloaded, or a required PHP extension is not installed or enabled.

The Problem

// functions.php defines get_users()
require_once 'functions.php';
$users = getUsers(); // Wrong name

The Fix

require_once 'functions.php';
$users = get_users(); // Correct function name

Step-by-Step Fix

  1. 1

    Check the function name

    Verify the function name matches exactly, including underscores and casing for namespaced functions.

  2. 2

    Verify the file is loaded

    Make sure the file that defines the function is included via require, include, or autoloader before the call.

  3. 3

    Check extensions

    If the function is from a PHP extension like curl_init or mb_strlen, ensure the extension is enabled in php.ini.

Bugsly catches this automatically

Bugsly's AI analyzes this error pattern in real-time, explains what went wrong in plain English, and suggests the exact fix — before your users even report it.

Try Bugsly free