summaryrefslogtreecommitdiff
path: root/sapi/cli/tests/bug64544.phpt
diff options
context:
space:
mode:
authorXinchen Hui <laruence@php.net>2013-03-29 23:42:50 +0800
committerXinchen Hui <laruence@php.net>2013-03-29 23:42:50 +0800
commit953f07503aa695009aab729370e458dc26784a8b (patch)
tree4dcc5a982ee8241a8c30258033594df0753b1d8c /sapi/cli/tests/bug64544.phpt
parentb2a760fe4564fc6f24e1596f3288617a12aa2c55 (diff)
downloadphp-git-953f07503aa695009aab729370e458dc26784a8b.tar.gz
Fixed bug #64544 (Valgrind warnings after using putenv)
The frozen_envion is needed, since if an item in environ is updated (like the test script HOME one), invalid free still shows up
Diffstat (limited to 'sapi/cli/tests/bug64544.phpt')
-rw-r--r--sapi/cli/tests/bug64544.phpt20
1 files changed, 20 insertions, 0 deletions
diff --git a/sapi/cli/tests/bug64544.phpt b/sapi/cli/tests/bug64544.phpt
new file mode 100644
index 0000000000..cc49545c16
--- /dev/null
+++ b/sapi/cli/tests/bug64544.phpt
@@ -0,0 +1,20 @@
+--TEST--
+Bug #64544 (Valgrind warnings after using putenv)
+--SKIPIF--
+<?php
+if (substr(PHP_OS, 0, 3) == "WIN") {
+ die("skip non windows test");
+}
+?>
+--FILE--
+<?php
+
+putenv("HOME=/tmp");
+var_dump(getenv("HOME"));
+
+putenv("FOO=BAR");
+var_dump(getenv("FOO"));
+?>
+--EXPECTF--
+string(4) "/tmp"
+string(3) "BAR"