php-src/Zend/tests/bug71275.phpt

28 lines
407 B
Plaintext
Raw Normal View History

--TEST--
Bug #71275 (Bad method called on cloning an object having a trait)
--FILE--
<?php
trait MyTrait {
2020-02-04 05:52:20 +08:00
public function _() {
throw new RuntimeException('Should not be called');
}
}
class MyClass {
2020-02-04 05:52:20 +08:00
use MyTrait;
2020-02-04 05:52:20 +08:00
public function __clone() {
echo "I'm working hard to clone";
}
}
$instance = new MyClass();
clone $instance;
?>
--EXPECT--
I'm working hard to clone