]> granicus.if.org Git - php/commitdiff
one version for php<4.2.3 and one for php>=4.2.3
authorMarcus Boerger <helly@php.net>
Thu, 24 Oct 2002 18:18:44 +0000 (18:18 +0000)
committerMarcus Boerger <helly@php.net>
Thu, 24 Oct 2002 18:18:44 +0000 (18:18 +0000)
ext/session/tests/008-php4.2.3.phpt [new file with mode: 0644]
ext/session/tests/008.phpt

diff --git a/ext/session/tests/008-php4.2.3.phpt b/ext/session/tests/008-php4.2.3.phpt
new file mode 100644 (file)
index 0000000..2f542ec
--- /dev/null
@@ -0,0 +1,62 @@
+--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--
+session.use_cookies=0
+session.cache_limiter=
+register_globals=0
+session.bug_compat_42=1
+session.bug_compat_warn=0
+--FILE--
+<?php
+error_reporting(E_ALL & ~E_NOTICE);
+
+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;
+session_write_close();
+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--
+%s(%d) : Warning - 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.
+NULL
+array(1) {
+  ["c"]=>
+  float(3.14)
+}
+NULL
+array(1) {
+  ["c"]=>
+  float(3.14)
+}
index 2828a95e00f8d998ef647d66aee5c724db8a8691..044a6f2536eb3d18495c609b84733584e5536882 100644 (file)
@@ -1,7 +1,9 @@
 --TEST--
 bug compatibility: global is used albeit register_globals=0
 --SKIPIF--
-<?php include('skipif.inc'); ?>
+<?php include('skipif.inc'); 
+ if (version_compare(PHP_VERSION,"4.2.3-dev", ">=")) die("skip this is for PHP < 4.2.3");
+?>
 --INI--
 session.use_cookies=0
 session.cache_limiter=