1--TEST--
2self:: class constants should not be propagated into closures, due to scope rebinding
3--FILE--
4<?php
5
6class A {
7    const C = 'A::C';
8
9    public function f() {
10        return function() {
11            return self::C;
12        };
13    }
14}
15
16class B {
17    const C = 'B::C';
18}
19
20$f = (new A)->f();
21var_dump($f->bindTo(new B, 'B')());
22
23?>
24--EXPECT--
25string(4) "B::C"
26