xref: /PHP-7.4/Zend/tests/bug30820.phpt (revision 8d003858)
1--TEST--
2Bug #30820 (static member conflict with $this->member silently ignored)
3--INI--
4error_reporting=4095
5opcache.optimization_level=0
6--FILE--
7<?php
8class Blah {
9    private static $x;
10
11    public function show() {
12        Blah::$x = 1;
13        $this->x = 5; // no warning, but refers to different variable
14
15        echo 'Blah::$x = '. Blah::$x ."\n";
16        echo '$this->x = '. $this->x ."\n";
17    }
18}
19
20$b = new Blah();
21$b->show();
22?>
23--EXPECTF--
24Notice: Accessing static property Blah::$x as non static in %sbug30820.php on line 7
25Blah::$x = 1
26
27Notice: Accessing static property Blah::$x as non static in %sbug30820.php on line 10
28$this->x = 5
29