summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--tests/classes/assign_op_property_001.phpt31
-rw-r--r--tests/classes/incdec_property_001.phpt31
-rw-r--r--tests/classes/incdec_property_002.phpt31
-rw-r--r--tests/classes/incdec_property_003.phpt31
-rw-r--r--tests/classes/incdec_property_004.phpt31
5 files changed, 155 insertions, 0 deletions
diff --git a/tests/classes/assign_op_property_001.phpt b/tests/classes/assign_op_property_001.phpt
new file mode 100644
index 0000000000..54e519e8f6
--- /dev/null
+++ b/tests/classes/assign_op_property_001.phpt
@@ -0,0 +1,31 @@
+--TEST--
+ZE2 assign_op property of overloaded object
+--FILE--
+<?php
+
+class Test {
+ private $real_a = 2;
+
+ function __set($property, $value) {
+ if ($property = "a") {
+ $this->real_a = $value;
+ }
+ }
+
+ function __get($property) {
+ if ($property = "a") {
+ return $this->real_a;
+ }
+ }
+}
+
+$obj = new Test;
+var_dump($obj->a);
+$obj->a += 2;
+var_dump($obj->a);
+echo "---Done---\n";
+?>
+--EXPECT--
+int(2)
+int(4)
+---Done---
diff --git a/tests/classes/incdec_property_001.phpt b/tests/classes/incdec_property_001.phpt
new file mode 100644
index 0000000000..39bf06f65f
--- /dev/null
+++ b/tests/classes/incdec_property_001.phpt
@@ -0,0 +1,31 @@
+--TEST--
+ZE2 post increment/decrement property of overloaded object
+--FILE--
+<?php
+
+class Test {
+ private $real_a = 2;
+
+ function __set($property, $value) {
+ if ($property = "a") {
+ $this->real_a = $value;
+ }
+ }
+
+ function __get($property) {
+ if ($property = "a") {
+ return $this->real_a;
+ }
+ }
+}
+
+$obj = new Test;
+var_dump($obj->a);
+$obj->a++;
+var_dump($obj->a);
+echo "---Done---\n";
+?>
+--EXPECT--
+int(2)
+int(3)
+---Done---
diff --git a/tests/classes/incdec_property_002.phpt b/tests/classes/incdec_property_002.phpt
new file mode 100644
index 0000000000..fe08625ea8
--- /dev/null
+++ b/tests/classes/incdec_property_002.phpt
@@ -0,0 +1,31 @@
+--TEST--
+ZE2 post increment/decrement property of overloaded object with assignment
+--FILE--
+<?php
+
+class Test {
+ private $real_a = 2;
+
+ function __set($property, $value) {
+ if ($property = "a") {
+ $this->real_a = $value;
+ }
+ }
+
+ function __get($property) {
+ if ($property = "a") {
+ return $this->real_a;
+ }
+ }
+}
+
+$obj = new Test;
+var_dump($obj->a);
+$t1 = $obj->a++;
+var_dump($obj->a);
+echo "---Done---\n";
+?>
+--EXPECT--
+int(2)
+int(3)
+---Done---
diff --git a/tests/classes/incdec_property_003.phpt b/tests/classes/incdec_property_003.phpt
new file mode 100644
index 0000000000..d26277ab8d
--- /dev/null
+++ b/tests/classes/incdec_property_003.phpt
@@ -0,0 +1,31 @@
+--TEST--
+ZE2 pre increment/decrement property of overloaded object
+--FILE--
+<?php
+
+class Test {
+ private $real_a = 2;
+
+ function __set($property, $value) {
+ if ($property = "a") {
+ $this->real_a = $value;
+ }
+ }
+
+ function __get($property) {
+ if ($property = "a") {
+ return $this->real_a;
+ }
+ }
+}
+
+$obj = new Test;
+var_dump($obj->a);
+++$obj->a;
+var_dump($obj->a);
+echo "---Done---\n";
+?>
+--EXPECT--
+int(2)
+int(3)
+---Done---
diff --git a/tests/classes/incdec_property_004.phpt b/tests/classes/incdec_property_004.phpt
new file mode 100644
index 0000000000..5ccad190b8
--- /dev/null
+++ b/tests/classes/incdec_property_004.phpt
@@ -0,0 +1,31 @@
+--TEST--
+ZE2 pre increment/decrement property of overloaded object with assignment
+--FILE--
+<?php
+
+class Test {
+ private $real_a = 2;
+
+ function __set($property, $value) {
+ if ($property = "a") {
+ $this->real_a = $value;
+ }
+ }
+
+ function __get($property) {
+ if ($property = "a") {
+ return $this->real_a;
+ }
+ }
+}
+
+$obj = new Test;
+var_dump($obj->a);
+$t1 = ++$obj->a;
+var_dump($obj->a);
+echo "---Done---\n";
+?>
+--EXPECT--
+int(2)
+int(3)
+---Done---