mirror of
https://github.com/php/php-src.git
synced 2024-12-03 14:54:40 +08:00
Verify PHP 4.2 compatibility: unset($c) with enabled register_globals
This commit is contained in:
parent
f6dfd6b184
commit
d4ef4079de
56
ext/session/tests/007.phpt
Normal file
56
ext/session/tests/007.phpt
Normal file
@ -0,0 +1,56 @@
|
||||
--TEST--
|
||||
Verify PHP 4.2 compatibility: unset($c) with enabled register_globals
|
||||
--SKIPIF--
|
||||
<?php include('skipif.inc'); ?>
|
||||
--FILE--
|
||||
<?php
|
||||
error_reporting(E_ALL & ~E_NOTICE);
|
||||
|
||||
ini_set("register.globals", 1);
|
||||
ini_set("session.bug_compat_42", 1);
|
||||
|
||||
ob_start();
|
||||
session_id("abtest");
|
||||
|
||||
### Phase 1 cleanup
|
||||
session_start();
|
||||
session_destroy();
|
||||
|
||||
### Phase 2 $HTTP_SESSION_VARS["c"] does not contain any value
|
||||
session_register("c");
|
||||
unset($c);
|
||||
$c = 3.14;
|
||||
session_write_close();
|
||||
unset($HTTP_SESSION_VARS);
|
||||
unset($c);
|
||||
|
||||
### Phase 3 $HTTP_SESSION_VARS["c"] is set
|
||||
session_start();
|
||||
var_dump($c);
|
||||
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();
|
||||
?>
|
||||
--EXPECT--
|
||||
float(3.14)
|
||||
array(1) {
|
||||
["c"]=>
|
||||
&float(3.14)
|
||||
}
|
||||
float(3.14)
|
||||
array(1) {
|
||||
["c"]=>
|
||||
&float(3.14)
|
||||
}
|
Loading…
Reference in New Issue
Block a user