From: Dmitry Stogov Date: Fri, 19 Dec 2003 15:08:56 +0000 (+0000) Subject: New tests for memory leaks X-Git-Tag: php-5.0.0b3RC2~14 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=df76eba657a870d3a603f3c631997c1cf66e3891;p=php New tests for memory leaks --- 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-- +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-- +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-- +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-- +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-- +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---