2014-05-29 06:02:13 +08:00
|
|
|
--TEST--
|
|
|
|
Conversion of a class constant to a reference after it has been cached
|
|
|
|
--FILE--
|
|
|
|
<?php
|
|
|
|
|
|
|
|
class Test {
|
|
|
|
const TEST = 'TEST';
|
|
|
|
|
|
|
|
private $prop;
|
|
|
|
|
|
|
|
public function readConst() {
|
|
|
|
$this->prop = self::TEST;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2014-05-29 17:17:33 +08:00
|
|
|
function doTest() {
|
|
|
|
$obj = new Test;
|
|
|
|
$obj->readConst();
|
|
|
|
unset($obj);
|
|
|
|
var_dump(Test::TEST);
|
|
|
|
}
|
2014-05-29 06:02:13 +08:00
|
|
|
|
2014-05-29 17:17:33 +08:00
|
|
|
doTest();
|
2014-05-29 06:02:13 +08:00
|
|
|
eval('class Test2 extends Test {}');
|
2014-05-29 17:17:33 +08:00
|
|
|
doTest();
|
2014-05-29 06:02:13 +08:00
|
|
|
|
|
|
|
?>
|
|
|
|
--EXPECT--
|
|
|
|
string(4) "TEST"
|
|
|
|
string(4) "TEST"
|