Deprecate session_register(), session_unregister() and

session_is_registered() (removed in HEAD)
This commit is contained in:
Hannes Magnusson 2008-12-09 14:03:58 +00:00
parent d5f6620091
commit 76a17847c1
21 changed files with 216 additions and 20 deletions

2
NEWS
View File

@ -4,6 +4,8 @@ PHP NEWS
- Changed opendir(), dir() and scandir() to use default context when no context
argument is passed. (Sara)
- Changed open_basedir to allow tightening in runtime contexts. (Sara)
- Deprecated session_register(), session_unregister() and
session_is_registered(). (Hannes)
- Fixed bug #46811 (ini_set() doesn't return false on failure). (Hannes)

View File

@ -2099,9 +2099,9 @@ static const zend_function_entry session_functions[] = {
PHP_FE(session_id, arginfo_session_id)
PHP_FE(session_regenerate_id, arginfo_session_regenerate_id)
PHP_FE(session_decode, arginfo_session_decode)
PHP_FE(session_register, arginfo_session_register)
PHP_FE(session_unregister, arginfo_session_unregister)
PHP_FE(session_is_registered, arginfo_session_is_registered)
PHP_DEP_FE(session_register, arginfo_session_register)
PHP_DEP_FE(session_unregister, arginfo_session_unregister)
PHP_DEP_FE(session_is_registered, arginfo_session_is_registered)
PHP_FE(session_encode, arginfo_session_void)
PHP_FE(session_start, arginfo_session_void)
PHP_FE(session_destroy, arginfo_session_void)

View File

@ -30,5 +30,9 @@ session_register("arr");
print session_encode()."\n";
session_destroy();
--EXPECT--
--EXPECTF--
Deprecated: Function session_register() is deprecated in %s on line %d
Deprecated: Function session_register() is deprecated in %s on line %d
baz|O:3:"foo":2:{s:3:"bar";s:2:"ok";s:3:"yes";s:4:"done";}arr|a:1:{i:3;O:3:"foo":2:{s:3:"bar";s:2:"ok";s:3:"yes";s:4:"done";}}

View File

@ -84,7 +84,7 @@ var_dump($baz); var_dump($arr); var_dump($c);
session_destroy();
?>
--EXPECT--
--EXPECTF--
OPEN: PHPSESSID
READ: abtest
object(foo)#2 (2) {
@ -106,6 +106,8 @@ WRITE: abtest, baz|O:3:"foo":2:{s:3:"bar";s:2:"ok";s:3:"yes";i:2;}arr|a:1:{i:3;O
CLOSE
OPEN: PHPSESSID
READ: abtest
Deprecated: Function session_register() is deprecated in %s on line %d
object(foo)#4 (2) {
["bar"]=>
string(2) "ok"

View File

@ -57,6 +57,14 @@ object(b)#%d (1) {
string(5) "hallo"
}
}
Deprecated: Function session_register() is deprecated in %s on line %d
Deprecated: Function session_register() is deprecated in %s on line %d
Deprecated: Function session_unregister() is deprecated in %s on line %d
Deprecated: Function session_unregister() is deprecated in %s on line %d
values after session:
object(a)#%d (1) {
["test"]=>

View File

