xref: /PHP-8.0/tests/classes/autoload_012.phpt (revision 840e441d)
1--TEST--
2Ensure callback methods in unknown classes trigger autoload.
3--FILE--
4<?php
5spl_autoload_register(function ($name) {
6    echo "In autoload: ";
7    var_dump($name);
8});
9try {
10    call_user_func("UndefC::test");
11} catch (TypeError $e) {
12    echo $e->getMessage(), "\n";
13}
14?>
15--EXPECT--
16In autoload: string(6) "UndefC"
17call_user_func(): Argument #1 ($callback) must be a valid callback, class "UndefC" not found
18