1--TEST-- 2Test session_decode() function : variation 3--SKIPIF-- 4<?php include('skipif.inc'); ?> 5--INI-- 6session.serialize_handler=blah 7--FILE-- 8<?php 9 10ob_start(); 11 12/* 13 * Prototype : string session_decode(void) 14 * Description : Decodes session data from a string 15 * Source code : ext/session/session.c 16 */ 17 18echo "*** Testing session_decode() : variation ***\n"; 19 20var_dump(session_start()); 21var_dump($_SESSION); 22$_SESSION["foo"] = 1234567890; 23$_SESSION["bar"] = "Blah!"; 24$_SESSION["guff"] = 123.456; 25var_dump($_SESSION); 26$encoded = "foo|i:1234567890;"; 27var_dump(session_decode($encoded)); 28var_dump($_SESSION); 29var_dump(session_destroy()); 30 31echo "Done"; 32ob_end_flush(); 33?> 34--EXPECTF-- 35*** Testing session_decode() : variation *** 36 37Warning: session_start(): Cannot find serialization handler 'blah' - session startup failed in %s on line %d 38bool(false) 39 40Notice: Undefined variable: _SESSION in %s on line %d 41NULL 42array(3) { 43 ["foo"]=> 44 int(1234567890) 45 ["bar"]=> 46 string(5) "Blah!" 47 ["guff"]=> 48 float(123.456) 49} 50 51Warning: session_decode(): Unknown session.serialize_handler. Failed to decode session object in %s on line %d 52bool(false) 53array(3) { 54 ["foo"]=> 55 int(1234567890) 56 ["bar"]=> 57 string(5) "Blah!" 58 ["guff"]=> 59 float(123.456) 60} 61 62Warning: session_destroy(): Trying to destroy uninitialized session in %s on line %d 63bool(false) 64Done 65