summaryrefslogtreecommitdiff
path: root/Zend/tests/bug74340.phpt
blob: f266dcc2366b8bbc59911fc08e57f5739f01cd27 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
--TEST--
Bug #74340: Magic function __get has different behavior in php 7.1.x
--FILE--
<?php
class Test
{
    public function __get($var)
    {
        static $first = true;
        echo '__get '.$var.PHP_EOL;
        if ($first) {
            $first = false;
            $this->$var;
            $this->{$var.'2'};
            $this->$var;
        }
    }
}

$test = new Test;
$test->test;

?>
--EXPECTF--
__get test

Notice: Undefined property: Test::$test in %s on line %d
__get test2

Notice: Undefined property: Test::$test in %s on line %d