diff options
author | Dmitry Stogov <dmitry@php.net> | 2003-12-19 15:08:56 +0000 |
---|---|---|
committer | Dmitry Stogov <dmitry@php.net> | 2003-12-19 15:08:56 +0000 |
commit | df76eba657a870d3a603f3c631997c1cf66e3891 (patch) | |
tree | ba9d862b0979662fb31f07cb63321434823413e4 /tests/classes/incdec_property_004.phpt | |
parent | 0c126e1233ee35c92d0f58f20fc4b40478f0b55f (diff) | |
download | php-git-df76eba657a870d3a603f3c631997c1cf66e3891.tar.gz |
New tests for memory leaks
Diffstat (limited to 'tests/classes/incdec_property_004.phpt')
-rw-r--r-- | tests/classes/incdec_property_004.phpt | 31 |
1 files changed, 31 insertions, 0 deletions
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--- |