xref: /PHP-5.6/Zend/tests/traits/property004.phpt (revision 7357867b)
1--TEST--
2Conflicting properties with different initial values are considered incompatible.
3--FILE--
4<?php
5error_reporting(E_ALL);
6
7trait THello1 {
8  public $hello = "foo";
9}
10
11trait THello2 {
12  private $hello = "bar";
13}
14
15echo "PRE-CLASS-GUARD\n";
16
17class TraitsTest {
18	use THello1;
19	use THello2;
20	public function getHello() {
21	    return $this->hello;
22	}
23}
24
25$t = new TraitsTest;
26?>
27--EXPECTF--
28PRE-CLASS-GUARD
29
30Fatal error: THello1 and THello2 define the same property ($hello) in the composition of TraitsTest. However, the definition differs and is considered incompatible. Class was composed in %s on line %d