xref: /PHP-8.0/ext/spl/tests/spl_autoload_006.phpt (revision f8d79582)
1--TEST--
2SPL: spl_autoload() with static methods
3--INI--
4include_path=.
5--FILE--
6<?php
7
8class MyAutoLoader {
9
10        static function autoLoad($className) {
11            echo __METHOD__ . "($className)\n";
12        }
13}
14
15spl_autoload_register('MyAutoLoader::autoLoad');
16
17var_dump(spl_autoload_functions());
18
19// check
20var_dump(class_exists("TestClass", true));
21
22?>
23--EXPECT--
24array(1) {
25  [0]=>
26  array(2) {
27    [0]=>
28    string(12) "MyAutoLoader"
29    [1]=>
30    string(8) "autoLoad"
31  }
32}
33MyAutoLoader::autoLoad(TestClass)
34bool(false)
35