Annotation of embedaddon/php/ext/session/tests/008-php4.2.3.phpt, revision 1.1.1.1
1.1 misho 1: --TEST--
2: bug compatibility: global is used albeit register_globals=0
3: --SKIPIF--
4: <?php include('skipif.inc');
5: if (version_compare(PHP_VERSION,"4.2.3-dev", "<")) die("skip this is for PHP >= 4.2.3");
6: ?>
7: --INI--
8: register_long_arrays=1
9: session.use_cookies=0
10: session.cache_limiter=
11: register_globals=0
12: session.bug_compat_42=1
13: session.bug_compat_warn=1
14: track_errors=1
15: log_errors=0
16: html_errors=0
17: display_errors=1
18: session.serialize_handler=php
19: session.save_handler=files
20: precision=14
21: --FILE--
22: <?php
23: session_id("abtest");
24:
25: ### Phase 1 cleanup
26: session_start();
27: session_destroy();
28:
29: ### Phase 2 $HTTP_SESSION_VARS["c"] does not contain any value
30: session_id("abtest");
31: session_register("c");
32: var_dump($c);
33: unset($c);
34: $c = 3.14;
35: @session_write_close(); // this generates an E_WARNING which will be printed
36: // by $php_errormsg so we can use "@" here. ANY further message IS an error.
37: echo $php_errormsg."\n";
38: unset($HTTP_SESSION_VARS);
39: unset($c);
40:
41: ### Phase 3 $HTTP_SESSION_VARS["c"] is set
42: session_start();
43: var_dump($HTTP_SESSION_VARS);
44: unset($c);
45: $c = 2.78;
46:
47: session_write_close();
48: unset($HTTP_SESSION_VARS);
49: unset($c);
50:
51: ### Phase 4 final
52:
53: session_start();
54: var_dump($c);
55: var_dump($HTTP_SESSION_VARS);
56:
57: session_destroy();
58: ?>
59: --EXPECTF--
60: Deprecated: Directive 'register_long_arrays' is deprecated in PHP 5.3 and greater in Unknown on line 0
61:
62: Deprecated: Function session_register() is deprecated in %s on line %d
63:
64: Notice: Undefined variable: c in %s on line %d
65: NULL
66: session_write_close(): Your script possibly relies on a session side-effect which existed until PHP 4.2.3. Please be advised that the session extension does not consider global variables as a source of data, unless register_globals is enabled. You can disable this functionality and this warning by setting session.bug_compat_42 or session.bug_compat_warn to off, respectively
67: array(1) {
68: ["c"]=>
69: float(3.14)
70: }
71:
72: Notice: Undefined variable: c in %s on line %d
73: NULL
74: array(1) {
75: ["c"]=>
76: float(3.14)
77: }
78:
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>