Annotation of embedaddon/php/Zend/tests/traits/bug55554g.phpt, revision 1.1
1.1 ! misho 1: --TEST--
! 2: Bug #55137 (Legacy constructor not registered for class)
! 3: --FILE--
! 4: <?php
! 5:
! 6: // Ensuring that inconsistent constructor use results in an error to avoid
! 7: // problems creeping in.
! 8:
! 9: trait TLegacy {
! 10: public function ReportCollision() {
! 11: echo "TLegacy executed\n";
! 12: }
! 13: }
! 14:
! 15: class ReportCollision {
! 16: use TLegacy;
! 17:
! 18: public function __construct() {
! 19: echo "ReportCollision executed\n";
! 20: }
! 21: }
! 22:
! 23:
! 24: echo "ReportCollision: ";
! 25: $o = new ReportCollision;
! 26:
! 27:
! 28: --EXPECTF--
! 29: Fatal error: ReportCollision has colliding constructor definitions coming from traits in %s on line %d
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>