2013-10-16 22:04:23 +08:00
|
|
|
--TEST--
|
|
|
|
Bug #65911 (scope resolution operator - strange behavior with $this)
|
|
|
|
--FILE--
|
|
|
|
<?php
|
|
|
|
class A {}
|
|
|
|
|
|
|
|
class B
|
|
|
|
{
|
2021-10-11 21:49:27 +08:00
|
|
|
public $foo;
|
2020-02-04 05:52:20 +08:00
|
|
|
public function go()
|
|
|
|
{
|
|
|
|
$this->foo = 'bar';
|
|
|
|
echo A::$this->foo; // should not output 'bar'
|
|
|
|
}
|
2013-10-16 22:04:23 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
$obj = new B();
|
|
|
|
$obj->go();
|
|
|
|
?>
|
|
|
|
--EXPECTF--
|
2020-05-26 20:10:57 +08:00
|
|
|
Fatal error: Uncaught Error: Access to undeclared static property A::$this in %s:%d
|
2015-05-16 03:04:07 +08:00
|
|
|
Stack trace:
|
|
|
|
#0 %s(%d): B->go()
|
|
|
|
#1 {main}
|
|
|
|
thrown in %s on line %d
|