bug55554d.phpt 740 B

1234567891011121314151617181920212223242526272829303132
  1. --TEST--
  2. Bug #55137 (Legacy constructor not registered for class)
  3. --FILE--
  4. <?php
  5. // Test mixed constructors from different traits, we are more strict about
  6. // these cases, since that can lead to un-expected behavior.
  7. // It is not consistent with the normal constructor handling, but
  8. // here we have a chance to be more strict for the new traits.
  9. trait TNew {
  10. public function __construct() {
  11. echo "TNew executed\n";
  12. }
  13. }
  14. trait TLegacy {
  15. public function ReportCollision() {
  16. echo "ReportCollision executed\n";
  17. }
  18. }
  19. class ReportCollision {
  20. use TNew, TLegacy;
  21. }
  22. $o = new ReportCollision;
  23. --EXPECTF--
  24. Fatal error: ReportCollision has colliding constructor definitions coming from traits in %s on line %d