"Fossies" - the Fresh Open Source Software Archive

Member "php-7.2.27/ext/session/tests/001.phpt" (22 Jan 2020, 640 Bytes) of package /linux/www/php-7.2.27.tar.xz:


As a special service "Fossies" has tried to format the requested text file into HTML format (style: standard) with prefixed line numbers. Alternatively you can here view or download the uninterpreted source code file.

    1 --TEST--
    2 session object serialization
    3 --SKIPIF--
    4 <?php include('skipif.inc'); ?>
    5 --INI--
    6 session.use_cookies=0
    7 session.cache_limiter=
    8 session.serialize_handler=php
    9 session.save_handler=files
   10 --FILE--
   11 <?php
   12 error_reporting(E_ALL);
   13 
   14 class foo {
   15 	public $bar = "ok";
   16 
   17 	function method() { $this->yes = "done"; }
   18 }
   19 
   20 $baz = new foo;
   21 $baz->method();
   22 
   23 $arr[3] = new foo;
   24 $arr[3]->method();
   25 
   26 session_start();
   27 
   28 $_SESSION["baz"] = $baz;
   29 $_SESSION["arr"] = $arr;
   30 
   31 print session_encode()."\n";
   32 
   33 session_destroy();
   34 --EXPECT--
   35 baz|O:3:"foo":2:{s:3:"bar";s:2:"ok";s:3:"yes";s:4:"done";}arr|a:1:{i:3;O:3:"foo":2:{s:3:"bar";s:2:"ok";s:3:"yes";s:4:"done";}}