php-src/Zend/tests/bug65911.phpt

26 lines
450 B
Plaintext
Raw Normal View History

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