bug71275.phpt 407 B

123456789101112131415161718192021222324252627
  1. --TEST--
  2. Bug #71275 (Bad method called on cloning an object having a trait)
  3. --FILE--
  4. <?php
  5. trait MyTrait {
  6. public function _() {
  7. throw new RuntimeException('Should not be called');
  8. }
  9. }
  10. class MyClass {
  11. use MyTrait;
  12. public function __clone() {
  13. echo "I'm working hard to clone";
  14. }
  15. }
  16. $instance = new MyClass();
  17. clone $instance;
  18. ?>
  19. --EXPECT--
  20. I'm working hard to clone