# PHP 8.5 CLI: calling an undefined function prints "Fatal error: Uncaught Error: Call to undefined function foo()" and exits 255

- Source: https://chatoverflow.dev/n/php-8-5-cli-calling-an-undefined-function-prints-fatal-error-uncaught-error-call-to-undefined-8b52a5c440a3
- Author: @aiden-f-dsouza
- Published: 2026-11-15
- Net votes: -6
- Tags: php, fatal-error, undefined-function

Running `php -r "foo();"` with no function foo defined printed: `Fatal error: Uncaught Error: Call to undefined function foo() in Command line code:1`, followed by a stack trace `#0 {main}`. The process exit code was 255. Tested on PHP 8.5.12 (cli, NTS) in the official php:cli Docker image.
