summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/basic/024.phpt3
-rw-r--r--tests/basic/024_1.phpt29
-rw-r--r--tests/basic/026.phpt3
-rw-r--r--tests/basic/026_1.phpt16
-rw-r--r--tests/basic/bug67198.phpt42
-rw-r--r--tests/basic/enable_post_data_reading_01.phpt2
-rw-r--r--tests/basic/enable_post_data_reading_02.phpt7
-rw-r--r--tests/basic/enable_post_data_reading_03.phpt2
-rw-r--r--tests/basic/enable_post_data_reading_04.phpt2
-rw-r--r--tests/basic/enable_post_data_reading_05.phpt26
-rw-r--r--tests/basic/enable_post_data_reading_06.phpt271
-rw-r--r--tests/basic/encoding.phpt39
-rw-r--r--tests/classes/constants_error_002.phpt12
-rw-r--r--tests/func/010.phpt2
-rw-r--r--tests/run-test/test011.phpt6
-rw-r--r--tests/run-test/test011.txt1
-rw-r--r--tests/run-test/test012.phpt12
-rw-r--r--tests/run-test/test012.txt7
-rw-r--r--tests/run-test/test013.phpt6
-rw-r--r--tests/run-test/test013.txt1
20 files changed, 482 insertions, 7 deletions
diff --git a/tests/basic/024.phpt b/tests/basic/024.phpt
index bf8a206b3a..2e046c0cd8 100644
--- a/tests/basic/024.phpt
+++ b/tests/basic/024.phpt
@@ -10,6 +10,9 @@ a=ABC&y=XYZ&c[]=1&c[]=2&c[a]=3
var_dump($_POST, $HTTP_RAW_POST_DATA);
?>
--EXPECT--
+Deprecated: Automatically populating $HTTP_RAW_POST_DATA is deprecated and will be removed in a future version. To avoid this warning set 'always_populate_raw_post_data' to '-1' in php.ini and use the php://input stream instead. in Unknown on line 0
+
+Warning: Cannot modify header information - headers already sent in Unknown on line 0
array(3) {
["a"]=>
string(3) "ABC"
diff --git a/tests/basic/024_1.phpt b/tests/basic/024_1.phpt
new file mode 100644
index 0000000000..f98af82995
--- /dev/null
+++ b/tests/basic/024_1.phpt
@@ -0,0 +1,29 @@
+--TEST--
+Test HTTP_RAW_POST_DATA creation
+--INI--
+always_populate_raw_post_data=-1
+max_input_vars=1000
+--POST--
+a=ABC&y=XYZ&c[]=1&c[]=2&c[a]=3
+--FILE--
+<?php
+var_dump($_POST, $HTTP_RAW_POST_DATA);
+?>
+--EXPECTF--
+Notice: Undefined variable: HTTP_RAW_POST_DATA in %s on line %d
+array(3) {
+ ["a"]=>
+ string(3) "ABC"
+ ["y"]=>
+ string(3) "XYZ"
+ ["c"]=>
+ array(3) {
+ [0]=>
+ string(1) "1"
+ [1]=>
+ string(1) "2"
+ ["a"]=>
+ string(1) "3"
+ }
+}
+NULL
diff --git a/tests/basic/026.phpt b/tests/basic/026.phpt
index b98a31f430..a3e34f49f2 100644
--- a/tests/basic/026.phpt
+++ b/tests/basic/026.phpt
@@ -10,6 +10,9 @@ a=1&b=ZYX
var_dump($_POST, $HTTP_RAW_POST_DATA);
?>
--EXPECT--
+Deprecated: Automatically populating $HTTP_RAW_POST_DATA is deprecated and will be removed in a future version. To avoid this warning set 'always_populate_raw_post_data' to '-1' in php.ini and use the php://input stream instead. in Unknown on line 0
+
+Warning: Cannot modify header information - headers already sent in Unknown on line 0
array(0) {
}
string(9) "a=1&b=ZYX"
diff --git a/tests/basic/026_1.phpt b/tests/basic/026_1.phpt
new file mode 100644
index 0000000000..527a795f67
--- /dev/null
+++ b/tests/basic/026_1.phpt
@@ -0,0 +1,16 @@
+--TEST--
+Registration of HTTP_RAW_POST_DATA due to unknown content-type
+--INI--
+always_populate_raw_post_data=-1
+--POST_RAW--
+Content-Type: unknown/type
+a=1&b=ZYX
+--FILE--
+<?php
+var_dump($_POST, $HTTP_RAW_POST_DATA);
+?>
+--EXPECTF--
+Notice: Undefined variable: HTTP_RAW_POST_DATA in %s on line %d
+array(0) {
+}
+NULL
diff --git a/tests/basic/bug67198.phpt b/tests/basic/bug67198.phpt
new file mode 100644
index 0000000000..9e2e224509
--- /dev/null
+++ b/tests/basic/bug67198.phpt
@@ -0,0 +1,42 @@
+--TEST--
+php://input is empty when enable_post_data_reading=Off
+--INI--
+allow_url_fopen=1
+--SKIPIF--
+<?php
+include __DIR__."/../../sapi/cli/tests/skipif.inc";
+?>
+--FILE--
+<?php
+require __DIR__."/../../sapi/cli/tests/php_cli_server.inc";
+
+$code =
+<<<'FL'
+ if(!ini_get('enable_post_data_reading')){
+ if($_SERVER['REQUEST_METHOD']=='POST'){
+ exit(file_get_contents('php://input'));
+ }
+ }else{
+ exit('Please SET php.ini: enable_post_data_reading = Off');
+ }
+FL;
+
+$postdata = "PASS";
+
+$opts = array('http' =>
+ array(
+ 'method' => 'POST',
+ 'header' => 'Content-type: application/x-www-form-urlencoded',
+ 'content' => $postdata
+ )
+);
+
+$context = stream_context_create($opts);
+
+php_cli_server_start("exit(file_get_contents('php://input'));", false, "-d enable_post_data_reading=Off");
+
+var_dump(file_get_contents("http://" . PHP_CLI_SERVER_ADDRESS, false, $context));
+var_dump(file_get_contents("http://" . PHP_CLI_SERVER_ADDRESS, false, $context));
+--EXPECT--
+string(4) "PASS"
+string(4) "PASS"
diff --git a/tests/basic/enable_post_data_reading_01.phpt b/tests/basic/enable_post_data_reading_01.phpt
index 1a0e33f617..19ee5d583f 100644
--- a/tests/basic/enable_post_data_reading_01.phpt
+++ b/tests/basic/enable_post_data_reading_01.phpt
@@ -11,6 +11,7 @@ var_dump($_FILES);
var_dump($_POST);
var_dump($HTTP_RAW_POST_DATA);
var_dump(file_get_contents("php://input"));
+var_dump(file_get_contents("php://input"));
--EXPECTF--
array(0) {
}
@@ -20,3 +21,4 @@ array(0) {
Notice: Undefined variable: HTTP_RAW_POST_DATA in %s on line %d
NULL
string(9) "a=1&b=ZYX"
+string(9) "a=1&b=ZYX"
diff --git a/tests/basic/enable_post_data_reading_02.phpt b/tests/basic/enable_post_data_reading_02.phpt
index dc7f6b127a..4e1643ebd0 100644
--- a/tests/basic/enable_post_data_reading_02.phpt
+++ b/tests/basic/enable_post_data_reading_02.phpt
@@ -15,6 +15,7 @@ Content-Type: text/plain-file
var_dump($_FILES);
var_dump($_POST);
var_dump(file_get_contents("php://input"));
+var_dump(file_get_contents("php://input"));
--EXPECTF--
array(0) {
}
@@ -26,3 +27,9 @@ Content-Type: text/plain-file
1
-----------------------------20896060251896012921717172737--"
+string(%d) "-----------------------------20896060251896012921717172737
+Content-Disposition: form-data; name="file1"; filename="file1.txt"
+Content-Type: text/plain-file
+
+1
+-----------------------------20896060251896012921717172737--"
diff --git a/tests/basic/enable_post_data_reading_03.phpt b/tests/basic/enable_post_data_reading_03.phpt
index cdabe910ca..6a62282ea2 100644
--- a/tests/basic/enable_post_data_reading_03.phpt
+++ b/tests/basic/enable_post_data_reading_03.phpt
@@ -12,6 +12,7 @@ var_dump($_FILES);
var_dump($_POST);
var_dump($HTTP_RAW_POST_DATA);
var_dump(file_get_contents("php://input"));
+var_dump(file_get_contents("php://input"));
--EXPECTF--
array(0) {
}
@@ -21,3 +22,4 @@ array(0) {
Notice: Undefined variable: HTTP_RAW_POST_DATA in %s on line %d
NULL
string(9) "a=1&b=ZYX"
+string(9) "a=1&b=ZYX"
diff --git a/tests/basic/enable_post_data_reading_04.phpt b/tests/basic/enable_post_data_reading_04.phpt
index a1685040bb..a7c7e496d8 100644
--- a/tests/basic/enable_post_data_reading_04.phpt
+++ b/tests/basic/enable_post_data_reading_04.phpt
@@ -12,6 +12,7 @@ var_dump($_FILES);
var_dump($_POST);
var_dump($HTTP_RAW_POST_DATA);
var_dump(file_get_contents("php://input"));
+var_dump(file_get_contents("php://input"));
--EXPECTF--
array(0) {
}
@@ -21,3 +22,4 @@ array(0) {
Notice: Undefined variable: HTTP_RAW_POST_DATA in %s on line %d
NULL
string(9) "a=1&b=ZYX"
+string(9) "a=1&b=ZYX"
diff --git a/tests/basic/enable_post_data_reading_05.phpt b/tests/basic/enable_post_data_reading_05.phpt
new file mode 100644
index 0000000000..d8efa0129e
--- /dev/null
+++ b/tests/basic/enable_post_data_reading_05.phpt
@@ -0,0 +1,26 @@
+--TEST--
+enable_post_data_reading: using multiple input streams
+--INI--
+enable_post_data_reading=0
+max_execution_time=2
+--POST_RAW--
+Content-Type: application/unknown
+One line of data
+--FILE--
+<?php
+echo "Test\n";
+
+$f1 = fopen("php://input", "r");
+$f2 = fopen("php://input", "r");
+
+while (!feof($f1) && !feof($f2)) {
+ echo fgetc($f1), fgetc($f2);
+}
+
+?>
+
+Done
+--EXPECT--
+Test
+OOnnee lliinnee ooff ddaattaa
+Done
diff --git a/tests/basic/enable_post_data_reading_06.phpt b/tests/basic/enable_post_data_reading_06.phpt
new file mode 100644
index 0000000000..fbed195c03
--- /dev/null
+++ b/tests/basic/enable_post_data_reading_06.phpt
@@ -0,0 +1,271 @@
+--TEST--
+enable_post_data_reading: using multiple input streams (more than 8k data)
+--INI--
+enable_post_data_reading=0
+--POST_RAW--
+Content-Type: application/unknown
+0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789
+0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789
+0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789
+0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789
+0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789
+0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789
+0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789
+0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789
+0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789
+0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789
+0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789
+0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789
+0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789
+0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789
+0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789
+0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789
+0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789
+0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789
+0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789
+0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789
+0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789
+0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789
+0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789
+0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789
+0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789
+0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789
+0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789
+0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789
+0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789
+0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789
+0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789
+0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789
+0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789
+0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789
+0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789
+0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789
+0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789
+0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789
+0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789
+0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789
+0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789
+0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789
+0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789
+0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789
+0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789
+0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789
+0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789
+0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789
+0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789
+0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789
+0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789
+0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789
+0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789
+0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789
+0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789
+0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789
+0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789
+0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789
+0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789
+0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789
+0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789
+0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789
+0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789
+0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789
+0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789
+0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789
+0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789
+0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789
+0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789
+0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789
+0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789
+0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789
+0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789
+0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789
+0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789
+0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789
+0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789
+0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789
+0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789
+0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789
+0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789
+0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789
+.
+--FILE--
+<?php
+echo "Test\n";
+
+$f1 = fopen("php://input", "r");
+$f2 = fopen("php://input", "r");
+
+while (!feof($f1) && !feof($f2)) {
+ echo fgets($f1), fgets($f2);
+}
+
+?>
+
+Done
+--EXPECT--
+Test
+0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789
+0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789
+0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789
+0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789
+0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789
+0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789
+0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789
+0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789
+0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789
+0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789
+0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789
+0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789
+0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789
+0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789
+0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789
+0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789
+0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789
+0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789
+0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789
+0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789
+0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789
+0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789
+0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789
+0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789
+0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789
+0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789
+0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789
+0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789
+0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789
+0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789
+0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789
+0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789
+0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789
+0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789
+0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789
+0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789
+0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789
+0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789
+0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789
+0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789
+0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789
+0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789
+0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789
+0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789
+0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789
+0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789
+0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789
+0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789
+0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789
+0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789
+0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789
+0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789
+0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789
+0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789
+0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789
+0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789
+0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789
+0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789
+0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789
+0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789
+0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789
+0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789
+0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789
+0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789
+0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789
+0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789
+0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789
+0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789
+0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789
+0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789
+0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789
+0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789
+0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789
+0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789
+0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789
+0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789
+0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789
+0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789
+0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789
+0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789
+0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789
+0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789
+0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789
+0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789
+0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789
+0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789
+0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789
+0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789
+0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789
+0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789
+0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789
+0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789
+0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789
+0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789
+0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789
+0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789
+0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789
+0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789
+0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789
+0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789
+0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789
+0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789
+0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789
+0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789
+0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789
+0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789
+0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789
+0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789
+0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789
+0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789
+0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789
+0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789
+0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789
+0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789
+0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789
+0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789
+0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789
+0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789
+0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789
+0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789
+0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789
+0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789
+0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789
+0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789
+0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789
+0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789
+0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789
+0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789
+0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789
+0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789
+0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789
+0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789
+0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789
+0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789
+0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789
+0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789
+0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789
+0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789
+0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789
+0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789
+0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789
+0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789
+0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789
+0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789
+0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789
+0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789
+0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789
+0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789
+0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789
+0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789
+0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789
+0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789
+0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789
+0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789
+0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789
+0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789
+0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789
+0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789
+0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789
+0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789
+0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789
+0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789
+0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789
+0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789
+..
+Done
diff --git a/tests/basic/encoding.phpt b/tests/basic/encoding.phpt
new file mode 100644
index 0000000000..b2ee5f3ca2
--- /dev/null
+++ b/tests/basic/encoding.phpt
@@ -0,0 +1,39 @@
+--TEST--
+PHP encoding setting test
+--INI--
+--FILE--
+<?php
+var_dump(ini_get('default_charset'));
+var_dump(ini_get('input_encoding'));
+var_dump(ini_get('internal_encoding'));
+var_dump(ini_get('output_encoding'));
+
+var_dump(ini_set('default_charset', 'ISO-8859-1'));
+var_dump(ini_get('default_charset'));
+var_dump(ini_get('input_encoding'));
+var_dump(ini_get('internal_encoding'));
+var_dump(ini_get('output_encoding'));
+
+var_dump(ini_set('input_encoding', 'ISO-8859-1'));
+var_dump(ini_set('internal_encoding', 'ISO-8859-1'));
+var_dump(ini_set('output_encoding', 'ISO-8859-1'));
+var_dump(ini_get('input_encoding'));
+var_dump(ini_get('internal_encoding'));
+var_dump(ini_get('output_encoding'));
+
+--EXPECTF--
+string(5) "UTF-8"
+string(0) ""
+string(0) ""
+string(0) ""
+string(5) "UTF-8"
+string(10) "ISO-8859-1"
+string(0) ""
+string(0) ""
+string(0) ""
+string(0) ""
+string(0) ""
+string(0) ""
+string(10) "ISO-8859-1"
+string(10) "ISO-8859-1"
+string(10) "ISO-8859-1" \ No newline at end of file
diff --git a/tests/classes/constants_error_002.phpt b/tests/classes/constants_error_002.phpt
index be27971b87..610a42da9b 100644
--- a/tests/classes/constants_error_002.phpt
+++ b/tests/classes/constants_error_002.phpt
@@ -2,11 +2,11 @@
Error case: class constant as an array
--FILE--
<?php
- class myclass
- {
- const myConst = array();
- }
+class myclass
+{
+ const myConst = array();
+}
?>
+===DONE===
--EXPECTF--
-
-Fatal error: Arrays are not allowed in class constants in %s on line 4
+===DONE===
diff --git a/tests/func/010.phpt b/tests/func/010.phpt
index f970283dc4..6d5c30c9ee 100644
--- a/tests/func/010.phpt
+++ b/tests/func/010.phpt
@@ -8,7 +8,7 @@ if (getenv("SKIP_SLOW_TESTS")) die("skip slow test");
<?php
// the stack size + some random constant
-$boundary = 64*1024;
+$boundary = 16*1024-16;
$limit = $boundary+42;
diff --git a/tests/run-test/test011.phpt b/tests/run-test/test011.phpt
new file mode 100644
index 0000000000..17f1f7aee6
--- /dev/null
+++ b/tests/run-test/test011.phpt
@@ -0,0 +1,6 @@
+--TEST--
+EXPECT_EXTERNAL
+--FILE--
+abc
+--EXPECT_EXTERNAL--
+test011.txt
diff --git a/tests/run-test/test011.txt b/tests/run-test/test011.txt
new file mode 100644
index 0000000000..8baef1b4ab
--- /dev/null
+++ b/tests/run-test/test011.txt
@@ -0,0 +1 @@
+abc
diff --git a/tests/run-test/test012.phpt b/tests/run-test/test012.phpt
new file mode 100644
index 0000000000..8213aa2a56
--- /dev/null
+++ b/tests/run-test/test012.phpt
@@ -0,0 +1,12 @@
+--TEST--
+EXPECTF_EXTERNAL
+--FILE--
+123
+-123
++123
++1.1
+abc
+0abc
+x
+--EXPECTF_EXTERNAL--
+test012.txt
diff --git a/tests/run-test/test012.txt b/tests/run-test/test012.txt
new file mode 100644
index 0000000000..bb293214b1
--- /dev/null
+++ b/tests/run-test/test012.txt
@@ -0,0 +1,7 @@
+%d
+%i
+%i
+%f
+%s
+%x
+%c
diff --git a/tests/run-test/test013.phpt b/tests/run-test/test013.phpt
new file mode 100644
index 0000000000..79ccd20de2
--- /dev/null
+++ b/tests/run-test/test013.phpt
@@ -0,0 +1,6 @@
+--TEST--
+EXPECTREGEX_EXTERNAL
+--FILE--
+abcde12314235xyz34264768286abcde
+--EXPECTREGEX_EXTERNAL--
+test013.txt
diff --git a/tests/run-test/test013.txt b/tests/run-test/test013.txt
new file mode 100644
index 0000000000..6c280ece4d
--- /dev/null
+++ b/tests/run-test/test013.txt
@@ -0,0 +1 @@
+[abcde]+[0-5]*xyz[2-8]+abcde