mirror of
https://github.com/php/php-src.git
synced 2024-09-30 06:16:08 +00:00
26 lines
367 B
Plaintext
26 lines
367 B
Plaintext
|
--TEST--
|
||
|
self:: class constants should not be propagated into closures, due to scope rebinding
|
||
|
--FILE--
|
||
|
<?php
|
||
|
|
||
|
class A {
|
||
|
const C = 'A::C';
|
||
|
|
||
|
public function f() {
|
||
|
return function() {
|
||
|
return self::C;
|
||
|
};
|
||
|
}
|
||
|
}
|
||
|
|
||
|
class B {
|
||
|
const C = 'B::C';
|
||
|
}
|
||
|
|
||
|
$f = (new A)->f();
|
||
|
var_dump($f->bindTo(null, 'B')());
|
||
|
|
||
|
?>
|
||
|
--EXPECT--
|
||
|
string(4) "B::C"
|