summaryrefslogtreecommitdiff
path: root/ext/session/tests/session_encode_variation6.phpt
blob: c5f1f4bbc3a8086633c73b072ff7016db2fb56b1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
--TEST--
Test session_encode() function : variation
--SKIPIF--
<?php include('skipif.inc'); ?>
--FILE--
<?php

ob_start();

/* 
 * Prototype : string session_encode(void)
 * Description : Encodes the current session data as a string
 * Source code : ext/session/session.c 
 */

echo "*** Testing session_encode() : variation ***\n";

var_dump(session_start());
$_SESSION[] = 1234567890;
var_dump(session_encode());
var_dump(session_destroy());
var_dump(session_start());
$_SESSION[1234567890] = "Hello World!";
var_dump(session_encode());
var_dump(session_destroy());
var_dump(session_start());
$_SESSION[-1234567890] = 1234567890;
var_dump(session_encode());
var_dump(session_destroy());

echo "Done";
ob_end_flush();
?>
--EXPECTF--
*** Testing session_encode() : variation ***
bool(true)

Notice: session_encode(): Skipping numeric key 0 in %s on line %d
bool(false)
bool(true)
bool(true)

Notice: session_encode(): Skipping numeric key 1234567890 in %s on line %d
bool(false)
bool(true)
bool(true)

Notice: session_encode(): Skipping numeric key -1234567890 in %s on line %d
bool(false)
bool(true)
Done