1--TEST-- 2serializing references test case using globals 3--SKIPIF-- 4<?php include('skipif.inc'); ?> 5--INI-- 6session.use_cookies=0 7session.cache_limiter= 8register_globals=1 9session.serialize_handler=php 10session.save_handler=files 11--FILE-- 12<?php 13 14error_reporting(E_ALL); 15 16class TFoo { 17 public $c; 18 function TFoo($c) { 19 $this->c = $c; 20 } 21 function inc() { 22 $this->c++; 23 } 24} 25 26session_id("abtest"); 27session_start(); 28session_register('o1', 'o2' ); 29 30$o1 = new TFoo(42); 31$o2 =& $o1; 32 33session_write_close(); 34 35unset($o1); 36unset($o2); 37 38session_start(); 39 40var_dump($_SESSION); 41 42$o1->inc(); 43$o2->inc(); 44 45var_dump($_SESSION); 46 47session_destroy(); 48?> 49--EXPECTF-- 50Deprecated: Directive 'register_globals' is deprecated in PHP 5.3 and greater in Unknown on line 0 51 52Deprecated: Function session_register() is deprecated in %s on line %d 53array(2) { 54 ["o1"]=> 55 &object(TFoo)#%d (1) { 56 ["c"]=> 57 int(42) 58 } 59 ["o2"]=> 60 &object(TFoo)#%d (1) { 61 ["c"]=> 62 int(42) 63 } 64} 65array(2) { 66 ["o1"]=> 67 &object(TFoo)#%d (1) { 68 ["c"]=> 69 int(44) 70 } 71 ["o2"]=> 72 &object(TFoo)#%d (1) { 73 ["c"]=> 74 int(44) 75 } 76} 77 78