diff options
author | Mark A. Hershberger <mah@debian.(none)> | 2009-03-25 00:34:21 -0400 |
---|---|---|
committer | Mark A. Hershberger <mah@debian.(none)> | 2009-03-25 00:34:21 -0400 |
commit | 0e920280a2e04b110827bb766b9f29e3d581c4ee (patch) | |
tree | 8f2125f3d00fe3089e3b94adb06f04479ee15f2a /ext/session/tests/006.phpt | |
download | php-0e920280a2e04b110827bb766b9f29e3d581c4ee.tar.gz |
Imported Upstream version 5.0.4upstream/5.0.4
Diffstat (limited to 'ext/session/tests/006.phpt')
-rw-r--r-- | ext/session/tests/006.phpt | 70 |
1 files changed, 70 insertions, 0 deletions
diff --git a/ext/session/tests/006.phpt b/ext/session/tests/006.phpt new file mode 100644 index 000000000..fb355976f --- /dev/null +++ b/ext/session/tests/006.phpt @@ -0,0 +1,70 @@ +--TEST-- +correct instantiation of references between variables in sessions +--SKIPIF-- +<?php include('skipif.inc'); ?> +--INI-- +session.use_cookies=0 +session.cache_limiter= +register_globals=1 +session.serialize_handler=php +--FILE-- +<?php +error_reporting(E_ALL); + +session_id("abtest"); +session_start(); + +class a { + public $test = "hallo"; +} + +class b { + public $a; + function b(&$a) { + $this->a = &$a; + } +} + +$a = new a(); +$b = new b($a); + +echo "original values:\n"; +var_dump($a,$b); + +session_register("a"); +session_register("b"); +session_write_close(); + +session_unregister("a"); +session_unregister("b"); + +session_start(); + +echo "values after session:\n"; +var_dump($a,$b); +?> +--EXPECTF-- +original values: +object(a)#%d (1) { + ["test"]=> + string(5) "hallo" +} +object(b)#%d (1) { + ["a"]=> + &object(a)#%d (1) { + ["test"]=> + string(5) "hallo" + } +} +values after session: +object(a)#%d (1) { + ["test"]=> + string(5) "hallo" +} +object(b)#%d (1) { + ["a"]=> + &object(a)#%d (1) { + ["test"]=> + string(5) "hallo" + } +}
\ No newline at end of file |