Lets test access to derived attributes.
The build was successful. Details

This commit is contained in:
Rafal Kupiec 2019-05-31 10:18:17 +02:00
parent 1f7e14fd7a
commit 3689a0239a
Signed by: belliash
GPG Key ID: 4E829243E0CFE6B4
2 changed files with 49 additions and 0 deletions

View File

@ -0,0 +1,41 @@
class Test1 {
protected int $w = 7;
protected static void test1() {
var_dump(++$this->w);
}
}
class Test2 {
private int $x = 4;
protected int $z = 2;
protected void test2() {
var_dump($this->x++);
}
}
class Test3 extends Test2 {
protected int $y = 9;
}
class Test4 extends Test1, Test3 {
public void test4() {
var_dump($this->w);
$this->test1();
$this->test2();
$parent->test2();
var_dump($parent->w);
var_dump($parent->y);
var_dump($parent->z);
var_dump($this->z);
}
}
class Program {
public void main() {
object $test = new Test4();
$test->test4();
}
}

View File

@ -0,0 +1,8 @@
int(7)
int(8)
int(4)
int(5)
int(8)
int(9)
int(2)
int(2)