@ -49,7 +49,8 @@ var_dump($HTTP_SESSION_VARS);
session_destroy();
?>
--EXPECT--
--EXPECTF--
Deprecated: Function session_register() is deprecated in %s on line %d
float(3.14)
array(1) {
["c"]=>

View File

@ -31,5 +31,6 @@ session_destroy();
print "I live\n";
?>
--EXPECT--
--EXPECTF--
Deprecated: Function session_register() is deprecated in %s on line %d
I live

View File

@ -47,6 +47,7 @@ var_dump($_SESSION);
session_destroy();
?>
--EXPECTF--
Deprecated: Function session_register() is deprecated in %s on line %d
array(2) {
["o1"]=>
&object(TFoo)#%d (1) {

View File

@ -100,6 +100,8 @@ ob_end_flush();
-- Iteration 1 --
bool(true)
Deprecated: Function session_is_registered() is deprecated in %s on line %d
bool(false)
array(0) {
}
@ -107,6 +109,8 @@ bool(true)
-- Iteration 2 --
bool(true)
Deprecated: Function session_is_registered() is deprecated in %s on line %d
bool(false)
array(0) {
}
@ -114,6 +118,8 @@ bool(true)
-- Iteration 3 --
bool(true)
Deprecated: Function session_is_registered() is deprecated in %s on line %d
bool(false)
array(0) {
}
@ -121,6 +127,8 @@ bool(true)
-- Iteration 4 --
bool(true)
Deprecated: Function session_is_registered() is deprecated in %s on line %d
bool(false)
array(0) {
}
@ -128,6 +136,8 @@ bool(true)
-- Iteration 5 --
bool(true)
Deprecated: Function session_is_registered() is deprecated in %s on line %d
bool(false)
array(0) {
}
@ -135,6 +145,8 @@ bool(true)
-- Iteration 6 --
bool(true)
Deprecated: Function session_is_registered() is deprecated in %s on line %d
bool(false)
array(0) {
}
@ -142,6 +154,8 @@ bool(true)
-- Iteration 7 --
bool(true)
Deprecated: Function session_is_registered() is deprecated in %s on line %d
bool(false)
array(0) {
}
@ -149,6 +163,8 @@ bool(true)
-- Iteration 8 --
bool(true)
Deprecated: Function session_is_registered() is deprecated in %s on line %d
bool(false)
array(0) {
}
@ -156,6 +172,8 @@ bool(true)
-- Iteration 9 --
bool(true)
Deprecated: Function session_is_registered() is deprecated in %s on line %d
bool(false)
array(0) {
}
@ -163,6 +181,8 @@ bool(true)
-- Iteration 10 --
bool(true)
Deprecated: Function session_is_registered() is deprecated in %s on line %d
bool(false)
array(0) {
}
@ -170,6 +190,8 @@ bool(true)
-- Iteration 11 --
bool(true)
Deprecated: Function session_is_registered() is deprecated in %s on line %d
bool(false)
array(0) {
}
@ -177,6 +199,8 @@ bool(true)
-- Iteration 12 --
bool(true)
Deprecated: Function session_is_registered() is deprecated in %s on line %d
bool(false)
array(0) {
}
@ -184,6 +208,8 @@ bool(true)
-- Iteration 13 --
bool(true)
Deprecated: Function session_is_registered() is deprecated in %s on line %d
bool(false)
array(0) {
}
@ -191,6 +217,8 @@ bool(true)
-- Iteration 14 --
bool(true)
Deprecated: Function session_is_registered() is deprecated in %s on line %d
bool(false)
array(0) {
}
@ -198,6 +226,8 @@ bool(true)
-- Iteration 15 --
bool(true)
Deprecated: Function session_is_registered() is deprecated in %s on line %d
bool(false)
array(0) {
}
@ -205,6 +235,8 @@ bool(true)
-- Iteration 16 --
bool(true)
Deprecated: Function session_is_registered() is deprecated in %s on line %d
bool(false)
array(0) {
}
@ -212,6 +244,8 @@ bool(true)
-- Iteration 17 --
bool(true)
Deprecated: Function session_is_registered() is deprecated in %s on line %d
bool(false)
array(0) {
}
@ -219,6 +253,8 @@ bool(true)
-- Iteration 18 --
bool(true)
Deprecated: Function session_is_registered() is deprecated in %s on line %d
bool(false)
array(0) {
}
@ -226,6 +262,8 @@ bool(true)
-- Iteration 19 --
bool(true)
Deprecated: Function session_is_registered() is deprecated in %s on line %d
bool(false)
array(0) {
}
@ -233,6 +271,8 @@ bool(true)
-- Iteration 20 --
bool(true)
Deprecated: Function session_is_registered() is deprecated in %s on line %d
bool(false)
array(0) {
}
@ -240,6 +280,8 @@ bool(true)
-- Iteration 21 --
bool(true)
Deprecated: Function session_is_registered() is deprecated in %s on line %d
bool(false)
array(0) {
}
@ -247,6 +289,8 @@ bool(true)
-- Iteration 22 --
bool(true)
Deprecated: Function session_is_registered() is deprecated in %s on line %d
bool(false)
array(0) {
}
@ -254,6 +298,8 @@ bool(true)
-- Iteration 23 --
bool(true)
Deprecated: Function session_is_registered() is deprecated in %s on line %d
bool(false)
array(0) {
}
@ -262,10 +308,11 @@ bool(true)
-- Iteration 24 --
bool(true)
Deprecated: Function session_is_registered() is deprecated in %s on line %d
Warning: session_is_registered() expects parameter 1 to be string, resource given in %s on line %d
NULL
array(0) {
}
bool(true)
Done

View File

@ -97,6 +97,8 @@ bool(true)
array(0) {
}
Deprecated: Function session_is_registered() is deprecated in %s on line %d
Warning: session_is_registered() expects parameter 1 to be string, array given in %s on line %d
NULL
array(0) {
@ -105,4 +107,3 @@ bool(true)
array(0) {
}
Done

View File

@ -36,25 +36,40 @@ ob_end_flush();
?>
--EXPECTF--
*** Testing session_is_registered() : variation ***
Deprecated: Function session_is_registered() is deprecated in %s on line %d
bool(false)
bool(true)
Deprecated: Function session_is_registered() is deprecated in %s on line %d
bool(false)
array(0) {
}
Deprecated: Function session_is_registered() is deprecated in %s on line %d
bool(true)
array(1) {
["foo"]=>
string(12) "Hello World!"
}
Deprecated: Function session_is_registered() is deprecated in %s on line %d
bool(true)
Deprecated: Function session_unregister() is deprecated in %s on line %d
bool(true)
Deprecated: Function session_is_registered() is deprecated in %s on line %d
bool(false)
array(0) {
}
bool(true)
Deprecated: Function session_is_registered() is deprecated in %s on line %d
bool(false)
array(0) {
}
Deprecated: Function session_is_registered() is deprecated in %s on line %d
bool(false)
Done

View File

@ -36,24 +36,37 @@ ob_end_flush();
?>
--EXPECTF--
*** Testing session_is_registered() : variation ***
Deprecated: Function session_is_registered() is deprecated in %s on line %d
bool(false)
bool(true)
Deprecated: Function session_is_registered() is deprecated in %s on line %d
bool(false)
array(0) {
}
Deprecated: Function session_is_registered() is deprecated in %s on line %d
bool(false)
array(1) {
["foo"]=>
&string(12) "Hello World!"
}
Deprecated: Function session_is_registered() is deprecated in %s on line %d
bool(true)
Deprecated: Function session_unregister() is deprecated in %s on line %d
bool(true)
Deprecated: Function session_is_registered() is deprecated in %s on line %d
bool(false)
array(0) {
}
bool(true)
Deprecated: Function session_is_registered() is deprecated in %s on line %d
bool(false)
array(0) {
}
Done

View File

@ -100,6 +100,8 @@ ob_end_flush();
-- Iteration 1 --
bool(true)
Deprecated: Function session_register() is deprecated in %s on line %d
bool(true)
array(1) {
["0"]=>
@ -109,6 +111,8 @@ bool(true)
-- Iteration 2 --
bool(true)
Deprecated: Function session_register() is deprecated in %s on line %d
bool(true)
array(1) {
["1"]=>
@ -118,6 +122,8 @@ bool(true)
-- Iteration 3 --
bool(true)
Deprecated: Function session_register() is deprecated in %s on line %d
bool(true)
array(1) {
["12345"]=>
@ -127,6 +133,8 @@ bool(true)
-- Iteration 4 --
bool(true)
Deprecated: Function session_register() is deprecated in %s on line %d
bool(true)
array(1) {
["-2345"]=>
@ -136,6 +144,8 @@ bool(true)
-- Iteration 5 --
bool(true)
Deprecated: Function session_register() is deprecated in %s on line %d
bool(true)
array(1) {
["10.5"]=>
@ -145,6 +155,8 @@ bool(true)
-- Iteration 6 --
bool(true)
Deprecated: Function session_register() is deprecated in %s on line %d
bool(true)
array(1) {
["-10.5"]=>
@ -154,6 +166,8 @@ bool(true)
-- Iteration 7 --
bool(true)
Deprecated: Function session_register() is deprecated in %s on line %d
bool(true)
array(1) {
["123456789000"]=>
@ -163,6 +177,8 @@ bool(true)
-- Iteration 8 --
bool(true)
Deprecated: Function session_register() is deprecated in %s on line %d
bool(true)
array(1) {
["1.23456789E-9"]=>
@ -172,6 +188,8 @@ bool(true)
-- Iteration 9 --
bool(true)
Deprecated: Function session_register() is deprecated in %s on line %d
bool(true)
array(1) {
["0.5"]=>
@ -181,6 +199,8 @@ bool(true)
-- Iteration 10 --
bool(true)
Deprecated: Function session_register() is deprecated in %s on line %d
bool(true)
array(1) {
[""]=>
@ -190,6 +210,8 @@ bool(true)
-- Iteration 11 --
bool(true)
Deprecated: Function session_register() is deprecated in %s on line %d
bool(true)
array(1) {
[""]=>
@ -199,6 +221,8 @@ bool(true)
-- Iteration 12 --
bool(true)
Deprecated: Function session_register() is deprecated in %s on line %d
bool(true)
array(1) {
["1"]=>
@ -208,6 +232,8 @@ bool(true)
-- Iteration 13 --
bool(true)
Deprecated: Function session_register() is deprecated in %s on line %d
bool(true)
array(1) {
[""]=>
@ -217,6 +243,8 @@ bool(true)
-- Iteration 14 --
bool(true)
Deprecated: Function session_register() is deprecated in %s on line %d
bool(true)
array(1) {
["1"]=>
@ -226,6 +254,8 @@ bool(true)
-- Iteration 15 --
bool(true)
Deprecated: Function session_register() is deprecated in %s on line %d
bool(true)
array(1) {
[""]=>
@ -235,6 +265,8 @@ bool(true)
-- Iteration 16 --
bool(true)
Deprecated: Function session_register() is deprecated in %s on line %d
bool(true)
array(1) {
[""]=>
@ -244,6 +276,8 @@ bool(true)
-- Iteration 17 --
bool(true)
Deprecated: Function session_register() is deprecated in %s on line %d
bool(true)
array(1) {
[""]=>
@ -253,6 +287,8 @@ bool(true)
-- Iteration 18 --
bool(true)
Deprecated: Function session_register() is deprecated in %s on line %d
bool(true)
array(1) {
["Nothing"]=>
@ -262,6 +298,8 @@ bool(true)
-- Iteration 19 --
bool(true)
Deprecated: Function session_register() is deprecated in %s on line %d
bool(true)
array(1) {
["Nothing"]=>
@ -271,6 +309,8 @@ bool(true)
-- Iteration 20 --
bool(true)
Deprecated: Function session_register() is deprecated in %s on line %d
bool(true)
array(1) {
["Hello World!"]=>
@ -280,6 +320,8 @@ bool(true)
-- Iteration 21 --
bool(true)
Deprecated: Function session_register() is deprecated in %s on line %d
bool(true)
array(1) {
["Hello World!"]=>
@ -289,6 +331,8 @@ bool(true)
-- Iteration 22 --
bool(true)
Deprecated: Function session_register() is deprecated in %s on line %d
bool(true)
array(1) {
[""]=>
@ -298,6 +342,8 @@ bool(true)
-- Iteration 23 --
bool(true)
Deprecated: Function session_register() is deprecated in %s on line %d
bool(true)
array(1) {
[""]=>
@ -307,6 +353,8 @@ bool(true)
-- Iteration 24 --
bool(true)
Deprecated: Function session_register() is deprecated in %s on line %d
bool(true)
array(1) {
["Resource id #%d"]=>
@ -314,4 +362,3 @@ array(1) {
}
bool(true)
Done

View File

@ -96,6 +96,8 @@ ob_end_flush();
bool(true)
array(0) {
}
Deprecated: Function session_register() is deprecated in %s on line %d
bool(true)
array(13) {
["0"]=>
@ -155,4 +157,3 @@ array(13) {
NULL
}
Done

View File

@ -31,6 +31,8 @@ bool(true)
array(0) {
}
Deprecated: Function session_register() is deprecated in %s on line %d
Warning: session_register() expects at least 1 parameter, 0 given in %s on line %d
NULL
array(0) {
@ -39,4 +41,3 @@ bool(true)
array(0) {
}
Done

View File

@ -31,6 +31,8 @@ ob_end_flush();
bool(true)
array(0) {
}
Deprecated: Function session_register() is deprecated in %s on line %d
bool(true)
array(1) {
["blah"]=>
@ -42,4 +44,3 @@ array(1) {
NULL
}
Done

View File

@ -32,6 +32,8 @@ ob_end_flush();
bool(true)
array(0) {
}
Deprecated: Function session_register() is deprecated in %s on line %d
bool(true)
array(1) {
["foo"]=>
@ -43,4 +45,3 @@ array(1) {
NULL
}
Done

View File

@ -101,78 +101,125 @@ ob_end_flush();
bool(true)
-- Iteration 1 --
Deprecated: Function session_unregister() is deprecated in %s on line %d
bool(true)
-- Iteration 2 --
Deprecated: Function session_unregister() is deprecated in %s on line %d
bool(true)
-- Iteration 3 --
Deprecated: Function session_unregister() is deprecated in %s on line %d
bool(true)
-- Iteration 4 --
Deprecated: Function session_unregister() is deprecated in %s on line %d
bool(true)
-- Iteration 5 --
Deprecated: Function session_unregister() is deprecated in %s on line %d
bool(true)
-- Iteration 6 --
Deprecated: Function session_unregister() is deprecated in %s on line %d
bool(true)
-- Iteration 7 --
Deprecated: Function session_unregister() is deprecated in %s on line %d
bool(true)
-- Iteration 8 --
Deprecated: Function session_unregister() is deprecated in %s on line %d
bool(true)
-- Iteration 9 --
Deprecated: Function session_unregister() is deprecated in %s on line %d
bool(true)
-- Iteration 10 --
Deprecated: Function session_unregister() is deprecated in %s on line %d
bool(true)
-- Iteration 11 --
Deprecated: Function session_unregister() is deprecated in %s on line %d
bool(true)
-- Iteration 12 --
Deprecated: Function session_unregister() is deprecated in %s on line %d
bool(true)
-- Iteration 13 --
Deprecated: Function session_unregister() is deprecated in %s on line %d
bool(true)
-- Iteration 14 --
Deprecated: Function session_unregister() is deprecated in %s on line %d
bool(true)
-- Iteration 15 --
Deprecated: Function session_unregister() is deprecated in %s on line %d
bool(true)
-- Iteration 16 --
Deprecated: Function session_unregister() is deprecated in %s on line %d
bool(true)
-- Iteration 17 --
Deprecated: Function session_unregister() is deprecated in %s on line %d
bool(true)
-- Iteration 18 --
Deprecated: Function session_unregister() is deprecated in %s on line %d
bool(true)
-- Iteration 19 --
Deprecated: Function session_unregister() is deprecated in %s on line %d
bool(true)
-- Iteration 20 --
Deprecated: Function session_unregister() is deprecated in %s on line %d
bool(true)
-- Iteration 21 --
Deprecated: Function session_unregister() is deprecated in %s on line %d
bool(true)
-- Iteration 22 --
Deprecated: Function session_unregister() is deprecated in %s on line %d
bool(true)
-- Iteration 23 --
Deprecated: Function session_unregister() is deprecated in %s on line %d
bool(true)
-- Iteration 24 --
Deprecated: Function session_unregister() is deprecated in %s on line %d
Warning: session_unregister() expects parameter 1 to be string, resource given in %s on line %d
NULL
bool(true)
Done

View File

@ -96,6 +96,8 @@ ob_end_flush();
bool(true)
array(0) {
}
Deprecated: Function session_register() is deprecated in %s on line %d
bool(true)
array(13) {
["0"]=>
@ -155,4 +157,3 @@ array(13) {
NULL
}
Done

View File

@ -36,6 +36,8 @@ array(1) {
["foo"]=>
string(12) "Hello World!"
}
Deprecated: Function session_unregister() is deprecated in %s on line %d
bool(true)
array(0) {
}
@ -43,4 +45,3 @@ bool(true)
array(0) {
}
Done

View File

@ -37,6 +37,8 @@ array(1) {
["foo"]=>
&string(12) "Hello World!"
}
Deprecated: Function session_unregister() is deprecated in %s on line %d
bool(true)
array(0) {
}
@ -44,4 +46,3 @@ bool(true)
array(0) {
}
Done