xref: /PHP-7.3/Zend/tests/bug77291.phpt (revision 0061db55)
1--TEST--
2Bug #77291 (magic methods inherited from a trait may be ignored)
3--FILE--
4<?php
5
6trait AccessibleProperties
7{
8    public function __isset($property)
9    {
10        return property_exists($this, $property);
11    }
12
13    public function __get($property)
14    {
15        if (property_exists($this, $property)) {
16            return $this->$property;
17        }
18    }
19}
20
21class Foo4567 {
22    use AccessibleProperties;
23
24    protected $a = 'Some value';
25}
26
27class Foo45 {
28    use AccessibleProperties;
29
30    protected $a = 'Some value';
31}
32
33$foo = new Foo4567;
34var_dump(isset($foo->a));
35$foo = new Foo45;
36var_dump($foo->a);
37?>
38===DONE===
39--EXPECT--
40bool(true)
41string(10) "Some value"
42===DONE===
43