xref: /PHP-7.2/Zend/tests/bug71275.phpt (revision 654c8aed)
1--TEST--
2Bug #71275 (Bad method called on cloning an object having a trait)
3--FILE--
4<?php
5
6trait MyTrait {
7	public function _() {
8		throw new RuntimeException('Should not be called');
9	}
10}
11
12
13class MyClass {
14	use MyTrait;
15
16	public function __clone() {
17		echo "I'm working hard to clone";
18	}
19}
20
21
22$instance = new MyClass();
23clone $instance;
24
25?>
26--EXPECT--
27I'm working hard to clone
28