We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 2818d88 commit 16aab10Copy full SHA for 16aab10
src/test/php/lang/ast/unittest/emit/CloningTest.class.php
@@ -99,6 +99,21 @@ public function run($in) {
99
);
100
}
101
102
+ #[Test, Values(['protected', 'private'])]
103
+ public function clone_with_can_access($modifiers) {
104
+ $clone= $this->run('class %T {
105
+ '.$modifiers.' $id= 1;
106
+
107
+ public function id() { return $this->id; }
108
109
+ public function run() {
110
+ return clone($this, ["id" => 6100]);
111
+ }
112
+ }');
113
114
+ Assert::equals(6100, $clone->id());
115
116
117
#[Test, Ignore('Could be done with reflection but with significant performance cost')]
118
public function clone_with_respects_visibility() {
119
$base= $this->type('class %T { private $id= 1; }');
0 commit comments