File:  [ELWIX - Embedded LightWeight unIX -] / embedaddon / php / ext / session / tests / session_encode_variation6.phpt
Revision 1.1.1.1 (vendor branch): download - view: text, annotated - select for diffs - revision graph
Tue Feb 21 23:48:01 2012 UTC (12 years, 5 months ago) by misho
Branches: php, MAIN
CVS tags: v5_4_3elwix, v5_4_29p0, v5_4_29, v5_4_20p0, v5_4_20, v5_4_17p0, v5_4_17, v5_3_10, HEAD
php

    1: --TEST--
    2: Test session_encode() function : variation
    3: --SKIPIF--
    4: <?php include('skipif.inc'); ?>
    5: --FILE--
    6: <?php
    7: 
    8: ob_start();
    9: 
   10: /* 
   11:  * Prototype : string session_encode(void)
   12:  * Description : Encodes the current session data as a string
   13:  * Source code : ext/session/session.c 
   14:  */
   15: 
   16: echo "*** Testing session_encode() : variation ***\n";
   17: 
   18: var_dump(session_start());
   19: $_SESSION[] = 1234567890;
   20: var_dump(session_encode());
   21: var_dump(session_destroy());
   22: var_dump(session_start());
   23: $_SESSION[1234567890] = "Hello World!";
   24: var_dump(session_encode());
   25: var_dump(session_destroy());
   26: var_dump(session_start());
   27: $_SESSION[-1234567890] = 1234567890;
   28: var_dump(session_encode());
   29: var_dump(session_destroy());
   30: 
   31: echo "Done";
   32: ob_end_flush();
   33: ?>
   34: --EXPECTF--
   35: *** Testing session_encode() : variation ***
   36: bool(true)
   37: 
   38: Notice: session_encode(): Skipping numeric key 0 in %s on line %d
   39: bool(false)
   40: bool(true)
   41: bool(true)
   42: 
   43: Notice: session_encode(): Skipping numeric key 1234567890 in %s on line %d
   44: bool(false)
   45: bool(true)
   46: bool(true)
   47: 
   48: Notice: session_encode(): Skipping numeric key -1234567890 in %s on line %d
   49: bool(false)
   50: bool(true)
   51: Done

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