2002-10-24 18:18:44 +00:00
--TEST--
bug compatibility: global is used albeit register_globals=0
--SKIPIF--
<?php include('skipif.inc');
if (version_compare(PHP_VERSION,"4.2.3-dev", "<")) die("skip this is for PHP >= 4.2.3");
?>
--INI--
2005-03-31 19:47:19 +00:00
register_long_arrays=1
2002-10-24 18:18:44 +00:00
session.use_cookies=0
session.cache_limiter=
register_globals=0
session.bug_compat_42=1
2002-10-25 17:52:32 +00:00
session.bug_compat_warn=1
track_errors=1
2002-10-27 23:56:08 +00:00
log_errors=0
html_errors=0
2002-10-29 14:03:37 +00:00
display_errors=1
error_reporting=2039;
2002-11-25 23:20:05 +00:00
session.serialize_handler=php
2005-07-04 13:09:14 +00:00
session.save_handler=files
2007-05-18 11:29:55 +00:00
precision=14
2002-10-24 18:18:44 +00:00
--FILE--
<?php
session_id("abtest");
### Phase 1 cleanup
session_start();
session_destroy();
### Phase 2 $HTTP_SESSION_VARS["c"] does not contain any value
session_id("abtest");
session_register("c");
var_dump($c);
unset($c);
$c = 3.14;
2002-10-29 14:03:37 +00:00
@session_write_close(); // this generates an E_WARNING which will be printed
// by $php_errormsg so we can use "@" here. ANY further message IS an error.
2002-10-25 17:52:32 +00:00
echo $php_errormsg."\n";
2002-10-24 18:18:44 +00:00
unset($HTTP_SESSION_VARS);
unset($c);
### Phase 3 $HTTP_SESSION_VARS["c"] is set
session_start();
var_dump($HTTP_SESSION_VARS);
unset($c);
$c = 2.78;
session_write_close();
unset($HTTP_SESSION_VARS);
unset($c);
### Phase 4 final
session_start();
var_dump($c);
var_dump($HTTP_SESSION_VARS);
session_destroy();
?>
--EXPECTF--
NULL
2008-08-06 05:53:31 +00:00
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
2002-10-24 18:18:44 +00:00
array(1) {
["c"]=>
float(3.14)
}
NULL
array(1) {
["c"]=>
float(3.14)
}