1--TEST--
2Variance error in the presence of autoloading (2)
3--FILE--
4<?php
5
6// Same as autoload_error1, but for argument types.
7spl_autoload_register(function($class) {
8    if ($class === 'A') {
9        class A {
10            public function method(B $x) {}
11        }
12    } else if ($class == 'B') {
13        class B extends A {
14            public function method(C $x) {}
15        }
16    } else {
17        class C extends B {
18        }
19    }
20});
21
22$b = new B;
23$c = new C;
24
25?>
26--EXPECTF--
27Warning: Declaration of B::method(C $x) should be compatible with A::method(B $x) in %s on line %d
28