Annotation of embedaddon/php/ext/session/tests/019.phpt, revision 1.1.1.1

1.1       misho       1: --TEST--
                      2: serializing references test case using globals
                      3: --SKIPIF--
                      4: <?php include('skipif.inc'); ?>
                      5: --INI--
                      6: session.use_cookies=0
                      7: session.cache_limiter=
                      8: register_globals=1
                      9: session.serialize_handler=php
                     10: session.save_handler=files
                     11: --FILE--
                     12: <?php
                     13: 
                     14: error_reporting(E_ALL);
                     15: 
                     16: class TFoo {
                     17:        public $c;
                     18:        function TFoo($c) {
                     19:                $this->c = $c;
                     20:        }
                     21:        function inc() {
                     22:                $this->c++;
                     23:        }
                     24: }
                     25: 
                     26: session_id("abtest");
                     27: session_start();
                     28: session_register('o1', 'o2' );
                     29: 
                     30: $o1 = new TFoo(42);
                     31: $o2 =& $o1;
                     32: 
                     33: session_write_close();
                     34: 
                     35: unset($o1);
                     36: unset($o2);
                     37: 
                     38: session_start();
                     39: 
                     40: var_dump($_SESSION);
                     41: 
                     42: $o1->inc();
                     43: $o2->inc();
                     44: 
                     45: var_dump($_SESSION);
                     46: 
                     47: session_destroy();
                     48: ?>
                     49: --EXPECTF--
                     50: Deprecated: Directive 'register_globals' is deprecated in PHP 5.3 and greater in Unknown on line 0
                     51: 
                     52: Deprecated: Function session_register() is deprecated in %s on line %d
                     53: array(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: }
                     65: array(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: 

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>