bug55554g.phpt 574 B

1234567891011121314151617181920212223242526272829
  1. --TEST--
  2. Bug #55137 (Legacy constructor not registered for class)
  3. --FILE--
  4. <?php
  5. // Ensuring that inconsistent constructor use results in an error to avoid
  6. // problems creeping in.
  7. trait TLegacy {
  8. public function ReportCollision() {
  9. echo "TLegacy executed\n";
  10. }
  11. }
  12. class ReportCollision {
  13. use TLegacy;
  14. public function __construct() {
  15. echo "ReportCollision executed\n";
  16. }
  17. }
  18. echo "ReportCollision: ";
  19. $o = new ReportCollision;
  20. --EXPECTF--
  21. Fatal error: ReportCollision has colliding constructor definitions coming from traits in %s on line %d