mirror of
https://github.com/php/php-src.git
synced 2024-11-26 03:16:33 +08:00
4c0bb6d76e
In context of static accesses like classname::$this, the string "$this" should not be handled like a $this variable, but as an identifier for a static variable.
21 lines
337 B
PHP
21 lines
337 B
PHP
--TEST--
|
|
Bug #65911 (scope resolution operator - strange behavior with $this)
|
|
--FILE--
|
|
<?php
|
|
class A {}
|
|
|
|
class B
|
|
{
|
|
public function go()
|
|
{
|
|
$this->foo = 'bar';
|
|
echo A::$this->foo; // should not output 'bar'
|
|
}
|
|
}
|
|
|
|
$obj = new B();
|
|
$obj->go();
|
|
?>
|
|
--EXPECTF--
|
|
Fatal error: Access to undeclared static property: A::$this in %s on line %d
|