Annotation of embedaddon/php/Zend/tests/traits/bug55554a.phpt, revision 1.1
1.1 ! misho 1: --TEST--
! 2: Bug #55137 (Legacy constructor not registered for class)
! 3: --FILE--
! 4: <?php
! 5:
! 6: // All constructors should be registered as such
! 7:
! 8: trait TConstructor {
! 9: public function constructor() {
! 10: echo "ctor executed\n";
! 11: }
! 12: }
! 13:
! 14: class NewConstructor {
! 15: use TConstructor {
! 16: constructor as __construct;
! 17: }
! 18: }
! 19:
! 20: class LegacyConstructor {
! 21: use TConstructor {
! 22: constructor as LegacyConstructor;
! 23: }
! 24: }
! 25:
! 26: echo "New constructor: ";
! 27: $o = new NewConstructor;
! 28:
! 29: echo "Legacy constructor: ";
! 30: $o = new LegacyConstructor;
! 31:
! 32: --EXPECT--
! 33: New constructor: ctor executed
! 34: Legacy constructor: ctor executed
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>