Annotation of embedaddon/php/Zend/tests/traits/property004.phpt, revision 1.1
1.1 ! misho 1: --TEST--
! 2: Conflicting properties with different initial values are considered incompatible.
! 3: --FILE--
! 4: <?php
! 5: error_reporting(E_ALL);
! 6:
! 7: trait THello1 {
! 8: public $hello = "foo";
! 9: }
! 10:
! 11: trait THello2 {
! 12: private $hello = "bar";
! 13: }
! 14:
! 15: echo "PRE-CLASS-GUARD\n";
! 16:
! 17: class 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--
! 28: PRE-CLASS-GUARD
! 29:
! 30: Fatal 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
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>