xref: /PHP-7.2/Zend/tests/traits/property002.phpt (revision f1d7e3ca)
1--TEST--
2Non-conflicting properties should work just fine.
3--FILE--
4<?php
5error_reporting(E_ALL);
6
7trait THello1 {
8  public $hello = "hello";
9}
10
11trait THello2 {
12  private $world = "World!";
13}
14
15class TraitsTest {
16	use THello1;
17	use THello2;
18	function test() {
19	    echo $this->hello . ' ' . $this->world;
20	}
21}
22
23var_dump(property_exists('TraitsTest', 'hello'));
24var_dump(property_exists('TraitsTest', 'world'));
25
26$t = new TraitsTest;
27$t->test();
28?>
29--EXPECTF--
30bool(true)
31bool(true)
32hello World!
33