1--TEST--
2SPL autoloader should not do anything magic with called scope
3--FILE--
4<?php
5
6class Test {
7    public static function register() {
8        spl_autoload_register([Test::class, 'autoload']);
9    }
10
11    public static function autoload($class) {
12        echo "self=" . self::class, ", static=", static::class, "\n";
13    }
14}
15
16class Test2 extends Test {
17    public static function register() {
18        spl_autoload_register([Test2::class, 'autoload']);
19    }
20
21    public static function runTest() {
22        class_exists('FooBar');
23    }
24}
25
26Test::register();
27Test2::register();
28Test2::runTest();
29
30?>
31--EXPECT--
32self=Test, static=Test
33self=Test, static=Test2
34