2001-06-22 02:46:26 +08:00
|
|
|
--TEST--
|
|
|
|
References between variables in sessions
|
2002-03-09 03:16:19 +08:00
|
|
|
--SKIPIF--
|
2002-04-19 15:55:24 +08:00
|
|
|
<?php include('skipif.inc'); ?>
|
2001-06-22 02:46:26 +08:00
|
|
|
--FILE--
|
|
|
|
<?php
|
2001-07-23 05:46:39 +08:00
|
|
|
error_reporting(E_ALL & ~E_NOTICE);
|
2002-03-08 04:51:27 +08:00
|
|
|
|
|
|
|
ini_set("register_globals", 1);
|
|
|
|
|
2001-06-22 02:46:26 +08:00
|
|
|
ob_start();
|
2002-01-10 13:11:19 +08:00
|
|
|
session_id("abtest");
|
2001-06-22 02:46:26 +08:00
|
|
|
session_start();
|
|
|
|
|
|
|
|
class a {
|
|
|
|
var $test = "hallo";
|
|
|
|
}
|
|
|
|
|
|
|
|
class b {
|
|
|
|
var $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);
|
|
|
|
?>
|
|
|
|
--EXPECT--
|
|
|
|
original values:
|
|
|
|
object(a)(1) {
|
|
|
|
["test"]=>
|
|
|
|
string(5) "hallo"
|
|
|
|
}
|
|
|
|
object(b)(1) {
|
|
|
|
["a"]=>
|
|
|
|
&object(a)(1) {
|
|
|
|
["test"]=>
|
|
|
|
string(5) "hallo"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
values after session:
|
|
|
|
object(a)(1) {
|
|
|
|
["test"]=>
|
|
|
|
string(5) "hallo"
|
|
|
|
}
|
|
|
|
object(b)(1) {
|
|
|
|
["a"]=>
|
|
|
|
&object(a)(1) {
|
|
|
|
["test"]=>
|
|
|
|
string(5) "hallo"
|
|
|
|
}
|
|
|
|
}
|