Skip to content

Commit 867fa57

Browse files
committed
Clone as callback
1 parent 90c19d4 commit 867fa57

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

Zend/tests/clone/callback.phpt

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
--TEST--
2+
As Callback
3+
--FILE--
4+
<?php
5+
6+
class Foo {
7+
private function __clone() {
8+
9+
}
10+
11+
public function clone_me() {
12+
return array_map(clone(...), [$this]);
13+
}
14+
}
15+
16+
$f = new Foo();
17+
18+
$clone = $f->clone_me()[0];
19+
20+
var_dump($f !== $clone);
21+
22+
?>
23+
--EXPECT--
24+
bool(true)

0 commit comments

Comments
 (0)