diff options
author | Jani Taskinen <jani@php.net> | 2009-08-01 01:01:43 +0000 |
---|---|---|
committer | Jani Taskinen <jani@php.net> | 2009-08-01 01:01:43 +0000 |
commit | 0b03346bf8c43471584462328f3bb8e018448008 (patch) | |
tree | 8644b5b6d3c83bceb3600de39d2ec981ac7d71ec /ext/reflection | |
parent | edbf332cea57dfc1b1d6c94ad01a65b39aa5821c (diff) | |
download | php-git-0b03346bf8c43471584462328f3bb8e018448008.tar.gz |
- Added test for bug #49074
Diffstat (limited to 'ext/reflection')
-rw-r--r-- | ext/reflection/tests/bug49074.phpt | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/ext/reflection/tests/bug49074.phpt b/ext/reflection/tests/bug49074.phpt new file mode 100644 index 0000000000..670427594b --- /dev/null +++ b/ext/reflection/tests/bug49074.phpt @@ -0,0 +1,35 @@ +--TEST-- +Bug #49074 (private class static fields can be modified by using reflection) +--FILE-- +<?php +class Test { + private static $data1 = 1; + private static $data4 = 4; +} + +class Test2 extends Test { + private static $data2 = 2; + public static $data3 = 3; +} + +$r = new ReflectionClass('Test2'); +$m = $r->getStaticProperties(); + +$m['data1'] = 100; +$m['data2'] = 200; +$m['data3'] = 300; +$m['data4'] = 400; + +var_dump($r->getStaticProperties()); +?> +--EXPECT-- +array(4) { + ["data2"]=> + int(2) + ["data3"]=> + int(3) + ["data1"]=> + int(1) + ["data4"]=> + int(4) +} |