From 0c2b2c9df573b9476d1ef46570ceaa38ed46d9f0 Mon Sep 17 00:00:00 2001 From: belliash Date: Wed, 10 Apr 2019 19:54:05 +0200 Subject: [PATCH] Class instance as argument. --- tests/class_instance_arg.aer | 19 +++++++++++++++++++ tests/class_instance_arg.exp | 2 ++ 2 files changed, 21 insertions(+) create mode 100644 tests/class_instance_arg.aer create mode 100644 tests/class_instance_arg.exp diff --git a/tests/class_instance_arg.aer b/tests/class_instance_arg.aer new file mode 100644 index 0000000..fea973e --- /dev/null +++ b/tests/class_instance_arg.aer @@ -0,0 +1,19 @@ +class Test1 { +} + +class Test2 extends Test1 { +} + +class Program { + object $t; + + void test(Test1 $t = new Test2) { + $this->t = $t; + var_dump($this->t); + } + + void main() { + $this->test(); + } + +} diff --git a/tests/class_instance_arg.exp b/tests/class_instance_arg.exp new file mode 100644 index 0000000..08b5db2 --- /dev/null +++ b/tests/class_instance_arg.exp @@ -0,0 +1,2 @@ +object(Test2) { + }