diff options
Diffstat (limited to 'tests')
83 files changed, 660 insertions, 745 deletions
diff --git a/tests/basic/011.phpt b/tests/basic/011.phpt index 2ec7a6ed12..79256746fe 100644 --- a/tests/basic/011.phpt +++ b/tests/basic/011.phpt @@ -6,11 +6,8 @@ register_argc_argv=1 ab+cd+ef+123+test --FILE-- <?php - -if (!ini_get('register_globals')) { - $argc = $_SERVER['argc']; - $argv = $_SERVER['argv']; -} +$argc = $_SERVER['argc']; +$argv = $_SERVER['argv']; for ($i=0; $i<$argc; $i++) { echo "$i: ".$argv[$i]."\n"; diff --git a/tests/basic/012.phpt b/tests/basic/012.phpt index 3297853286..5c10c7c222 100644 --- a/tests/basic/012.phpt +++ b/tests/basic/012.phpt @@ -9,11 +9,8 @@ variables_order=GPS ab cd ef 123 test --FILE-- <?php - -if (!ini_get('register_globals')) { - $argc = $_SERVER['argc']; - $argv = $_SERVER['argv']; -} +$argc = $_SERVER['argc']; +$argv = $_SERVER['argv']; for ($i=1; $i<$argc; $i++) { echo ($i-1).": ".$argv[$i]."\n"; diff --git a/tests/basic/022.phpt b/tests/basic/022.phpt index 64314ee9ee..0ab70d4be7 100644 --- a/tests/basic/022.phpt +++ b/tests/basic/022.phpt @@ -2,6 +2,7 @@ Cookies test#1 --INI-- max_input_vars=1000 +filter.default=unsafe_raw --COOKIE-- cookie1=val1 ; cookie2=val2%20; cookie3=val 3.; cookie 4= value 4 %3B; cookie1=bogus; %20cookie1=ignore;+cookie1=ignore;cookie1;cookie 5=%20 value; cookie%206=þæö;cookie+7=;$cookie.8;cookie-9=1;;;- & % $cookie 10=10 --FILE-- diff --git a/tests/basic/023.phpt b/tests/basic/023.phpt index ddbcbae005..ca5f1dcfbb 100644 --- a/tests/basic/023.phpt +++ b/tests/basic/023.phpt @@ -1,8 +1,8 @@ --TEST-- Cookies test#2 --INI-- -magic_quotes_gpc=0 max_input_vars=1000 +filter.default=unsafe_raw --COOKIE-- c o o k i e=value; c o o k i e= v a l u e ;;c%20o+o k+i%20e=v;name="value","value",UEhQIQ==;UEhQIQ==foo --FILE-- diff --git a/tests/basic/024.phpt b/tests/basic/024.phpt index a28470914b..bf8a206b3a 100644 --- a/tests/basic/024.phpt +++ b/tests/basic/024.phpt @@ -1,7 +1,6 @@ --TEST-- Test HTTP_RAW_POST_DATA creation --INI-- -magic_quotes_gpc=0 always_populate_raw_post_data=1 max_input_vars=1000 --POST-- diff --git a/tests/basic/025.phpt b/tests/basic/025.phpt index bafcac8091..58191bcd61 100644 --- a/tests/basic/025.phpt +++ b/tests/basic/025.phpt @@ -1,7 +1,6 @@ --TEST-- Test HTTP_RAW_POST_DATA with excessive post length --INI-- -magic_quotes_gpc=0 always_populate_raw_post_data=1 post_max_size=1K --POST-- diff --git a/tests/basic/026.phpt b/tests/basic/026.phpt index 957aa1972c..b98a31f430 100644 --- a/tests/basic/026.phpt +++ b/tests/basic/026.phpt @@ -1,7 +1,6 @@ --TEST-- Registration of HTTP_RAW_POST_DATA due to unknown content-type --INI-- -magic_quotes_gpc=0 always_populate_raw_post_data=0 --POST_RAW-- Content-Type: unknown/type diff --git a/tests/basic/027.phpt b/tests/basic/027.phpt index db8efbf95a..0528e835a1 100644 --- a/tests/basic/027.phpt +++ b/tests/basic/027.phpt @@ -1,7 +1,6 @@ --TEST-- Handling of max_input_nesting_level being reached --INI-- -magic_quotes_gpc=0 always_populate_raw_post_data=0 display_errors=0 max_input_nesting_level=10 diff --git a/tests/basic/028.phpt b/tests/basic/028.phpt new file mode 100644 index 0000000000..37d6f21a06 --- /dev/null +++ b/tests/basic/028.phpt @@ -0,0 +1,105 @@ +--TEST-- +RFC1867 character quotting +--INI-- +file_uploads=1 +max_input_vars=1000 +--POST_RAW-- +Content-Type: multipart/form-data; boundary=---------------------------20896060251896012921717172737 +-----------------------------20896060251896012921717172737 +Content-Disposition: form-data; name=name1 + +testname +-----------------------------20896060251896012921717172737 +Content-Disposition: form-data; name='name2' + +testname +-----------------------------20896060251896012921717172737 +Content-Disposition: form-data; name="name3" + +testname +-----------------------------20896060251896012921717172737 +Content-Disposition: form-data; name=name\4 + +testname +-----------------------------20896060251896012921717172737 +Content-Disposition: form-data; name=name\\5 + +testname +-----------------------------20896060251896012921717172737 +Content-Disposition: form-data; name=name\'6 + +testname +-----------------------------20896060251896012921717172737 +Content-Disposition: form-data; name=name\"7 + +testname +-----------------------------20896060251896012921717172737 +Content-Disposition: form-data; name='name\8' + +testname +-----------------------------20896060251896012921717172737 +Content-Disposition: form-data; name='name\\9' + +testname +-----------------------------20896060251896012921717172737 +Content-Disposition: form-data; name='name\'10' + +testname +-----------------------------20896060251896012921717172737 +Content-Disposition: form-data; name='name\"11' + +testname +-----------------------------20896060251896012921717172737 +Content-Disposition: form-data; name="name\12" + +testname +-----------------------------20896060251896012921717172737 +Content-Disposition: form-data; name="name\\13" + +testname +-----------------------------20896060251896012921717172737 +Content-Disposition: form-data; name="name\'14" + +testname +-----------------------------20896060251896012921717172737 +Content-Disposition: form-data; name="name\"15" + +testname +-----------------------------20896060251896012921717172737-- +--FILE-- +<?php +var_dump($_POST); +?> +--EXPECT-- +array(15) { + ["name1"]=> + string(8) "testname" + ["name2"]=> + string(8) "testname" + ["name3"]=> + string(8) "testname" + ["name\4"]=> + string(8) "testname" + ["name\5"]=> + string(8) "testname" + ["name\'6"]=> + string(8) "testname" + ["name\"7"]=> + string(8) "testname" + ["name\8"]=> + string(8) "testname" + ["name\9"]=> + string(8) "testname" + ["name'10"]=> + string(8) "testname" + ["name\"11"]=> + string(8) "testname" + ["name\12"]=> + string(8) "testname" + ["name\13"]=> + string(8) "testname" + ["name\'14"]=> + string(8) "testname" + ["name"15"]=> + string(8) "testname" +} diff --git a/tests/basic/029.phpt b/tests/basic/029.phpt new file mode 100644 index 0000000000..6d95c0771d --- /dev/null +++ b/tests/basic/029.phpt @@ -0,0 +1,51 @@ +--TEST-- +Shift_JIS request +--SKIPIF-- +<?php +if (!extension_loaded("mbstring")) { + die("skip Requires mbstring extension"); +} +?> +--INI-- +file_uploads=1 +mbstring.encoding_translation=1 +mbstring.http_input=Shift_JIS +mbstring.internal_encoding=UTF-8 +--POST_RAW-- +Content-Type: multipart/form-data; boundary=---------------------------20896060251896012921717172737 +-----------------------------20896060251896012921717172737 +Content-Disposition: form-data; name="—\Ž\”\" + +ƒhƒŒƒ~ƒtƒ@ƒ\ +-----------------------------20896060251896012921717172737 +Content-Disposition: form-data; name="pics"; filename="file1.txt" +Content-Type: text/plain + +file1 + +-----------------------------20896060251896012921717172737-- +--FILE-- +<?php +var_dump($_FILES); +var_dump($_POST); +?> +--EXPECTF-- +array(1) { + ["pics"]=> + array(5) { + ["name"]=> + string(9) "file1.txt" + ["type"]=> + string(10) "text/plain" + ["tmp_name"]=> + string(%d) "%s" + ["error"]=> + int(0) + ["size"]=> + int(6) + } +} +array(1) { + ["予蚕能"]=> + string(18) "ドレミファソ" +} diff --git a/tests/basic/bug46313-win.phpt b/tests/basic/bug46313-win.phpt deleted file mode 100644 index 87786d44ea..0000000000 --- a/tests/basic/bug46313-win.phpt +++ /dev/null @@ -1,64 +0,0 @@ ---TEST-- -Bug #46313 (Magic quotes broke $_FILES) ---SKIPIF-- -<?php if(substr(PHP_OS, 0, 3) != "WIN") die("skip Windows-only test"); ?> ---INI-- -magic_quotes_gpc=1 -file_uploads=1 -register_globals=1 ---POST_RAW-- -Content-Type: multipart/form-data; boundary=---------------------------20896060251896012921717172737 ------------------------------20896060251896012921717172737 -Content-Disposition: form-data; name="o1'file"; filename="o1'file.png" -Content-Type: text/plain-file1 - -1 ------------------------------20896060251896012921717172737 -Content-Disposition: form-data; name="o2'file"; filename="o2'file2.txt" -Content-Type: text/plain-file2 - -2 ------------------------------20896060251896012921717172737-- ---FILE-- -<?php -var_dump($_FILES); -var_dump($GLOBALS["o1\'file_name"]); -var_dump($GLOBALS["o1\'file_name"] === $_FILES["o1\'file"]["name"]); -var_dump($GLOBALS["o1\'file"]); -var_dump($GLOBALS["o1\'file"] === $_FILES["o1\'file"]["tmp_name"]); -?> ---EXPECTF-- -Deprecated: Directive 'register_globals' is deprecated in PHP 5.3 and greater in Unknown on line 0 -Deprecated: Directive 'magic_quotes_gpc' is deprecated in PHP 5.3 and greater in Unknown on line 0 -array(2) { - ["o1\'file"]=> - array(5) { - ["name"]=> - string(12) "o1" - ["type"]=> - string(16) "text/plain-file1" - ["tmp_name"]=> - string(14) "%s" - ["error"]=> - int(0) - ["size"]=> - int(1) - } - ["o2\'file"]=> - array(5) { - ["name"]=> - string(13) "o2" - ["type"]=> - string(16) "text/plain-file2" - ["tmp_name"]=> - string(14) "%s" - ["error"]=> - int(0) - ["size"]=> - int(1) - } -} -string(12) "o1" -bool(true) -string(%d) "%s" -bool(true) diff --git a/tests/basic/bug46313.phpt b/tests/basic/bug46313.phpt deleted file mode 100644 index 924114161e..0000000000 --- a/tests/basic/bug46313.phpt +++ /dev/null @@ -1,63 +0,0 @@ ---TEST-- -Bug #46313 (Magic quotes broke $_FILES) ---SKIPIF-- -<?php if(substr(PHP_OS, 0, 3) == "WIN") die("skip non-Windows test"); ?> ---INI-- -magic_quotes_gpc=1 -file_uploads=1 -register_globals=1 -display_errors=0 ---POST_RAW-- -Content-Type: multipart/form-data; boundary=---------------------------20896060251896012921717172737 ------------------------------20896060251896012921717172737 -Content-Disposition: form-data; name="o1'file"; filename="o1'file.png" -Content-Type: text/plain-file1 - -1 ------------------------------20896060251896012921717172737 -Content-Disposition: form-data; name="o2'file"; filename="o2'file2.txt" -Content-Type: text/plain-file2 - -2 ------------------------------20896060251896012921717172737-- ---FILE-- -<?php -var_dump($_FILES); -var_dump($GLOBALS["o1\'file_name"]); -var_dump($GLOBALS["o1\'file_name"] === $_FILES["o1\'file"]["name"]); -var_dump($GLOBALS["o1\'file"]); -var_dump($GLOBALS["o1\'file"] === $_FILES["o1\'file"]["tmp_name"]); -?> ---EXPECTF-- -array(2) { - ["o1\'file"]=> - array(5) { - ["name"]=> - string(12) "o1\'file.png" - ["type"]=> - string(16) "text/plain-file1" - ["tmp_name"]=> - string(%d) "%s" - ["error"]=> - int(0) - ["size"]=> - int(1) - } - ["o2\'file"]=> - array(5) { - ["name"]=> - string(13) "o2\'file2.txt" - ["type"]=> - string(16) "text/plain-file2" - ["tmp_name"]=> - string(%d) "%s" - ["error"]=> - int(0) - ["size"]=> - int(1) - } -} -string(12) "o1\'file.png" -bool(true) -string(%d) "%s" -bool(true) diff --git a/tests/basic/bug46759.phpt b/tests/basic/bug46759.phpt deleted file mode 100644 index d35cd534c2..0000000000 --- a/tests/basic/bug46759.phpt +++ /dev/null @@ -1,20 +0,0 @@ ---TEST-- -Testing magic_quotes_gpc ---INI-- -display_errors=0 -magic_quotes_gpc=1 ---GET-- -a='&b="&c=\" ---FILE-- -<?php - -foreach ($_GET AS $key => $value) -{ - echo $key . ": " . $value . "\n"; -} - -?> ---EXPECT-- -a: \' -b: \" -c: \\\" diff --git a/tests/basic/bug51709_1.phpt b/tests/basic/bug51709_1.phpt index 8abb92555d..3f2d544e54 100644 --- a/tests/basic/bug51709_1.phpt +++ b/tests/basic/bug51709_1.phpt @@ -13,4 +13,4 @@ class foo { ===DONE=== <?php exit(0); ?> --EXPECTF-- -Parse error: syntax error, unexpected T_FOR, expecting T_STRING in %sbug51709_1.php on line %d +Parse error: syntax error, unexpected %s, expecting %s in %sbug51709_1.php on line %d diff --git a/tests/basic/bug51709_2.phpt b/tests/basic/bug51709_2.phpt index 7763cafe52..bb1f91cc4c 100644 --- a/tests/basic/bug51709_2.phpt +++ b/tests/basic/bug51709_2.phpt @@ -13,4 +13,4 @@ class foo { ===DONE=== <?php exit(0); ?> --EXPECTF-- -Parse error: syntax error, unexpected T_GOTO, expecting T_STRING in %sbug51709_2.php on line %d +Parse error: syntax error, unexpected %s, expecting %s in %sbug51709_2.php on line %d diff --git a/tests/basic/bug54514.phpt b/tests/basic/bug54514.phpt new file mode 100644 index 0000000000..0c5595e3f7 --- /dev/null +++ b/tests/basic/bug54514.phpt @@ -0,0 +1,12 @@ +--TEST-- +Req #54514 (Get php binary path during script execution) +--FILE-- +<?php +if(realpath(getenv('TEST_PHP_EXECUTABLE')) === realpath(PHP_BINARY)) { + echo "done"; +} else { + var_dump(getenv('TEST_PHP_EXECUTABLE')); + var_dump(PHP_BINARY); +} +--EXPECT-- +done diff --git a/tests/basic/enable_post_data_reading_01.phpt b/tests/basic/enable_post_data_reading_01.phpt new file mode 100644 index 0000000000..1a0e33f617 --- /dev/null +++ b/tests/basic/enable_post_data_reading_01.phpt @@ -0,0 +1,22 @@ +--TEST-- +enable_post_data_reading: basic test +--INI-- +enable_post_data_reading=0 +--POST_RAW-- +Content-Type: application/x-www-form-urlencoded +a=1&b=ZYX +--FILE-- +<?php +var_dump($_FILES); +var_dump($_POST); +var_dump($HTTP_RAW_POST_DATA); +var_dump(file_get_contents("php://input")); +--EXPECTF-- +array(0) { +} +array(0) { +} + +Notice: Undefined variable: HTTP_RAW_POST_DATA in %s on line %d +NULL +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 new file mode 100644 index 0000000000..dc7f6b127a --- /dev/null +++ b/tests/basic/enable_post_data_reading_02.phpt @@ -0,0 +1,28 @@ +--TEST-- +enable_post_data_reading: rfc1867 +--INI-- +enable_post_data_reading=0 +--POST_RAW-- +Content-Type: multipart/form-data; boundary=---------------------------20896060251896012921717172737 +-----------------------------20896060251896012921717172737 +Content-Disposition: form-data; name="file1"; filename="file1.txt" +Content-Type: text/plain-file + +1 +-----------------------------20896060251896012921717172737-- +--FILE-- +<?php +var_dump($_FILES); +var_dump($_POST); +var_dump(file_get_contents("php://input")); +--EXPECTF-- +array(0) { +} +array(0) { +} +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 new file mode 100644 index 0000000000..cdabe910ca --- /dev/null +++ b/tests/basic/enable_post_data_reading_03.phpt @@ -0,0 +1,23 @@ +--TEST-- +enable_post_data_reading: always_populate_raw_post_data has no effect (1) +--INI-- +enable_post_data_reading=0 +always_populate_raw_post_data=1 +--POST_RAW-- +Content-Type: application/x-www-form-urlencoded +a=1&b=ZYX +--FILE-- +<?php +var_dump($_FILES); +var_dump($_POST); +var_dump($HTTP_RAW_POST_DATA); +var_dump(file_get_contents("php://input")); +--EXPECTF-- +array(0) { +} +array(0) { +} + +Notice: Undefined variable: HTTP_RAW_POST_DATA in %s on line %d +NULL +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 new file mode 100644 index 0000000000..a1685040bb --- /dev/null +++ b/tests/basic/enable_post_data_reading_04.phpt @@ -0,0 +1,23 @@ +--TEST-- +enable_post_data_reading: always_populate_raw_post_data has no effect (2) +--INI-- +enable_post_data_reading=0 +always_populate_raw_post_data=1 +--POST_RAW-- +Content-Type: application/unknown +a=1&b=ZYX +--FILE-- +<?php +var_dump($_FILES); +var_dump($_POST); +var_dump($HTTP_RAW_POST_DATA); +var_dump(file_get_contents("php://input")); +--EXPECTF-- +array(0) { +} +array(0) { +} + +Notice: Undefined variable: HTTP_RAW_POST_DATA in %s on line %d +NULL +string(9) "a=1&b=ZYX" diff --git a/tests/basic/magic_quotes_gpc.phpt b/tests/basic/magic_quotes_gpc.phpt deleted file mode 100644 index 0be6533b78..0000000000 --- a/tests/basic/magic_quotes_gpc.phpt +++ /dev/null @@ -1,11 +0,0 @@ ---TEST-- -Bug #61043 (Regression in magic_quotes_gpc fix for CVE-2012-0831) ---INI-- -error_reporting=E_ALL & ~E_DEPRECATED -magic_quotes_gpc=On ---FILE-- -<?php -var_dump(ini_get("magic_quotes_gpc")); -?> ---EXPECT-- -string(1) "1" diff --git a/tests/basic/req44164.phpt b/tests/basic/req44164.phpt new file mode 100644 index 0000000000..d0082861f2 --- /dev/null +++ b/tests/basic/req44164.phpt @@ -0,0 +1,17 @@ +--TEST--
+Req #44164 (Handle "Content-Length" HTTP header when zlib.output_compression active)
+--SKIPIF--
+<?php
+if (!function_exists('gzdeflate'))
+ die("skip zlib extension required");
+?>
+--INI--
+zlib.output_compression=On
+--ENV--
+HTTP_ACCEPT_ENCODING=gzip
+--FILE--
+<?php
+header("Content-length: 200");
+echo str_repeat("a", 200);
+--EXPECT--
+aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
diff --git a/tests/classes/array_access_010.phpt b/tests/classes/array_access_010.phpt index e60716dc1b..ad374d278c 100755 --- a/tests/classes/array_access_010.phpt +++ b/tests/classes/array_access_010.phpt @@ -12,7 +12,7 @@ class ArrayReferenceProxy implements ArrayAccess function __construct(ArrayAccess $object, array &$element) { - echo __METHOD__ . "($element)\n"; + echo __METHOD__ . "(Array)\n"; $this->object = $object; $this->element = &$element; } @@ -23,17 +23,17 @@ class ArrayReferenceProxy implements ArrayAccess } function offsetGet($index) { - echo __METHOD__ . "($this->element, $index)\n"; + echo __METHOD__ . "(Array, $index)\n"; return isset($this->element[$index]) ? $this->element[$index] : NULL; } function offsetSet($index, $value) { - echo __METHOD__ . "($this->element, $index, $value)\n"; + echo __METHOD__ . "(Array, $index, $value)\n"; $this->element[$index] = $value; } function offsetUnset($index) { - echo __METHOD__ . "($this->element, $index)\n"; + echo __METHOD__ . "(Array, $index)\n"; unset($this->element[$index]); } } diff --git a/tests/classes/ctor_in_interface_01.phpt b/tests/classes/ctor_in_interface_01.phpt index f6f9b66eab..e5ad30ebcd 100755 --- a/tests/classes/ctor_in_interface_01.phpt +++ b/tests/classes/ctor_in_interface_01.phpt @@ -16,4 +16,4 @@ class implem implements constr ?> --EXPECTF-- -Fatal error: Declaration of implem::__construct() must be compatible with that of constr::__construct() in %s on line %d +Fatal error: Declaration of implem::__construct() must be compatible with constr::__construct() in %s on line %d diff --git a/tests/classes/ctor_in_interface_02.phpt b/tests/classes/ctor_in_interface_02.phpt index ad9fac3892..08e6f36e0e 100755 --- a/tests/classes/ctor_in_interface_02.phpt +++ b/tests/classes/ctor_in_interface_02.phpt @@ -29,7 +29,6 @@ class implem13 implements constr1, constr3 { } } - ?> --EXPECTF-- -Fatal error: Declaration of implem13::__construct() must be compatible with that of constr3::__construct() in %sctor_in_interface_02.php on line %d +Fatal error: Declaration of implem13::__construct() must be compatible with constr3::__construct($a) in %s on line %d diff --git a/tests/classes/ctor_in_interface_03.phpt b/tests/classes/ctor_in_interface_03.phpt index 953d6822fd..ac73331207 100755 --- a/tests/classes/ctor_in_interface_03.phpt +++ b/tests/classes/ctor_in_interface_03.phpt @@ -20,4 +20,4 @@ class derived extends implem ?> --EXPECTF-- -Fatal error: Declaration of derived::__construct() must be compatible with that of constr::__construct() in %s on line %d +Fatal error: Declaration of derived::__construct() must be compatible with constr::__construct() in %s on line %d diff --git a/tests/classes/ctor_in_interface_04.phpt b/tests/classes/ctor_in_interface_04.phpt index 0016244c18..94be655b83 100755 --- a/tests/classes/ctor_in_interface_04.phpt +++ b/tests/classes/ctor_in_interface_04.phpt @@ -23,4 +23,4 @@ class derived extends implem ?> --EXPECTF-- -Fatal error: Declaration of derived::__construct() must be compatible with that of constr::__construct() in %s on line %d +Fatal error: Declaration of derived::__construct() must be compatible with constr::__construct() in %s on line %d diff --git a/tests/classes/implicit_instantiation_001.phpt b/tests/classes/implicit_instantiation_001.phpt index 460cdc97f2..8d2f32da21 100644 --- a/tests/classes/implicit_instantiation_001.phpt +++ b/tests/classes/implicit_instantiation_001.phpt @@ -39,43 +39,43 @@ var_dump($c); ---( $c->boolFalse )--- --> Attempting implicit conversion to object using increment... -Strict Standards: Creating default object from empty value in %s on line 18 +Warning: Creating default object from empty value in %s on line 18 --> Attempting implicit conversion to object using assignment... -Strict Standards: Creating default object from empty value in %s on line 22 +Warning: Creating default object from empty value in %s on line 22 --> Attempting implicit conversion to object using combined assignment... -Strict Standards: Creating default object from empty value in %s on line 26 +Warning: Creating default object from empty value in %s on line 26 ---( $c->emptyString )--- --> Attempting implicit conversion to object using increment... -Strict Standards: Creating default object from empty value in %s on line 18 +Warning: Creating default object from empty value in %s on line 18 --> Attempting implicit conversion to object using assignment... -Strict Standards: Creating default object from empty value in %s on line 22 +Warning: Creating default object from empty value in %s on line 22 --> Attempting implicit conversion to object using combined assignment... -Strict Standards: Creating default object from empty value in %s on line 26 +Warning: Creating default object from empty value in %s on line 26 ---( $c->null )--- --> Attempting implicit conversion to object using increment... -Strict Standards: Creating default object from empty value in %s on line 18 +Warning: Creating default object from empty value in %s on line 18 --> Attempting implicit conversion to object using assignment... -Strict Standards: Creating default object from empty value in %s on line 22 +Warning: Creating default object from empty value in %s on line 22 --> Attempting implicit conversion to object using combined assignment... -Strict Standards: Creating default object from empty value in %s on line 26 +Warning: Creating default object from empty value in %s on line 26 ---( $c->boolTrue )--- diff --git a/tests/classes/inheritance_003.phpt b/tests/classes/inheritance_003.phpt index a22e5cce58..1f4eafa537 100755 --- a/tests/classes/inheritance_003.phpt +++ b/tests/classes/inheritance_003.phpt @@ -17,5 +17,5 @@ class B extends A ===DONE=== --EXPECTF-- -Strict Standards: Declaration of B::f() should be compatible with that of A::f() in %sinheritance_003.php on line %d +Strict Standards: Declaration of B::f() should be compatible with A::f($x) in %sinheritance_003.php on line %d ===DONE=== diff --git a/tests/classes/inheritance_004.phpt b/tests/classes/inheritance_004.phpt index 9c81970cc2..d1f5faf5da 100755 --- a/tests/classes/inheritance_004.phpt +++ b/tests/classes/inheritance_004.phpt @@ -17,5 +17,5 @@ class B extends A ===DONE=== --EXPECTF-- -Strict Standards: Declaration of B::f() should be compatible with that of A::f() in %sinheritance_004.php on line %d +Strict Standards: Declaration of B::f() should be compatible with A::f() in %sinheritance_004.php on line %d ===DONE=== diff --git a/tests/classes/is_a.phpt b/tests/classes/is_a.phpt deleted file mode 100644 index 832d5550f1..0000000000 --- a/tests/classes/is_a.phpt +++ /dev/null @@ -1,378 +0,0 @@ ---TEST-- -is_a and is_subclass_of behaviour (with and without autoload) ---SKIPIF-- -<?php if (version_compare(zend_version(), '2.0.0-dev', '<')) die('skip ZendEngine 2 needed'); ?> ---FILE-- -<?php - -interface if_a { - function f_a(); -} - -interface if_b extends if_a { - function f_b(); -} - -class base { - function _is_a($sub) { - - echo "\n>>> With Defined class\n"; - echo str_pad('is_a( OBJECT:'.get_class($this).', '.$sub.') = ', 60) . (is_a($this, $sub) ? 'yes' : 'no')."\n"; - echo str_pad('is_a( STRING:'.get_class($this).', '.$sub.') = ', 60). (is_a(get_class($this), $sub) ? 'yes' : 'no')."\n"; - echo str_pad('is_a( STRING:'.get_class($this).', '.$sub.', true) = ', 60). (is_a(get_class($this), $sub, true) ? 'yes' : 'no')."\n"; - echo str_pad('is_subclass_of( OBJECT:'.get_class($this).', '.$sub.') = ', 60). (is_subclass_of($this, $sub) ? 'yes' : 'no')."\n"; - echo str_pad('is_subclass_of( STRING:'.get_class($this).', '.$sub.') = ', 60). (is_subclass_of(get_class($this), $sub) ? 'yes' : 'no')."\n"; - echo str_pad('is_subclass_of( STRING:'.get_class($this).', '.$sub.',false) = ', 60). (is_subclass_of(get_class($this), $sub , false) ? 'yes' : 'no')."\n"; - - // with autoload options.. - echo ">>> With Undefined\n"; - echo str_pad('is_a( STRING:undefB, '.$sub.',true) = ', 60). (is_a('undefB', $sub, true) ? 'yes' : 'no')."\n"; - echo str_pad('is_a( STRING:undefB, '.$sub.') = ', 60). (is_a('undefB', $sub) ? 'yes' : 'no')."\n"; - echo str_pad('is_subclass_of( STRING:undefB, '.$sub.',false) = ', 60). (is_subclass_of('undefB', $sub, false) ? 'yes' : 'no')."\n"; - echo str_pad('is_subclass_of( STRING:undefB, '.$sub.') = ', 60). (is_subclass_of('undefB', $sub) ? 'yes' : 'no')."\n"; - } - function test() { - echo $this->_is_a('base'); - echo $this->_is_a('derived_a'); - echo $this->_is_a('if_a'); - echo $this->_is_a('undefA'); - echo "\n"; - } -} - -class derived_a extends base implements if_a { - function f_a() {} -} - -class derived_b extends base implements if_a, if_b { - function f_a() {} - function f_b() {} -} - -class derived_c extends derived_a implements if_b { - function f_b() {} -} - -class derived_d extends derived_c { -} - -$t = new base(); -$t->test(); - -$t = new derived_a(); -$t->test(); - -eval(' - function __autoload($name) - { - echo ">>>> In __autoload: "; - var_dump($name); - } -'); - -echo "NOW WITH AUTOLOAD\n\n"; - -$t = new base(); -$t->test(); - -$t = new derived_a(); -$t->test(); - -$t = new derived_b(); -$t->test(); - - - - - -?> ---EXPECTF-- ->>> With Defined class -is_a( OBJECT:base, base) = yes -is_a( STRING:base, base) = no -is_a( STRING:base, base, true) = yes -is_subclass_of( OBJECT:base, base) = no -is_subclass_of( STRING:base, base) = no -is_subclass_of( STRING:base, base,false) = no ->>> With Undefined -is_a( STRING:undefB, base,true) = no -is_a( STRING:undefB, base) = no -is_subclass_of( STRING:undefB, base,false) = no -is_subclass_of( STRING:undefB, base) = no - ->>> With Defined class -is_a( OBJECT:base, derived_a) = no -is_a( STRING:base, derived_a) = no -is_a( STRING:base, derived_a, true) = no -is_subclass_of( OBJECT:base, derived_a) = no -is_subclass_of( STRING:base, derived_a) = no -is_subclass_of( STRING:base, derived_a,false) = no ->>> With Undefined -is_a( STRING:undefB, derived_a,true) = no -is_a( STRING:undefB, derived_a) = no -is_subclass_of( STRING:undefB, derived_a,false) = no -is_subclass_of( STRING:undefB, derived_a) = no - ->>> With Defined class -is_a( OBJECT:base, if_a) = no -is_a( STRING:base, if_a) = no -is_a( STRING:base, if_a, true) = no -is_subclass_of( OBJECT:base, if_a) = no -is_subclass_of( STRING:base, if_a) = no -is_subclass_of( STRING:base, if_a,false) = no ->>> With Undefined -is_a( STRING:undefB, if_a,true) = no -is_a( STRING:undefB, if_a) = no -is_subclass_of( STRING:undefB, if_a,false) = no -is_subclass_of( STRING:undefB, if_a) = no - ->>> With Defined class -is_a( OBJECT:base, undefA) = no -is_a( STRING:base, undefA) = no -is_a( STRING:base, undefA, true) = no -is_subclass_of( OBJECT:base, undefA) = no -is_subclass_of( STRING:base, undefA) = no -is_subclass_of( STRING:base, undefA,false) = no ->>> With Undefined -is_a( STRING:undefB, undefA,true) = no -is_a( STRING:undefB, undefA) = no -is_subclass_of( STRING:undefB, undefA,false) = no -is_subclass_of( STRING:undefB, undefA) = no - - ->>> With Defined class -is_a( OBJECT:derived_a, base) = yes -is_a( STRING:derived_a, base) = no -is_a( STRING:derived_a, base, true) = yes -is_subclass_of( OBJECT:derived_a, base) = yes -is_subclass_of( STRING:derived_a, base) = yes -is_subclass_of( STRING:derived_a, base,false) = no ->>> With Undefined -is_a( STRING:undefB, base,true) = no -is_a( STRING:undefB, base) = no -is_subclass_of( STRING:undefB, base,false) = no -is_subclass_of( STRING:undefB, base) = no - ->>> With Defined class -is_a( OBJECT:derived_a, derived_a) = yes -is_a( STRING:derived_a, derived_a) = no -is_a( STRING:derived_a, derived_a, true) = yes -is_subclass_of( OBJECT:derived_a, derived_a) = no -is_subclass_of( STRING:derived_a, derived_a) = no -is_subclass_of( STRING:derived_a, derived_a,false) = no ->>> With Undefined -is_a( STRING:undefB, derived_a,true) = no -is_a( STRING:undefB, derived_a) = no -is_subclass_of( STRING:undefB, derived_a,false) = no -is_subclass_of( STRING:undefB, derived_a) = no - ->>> With Defined class -is_a( OBJECT:derived_a, if_a) = yes -is_a( STRING:derived_a, if_a) = no -is_a( STRING:derived_a, if_a, true) = yes -is_subclass_of( OBJECT:derived_a, if_a) = yes -is_subclass_of( STRING:derived_a, if_a) = yes -is_subclass_of( STRING:derived_a, if_a,false) = no ->>> With Undefined -is_a( STRING:undefB, if_a,true) = no -is_a( STRING:undefB, if_a) = no -is_subclass_of( STRING:undefB, if_a,false) = no -is_subclass_of( STRING:undefB, if_a) = no - ->>> With Defined class -is_a( OBJECT:derived_a, undefA) = no -is_a( STRING:derived_a, undefA) = no -is_a( STRING:derived_a, undefA, true) = no -is_subclass_of( OBJECT:derived_a, undefA) = no -is_subclass_of( STRING:derived_a, undefA) = no -is_subclass_of( STRING:derived_a, undefA,false) = no ->>> With Undefined -is_a( STRING:undefB, undefA,true) = no -is_a( STRING:undefB, undefA) = no -is_subclass_of( STRING:undefB, undefA,false) = no -is_subclass_of( STRING:undefB, undefA) = no - -NOW WITH AUTOLOAD - - ->>> With Defined class -is_a( OBJECT:base, base) = yes -is_a( STRING:base, base) = no -is_a( STRING:base, base, true) = yes -is_subclass_of( OBJECT:base, base) = no -is_subclass_of( STRING:base, base) = no -is_subclass_of( STRING:base, base,false) = no ->>> With Undefined ->>>> In __autoload: string(6) "undefB" -is_a( STRING:undefB, base,true) = no -is_a( STRING:undefB, base) = no -is_subclass_of( STRING:undefB, base,false) = no ->>>> In __autoload: string(6) "undefB" -is_subclass_of( STRING:undefB, base) = no - ->>> With Defined class -is_a( OBJECT:base, derived_a) = no -is_a( STRING:base, derived_a) = no -is_a( STRING:base, derived_a, true) = no -is_subclass_of( OBJECT:base, derived_a) = no -is_subclass_of( STRING:base, derived_a) = no -is_subclass_of( STRING:base, derived_a,false) = no ->>> With Undefined ->>>> In __autoload: string(6) "undefB" -is_a( STRING:undefB, derived_a,true) = no -is_a( STRING:undefB, derived_a) = no -is_subclass_of( STRING:undefB, derived_a,false) = no ->>>> In __autoload: string(6) "undefB" -is_subclass_of( STRING:undefB, derived_a) = no - ->>> With Defined class -is_a( OBJECT:base, if_a) = no -is_a( STRING:base, if_a) = no -is_a( STRING:base, if_a, true) = no -is_subclass_of( OBJECT:base, if_a) = no -is_subclass_of( STRING:base, if_a) = no -is_subclass_of( STRING:base, if_a,false) = no ->>> With Undefined ->>>> In __autoload: string(6) "undefB" -is_a( STRING:undefB, if_a,true) = no -is_a( STRING:undefB, if_a) = no -is_subclass_of( STRING:undefB, if_a,false) = no ->>>> In __autoload: string(6) "undefB" -is_subclass_of( STRING:undefB, if_a) = no - ->>> With Defined class -is_a( OBJECT:base, undefA) = no -is_a( STRING:base, undefA) = no -is_a( STRING:base, undefA, true) = no -is_subclass_of( OBJECT:base, undefA) = no -is_subclass_of( STRING:base, undefA) = no -is_subclass_of( STRING:base, undefA,false) = no ->>> With Undefined ->>>> In __autoload: string(6) "undefB" -is_a( STRING:undefB, undefA,true) = no -is_a( STRING:undefB, undefA) = no -is_subclass_of( STRING:undefB, undefA,false) = no ->>>> In __autoload: string(6) "undefB" -is_subclass_of( STRING:undefB, undefA) = no - - ->>> With Defined class -is_a( OBJECT:derived_a, base) = yes -is_a( STRING:derived_a, base) = no -is_a( STRING:derived_a, base, true) = yes -is_subclass_of( OBJECT:derived_a, base) = yes -is_subclass_of( STRING:derived_a, base) = yes -is_subclass_of( STRING:derived_a, base,false) = no ->>> With Undefined ->>>> In __autoload: string(6) "undefB" -is_a( STRING:undefB, base,true) = no -is_a( STRING:undefB, base) = no -is_subclass_of( STRING:undefB, base,false) = no ->>>> In __autoload: string(6) "undefB" -is_subclass_of( STRING:undefB, base) = no - ->>> With Defined class -is_a( OBJECT:derived_a, derived_a) = yes -is_a( STRING:derived_a, derived_a) = no -is_a( STRING:derived_a, derived_a, true) = yes -is_subclass_of( OBJECT:derived_a, derived_a) = no -is_subclass_of( STRING:derived_a, derived_a) = no -is_subclass_of( STRING:derived_a, derived_a,false) = no ->>> With Undefined ->>>> In __autoload: string(6) "undefB" -is_a( STRING:undefB, derived_a,true) = no -is_a( STRING:undefB, derived_a) = no -is_subclass_of( STRING:undefB, derived_a,false) = no ->>>> In __autoload: string(6) "undefB" -is_subclass_of( STRING:undefB, derived_a) = no - ->>> With Defined class -is_a( OBJECT:derived_a, if_a) = yes -is_a( STRING:derived_a, if_a) = no -is_a( STRING:derived_a, if_a, true) = yes -is_subclass_of( OBJECT:derived_a, if_a) = yes -is_subclass_of( STRING:derived_a, if_a) = yes -is_subclass_of( STRING:derived_a, if_a,false) = no ->>> With Undefined ->>>> In __autoload: string(6) "undefB" -is_a( STRING:undefB, if_a,true) = no -is_a( STRING:undefB, if_a) = no -is_subclass_of( STRING:undefB, if_a,false) = no ->>>> In __autoload: string(6) "undefB" -is_subclass_of( STRING:undefB, if_a) = no - ->>> With Defined class -is_a( OBJECT:derived_a, undefA) = no -is_a( STRING:derived_a, undefA) = no -is_a( STRING:derived_a, undefA, true) = no -is_subclass_of( OBJECT:derived_a, undefA) = no -is_subclass_of( STRING:derived_a, undefA) = no -is_subclass_of( STRING:derived_a, undefA,false) = no ->>> With Undefined ->>>> In __autoload: string(6) "undefB" -is_a( STRING:undefB, undefA,true) = no -is_a( STRING:undefB, undefA) = no -is_subclass_of( STRING:undefB, undefA,false) = no ->>>> In __autoload: string(6) "undefB" -is_subclass_of( STRING:undefB, undefA) = no - - ->>> With Defined class -is_a( OBJECT:derived_b, base) = yes -is_a( STRING:derived_b, base) = no -is_a( STRING:derived_b, base, true) = yes -is_subclass_of( OBJECT:derived_b, base) = yes -is_subclass_of( STRING:derived_b, base) = yes -is_subclass_of( STRING:derived_b, base,false) = no ->>> With Undefined ->>>> In __autoload: string(6) "undefB" -is_a( STRING:undefB, base,true) = no -is_a( STRING:undefB, base) = no -is_subclass_of( STRING:undefB, base,false) = no ->>>> In __autoload: string(6) "undefB" -is_subclass_of( STRING:undefB, base) = no - ->>> With Defined class -is_a( OBJECT:derived_b, derived_a) = no -is_a( STRING:derived_b, derived_a) = no -is_a( STRING:derived_b, derived_a, true) = no -is_subclass_of( OBJECT:derived_b, derived_a) = no -is_subclass_of( STRING:derived_b, derived_a) = no -is_subclass_of( STRING:derived_b, derived_a,false) = no ->>> With Undefined ->>>> In __autoload: string(6) "undefB" -is_a( STRING:undefB, derived_a,true) = no -is_a( STRING:undefB, derived_a) = no -is_subclass_of( STRING:undefB, derived_a,false) = no ->>>> In __autoload: string(6) "undefB" -is_subclass_of( STRING:undefB, derived_a) = no - ->>> With Defined class -is_a( OBJECT:derived_b, if_a) = yes -is_a( STRING:derived_b, if_a) = no -is_a( STRING:derived_b, if_a, true) = yes -is_subclass_of( OBJECT:derived_b, if_a) = yes -is_subclass_of( STRING:derived_b, if_a) = yes -is_subclass_of( STRING:derived_b, if_a,false) = no ->>> With Undefined ->>>> In __autoload: string(6) "undefB" -is_a( STRING:undefB, if_a,true) = no -is_a( STRING:undefB, if_a) = no -is_subclass_of( STRING:undefB, if_a,false) = no ->>>> In __autoload: string(6) "undefB" -is_subclass_of( STRING:undefB, if_a) = no - ->>> With Defined class -is_a( OBJECT:derived_b, undefA) = no -is_a( STRING:derived_b, undefA) = no -is_a( STRING:derived_b, undefA, true) = no -is_subclass_of( OBJECT:derived_b, undefA) = no -is_subclass_of( STRING:derived_b, undefA) = no -is_subclass_of( STRING:derived_b, undefA,false) = no ->>> With Undefined ->>>> In __autoload: string(6) "undefB" -is_a( STRING:undefB, undefA,true) = no -is_a( STRING:undefB, undefA) = no -is_subclass_of( STRING:undefB, undefA,false) = no ->>>> In __autoload: string(6) "undefB" -is_subclass_of( STRING:undefB, undefA) = no diff --git a/tests/classes/method_override_optional_arg_001.phpt b/tests/classes/method_override_optional_arg_001.phpt index 53272fff73..333c29d128 100644 --- a/tests/classes/method_override_optional_arg_001.phpt +++ b/tests/classes/method_override_optional_arg_001.phpt @@ -28,6 +28,6 @@ $b->foo(1); ?> --EXPECTF-- -Strict Standards: Declaration of C::foo() should be compatible with that of A::foo() in %s on line %d +Strict Standards: Declaration of C::foo() should be compatible with A::foo($arg1 = 1) in %s on line %d int(1) int(3) diff --git a/tests/classes/method_override_optional_arg_002.phpt b/tests/classes/method_override_optional_arg_002.phpt index c212b8260d..669a8ca836 100644 --- a/tests/classes/method_override_optional_arg_002.phpt +++ b/tests/classes/method_override_optional_arg_002.phpt @@ -18,5 +18,5 @@ $b->foo(); ?> --EXPECTF-- -Strict Standards: Declaration of B::foo() should be compatible with that of A::foo() in %s on line %d +Strict Standards: Declaration of B::foo() should be compatible with A::foo($arg = 1) in %s on line %d foo diff --git a/tests/classes/type_hinting_003.phpt b/tests/classes/type_hinting_003.phpt index 431d66eabc..a966210fba 100755 --- a/tests/classes/type_hinting_003.phpt +++ b/tests/classes/type_hinting_003.phpt @@ -57,4 +57,4 @@ array(1) { int(25) } -Catchable fatal error: Argument 1 passed to Test::f1() must be an array, integer given, called in %stype_hinting_003.php on line %d and defined in %stype_hinting_003.php on line %d +Catchable fatal error: Argument 1 passed to Test::f1() must be of the type array, integer given, called in %s on line %d and defined in %s on line %d diff --git a/tests/classes/type_hinting_005a.phpt b/tests/classes/type_hinting_005a.phpt index d487a44611..5e4c43b8af 100644 --- a/tests/classes/type_hinting_005a.phpt +++ b/tests/classes/type_hinting_005a.phpt @@ -12,7 +12,7 @@ Class D2 extends C { function f(SomeClass $a) {} } ?> ==DONE== --EXPECTF-- -Strict Standards: Declaration of D2::f() should be compatible with that of C::f() in %s on line 8 +Strict Standards: Declaration of D2::f() should be compatible with C::f(array $a) in %s on line 8 Compatible hint. Class hint, should be array. -==DONE==
\ No newline at end of file +==DONE== diff --git a/tests/classes/type_hinting_005b.phpt b/tests/classes/type_hinting_005b.phpt index bc0d7686b5..f13ab957bb 100644 --- a/tests/classes/type_hinting_005b.phpt +++ b/tests/classes/type_hinting_005b.phpt @@ -9,6 +9,6 @@ Class D extends C { function f($a) {} } ?> ==DONE== --EXPECTF-- -Strict Standards: Declaration of D::f() should be compatible with that of C::f() in %s on line 5 +Strict Standards: Declaration of D::f() should be compatible with C::f(array $a) in %s on line 5 No hint, should be array. -==DONE==
\ No newline at end of file +==DONE== diff --git a/tests/classes/type_hinting_005c.phpt b/tests/classes/type_hinting_005c.phpt index d3b72412cd..30a114e2a4 100644 --- a/tests/classes/type_hinting_005c.phpt +++ b/tests/classes/type_hinting_005c.phpt @@ -9,6 +9,6 @@ Class D extends C { function f(array $a) {} } ?> ==DONE== --EXPECTF-- -Strict Standards: Declaration of D::f() should be compatible with that of C::f() in %s on line 5 +Strict Standards: Declaration of D::f() should be compatible with C::f(SomeClass $a) in %s on line 5 Array hint, should be class. -==DONE==
\ No newline at end of file +==DONE== diff --git a/tests/classes/type_hinting_005d.phpt b/tests/classes/type_hinting_005d.phpt index 60dda0ff24..830054d03d 100644 --- a/tests/classes/type_hinting_005d.phpt +++ b/tests/classes/type_hinting_005d.phpt @@ -9,6 +9,6 @@ Class D extends C { function f(array $a) {} } ?> ==DONE== --EXPECTF-- -Strict Standards: Declaration of D::f() should be compatible with that of C::f() in %s on line 5 +Strict Standards: Declaration of D::f() should be compatible with C::f($a) in %s on line 5 Array hint, should be nothing. -==DONE==
\ No newline at end of file +==DONE== diff --git a/tests/lang/019.phpt b/tests/lang/019.phpt index 2db29ad22b..c9b5e5f3b5 100644 --- a/tests/lang/019.phpt +++ b/tests/lang/019.phpt @@ -35,4 +35,4 @@ hey, this is a function inside an eval()! hey, this is a regular echo'd eval() hey, this is a function inside an eval()! -Parse error: syntax error, unexpected $end in %s019.php(12) : eval()'d code on line 1 +Parse error: syntax error, unexpected %s in %s019.php(12) : eval()'d code on line 1 diff --git a/tests/lang/array_shortcut_001.phpt b/tests/lang/array_shortcut_001.phpt new file mode 100644 index 0000000000..18a10ea09b --- /dev/null +++ b/tests/lang/array_shortcut_001.phpt @@ -0,0 +1,13 @@ +--TEST-- +Square bracket array shortcut test +--FILE-- +<?php +print_r([1, 2, 3]); +?> +--EXPECT-- +Array +( + [0] => 1 + [1] => 2 + [2] => 3 +) diff --git a/tests/lang/array_shortcut_002.phpt b/tests/lang/array_shortcut_002.phpt new file mode 100644 index 0000000000..25aee9ba39 --- /dev/null +++ b/tests/lang/array_shortcut_002.phpt @@ -0,0 +1,13 @@ +--TEST-- +Square bracket associative array shortcut test +--FILE-- +<?php +print_r(["foo" => "orange", "bar" => "apple", "baz" => "lemon"]); +?> +--EXPECT-- +Array +( + [foo] => orange + [bar] => apple + [baz] => lemon +) diff --git a/tests/lang/array_shortcut_003.phpt b/tests/lang/array_shortcut_003.phpt new file mode 100644 index 0000000000..75e428b63e --- /dev/null +++ b/tests/lang/array_shortcut_003.phpt @@ -0,0 +1,13 @@ +--TEST-- +Testing array shortcut and bracket operator +--FILE-- +<?php +$a = [1, 2, 3, 4, 5]; +print_r([$a[1], $a[3]]); +?> +--EXPECT-- +Array +( + [0] => 2 + [1] => 4 +) diff --git a/tests/lang/array_shortcut_005.phpt b/tests/lang/array_shortcut_005.phpt new file mode 100644 index 0000000000..7cc7386f83 --- /dev/null +++ b/tests/lang/array_shortcut_005.phpt @@ -0,0 +1,20 @@ +--TEST-- +Testing nested array shortcut +--FILE-- +<?php +print_r([1, 2, 3, ["foo" => "orange", "bar" => "apple", "baz" => "lemon"]]); +?> +--EXPECT-- +Array +( + [0] => 1 + [1] => 2 + [2] => 3 + [3] => Array + ( + [foo] => orange + [bar] => apple + [baz] => lemon + ) + +) diff --git a/tests/lang/bug19943.phpt b/tests/lang/bug19943.phpt index 294a320bf7..c951190511 100644 --- a/tests/lang/bug19943.phpt +++ b/tests/lang/bug19943.phpt @@ -5,11 +5,11 @@ Bug #19943 (memleaks) $ar = array(); for ($count = 0; $count < 10; $count++) { $ar[$count] = "$count"; - $ar[$count]['idx'] = "$count"; + @$ar[$count]['idx'] = "$count"; } for ($count = 0; $count < 10; $count++) { - echo $ar[$count]." -- ".$ar[$count]['idx']."\n"; + echo $ar[$count]." -- ".@$ar[$count]['idx']."\n"; } $a = "0123456789"; $a[9] = $a[0]; diff --git a/tests/lang/bug21820.phpt b/tests/lang/bug21820.phpt index 0ca233ea84..cbf466eea7 100644 --- a/tests/lang/bug21820.phpt +++ b/tests/lang/bug21820.phpt @@ -9,5 +9,5 @@ $arr = array('foo' => 'bar'); echo "$arr['foo']"; ?> ---EXPECTREGEX-- -Parse error: (parse|syntax) error, .*expecting `?T_STRING'? or `?T_VARIABLE'? or `?T_NUM_STRING'? in .*bug21820.php on line .* +--EXPECTF-- +Parse error: %s error, %s(T_STRING)%s(T_VARIABLE)%s(T_NUM_STRING)%sin %sbug21820.php on line %d diff --git a/tests/lang/bug29566.phpt b/tests/lang/bug29566.phpt index 5f292bd759..16aec8fc73 100755 --- a/tests/lang/bug29566.phpt +++ b/tests/lang/bug29566.phpt @@ -12,5 +12,7 @@ foreach($var['nosuchkey'] as $v) { ?> ===DONE=== --EXPECTF-- +Warning: Illegal string offset 'nosuchkey' in %sbug29566.php on line %d + Warning: Invalid argument supplied for foreach() in %sbug29566.php on line %d ===DONE=== diff --git a/tests/lang/bug35176.phpt b/tests/lang/bug35176.phpt index dd56c76a68..2928f7ec45 100755 --- a/tests/lang/bug35176.phpt +++ b/tests/lang/bug35176.phpt @@ -2,6 +2,7 @@ Bug #35176 (include()/require()/*_once() produce wrong error messages about main()) --INI-- html_errors=1 +docref_root="/" error_reporting=4095 --FILE-- <?php @@ -9,6 +10,6 @@ require_once('nonexisiting.php'); ?> --EXPECTF-- <br /> -<b>Warning</b>: require_once(nonexisiting.php) [<a href='function.require-once.html'>function.require-once.html</a>]: failed to open stream: No such file or directory in <b>%sbug35176.php</b> on line <b>2</b><br /> +<b>Warning</b>: require_once(nonexisiting.php) [<a href='/function.require-once.html'>function.require-once.html</a>]: failed to open stream: No such file or directory in <b>%sbug35176.php</b> on line <b>2</b><br /> <br /> -<b>Fatal error</b>: require_once() [<a href='function.require.html'>function.require.html</a>]: Failed opening required 'nonexisiting.php' (%s) in <b>%sbug35176.php</b> on line <b>2</b><br /> +<b>Fatal error</b>: require_once() [<a href='/function.require.html'>function.require.html</a>]: Failed opening required 'nonexisiting.php' (%s) in <b>%sbug35176.php</b> on line <b>2</b><br /> diff --git a/tests/lang/bug55754.phpt b/tests/lang/bug55754.phpt new file mode 100644 index 0000000000..c58ec9175a --- /dev/null +++ b/tests/lang/bug55754.phpt @@ -0,0 +1,14 @@ +--TEST-- +Bug #55754 (Only variables should be passed by reference for ZEND_SEND_PREFER_REF params) +--FILE-- +<?php + +current($arr = array(0 => "a")); +current(array(0 => "a")); +current($arr); + +echo "DONE"; + +?> +--EXPECT-- +DONE diff --git a/tests/lang/bug7515.phpt b/tests/lang/bug7515.phpt index b33ae24c89..ea58061db0 100644 --- a/tests/lang/bug7515.phpt +++ b/tests/lang/bug7515.phpt @@ -32,5 +32,6 @@ y=$y "; } ?> ---EXPECT-- +--EXPECTF-- +Warning: Creating default object from empty value in %s on line %d success diff --git a/tests/lang/engine_assignExecutionOrder_008.phpt b/tests/lang/engine_assignExecutionOrder_008.phpt index 0d699bc649..1333bcda8a 100644 --- a/tests/lang/engine_assignExecutionOrder_008.phpt +++ b/tests/lang/engine_assignExecutionOrder_008.phpt @@ -66,10 +66,16 @@ $$x=f(): good ${'i'}=f(): good $i[0]=f(): good $i[0][0]=f(): good -$i->p=f(): good -$i->p->q=f(): good +$i->p=f(): +Warning: Creating default object from empty value in %s on line %d +good +$i->p->q=f(): +Warning: Creating default object from empty value in %s on line %d +good $i->p[0]=f(): good -$i->p[0]->p=f(): good +$i->p[0]->p=f(): +Warning: Creating default object from empty value in %s on line %d +good C::$p=f(): good C::$p[0]=f(): good -C::$p->q=f(): good
\ No newline at end of file +C::$p->q=f(): good diff --git a/tests/lang/foreachLoop.016.phpt b/tests/lang/foreachLoop.016.phpt index dc31a5072e..d570aba316 100644 --- a/tests/lang/foreachLoop.016.phpt +++ b/tests/lang/foreachLoop.016.phpt @@ -150,12 +150,16 @@ array(1) { }
$a->b
+
+Warning: Creating default object from empty value in %s on line %d
array(1) {
[0]=>
string(8) "original"
}
$a->b->c
+
+Warning: Creating default object from empty value in %s on line %d
array(1) {
[0]=>
string(8) "original"
@@ -174,6 +178,8 @@ array(1) { }
$a->b[0]->c
+
+Warning: Creating default object from empty value in %s on line %d
array(1) {
[0]=>
string(8) "original"
@@ -192,7 +198,9 @@ array(1) { }
C::$a[0]->b
+
+Warning: Creating default object from empty value in %s on line %d
array(1) {
[0]=>
string(8) "original"
-}
\ No newline at end of file +}
diff --git a/tests/lang/short_tags.004.phpt b/tests/lang/short_tags.004.phpt index d80e7481a1..ff3308733a 100644 --- a/tests/lang/short_tags.004.phpt +++ b/tests/lang/short_tags.004.phpt @@ -4,8 +4,6 @@ short_open_tag: Off, asp_tags: Off short_open_tag=off asp_tags=off --FILE-- -<?='this should get echoed'?> - <%= 'so should this' %> <?php @@ -21,17 +19,17 @@ $a = 'This gets echoed twice'; <?php echo "{$b}"; ?> +<?= "{$b}"?> --EXPECTF-- -<?='this should get echoed'?> - <%= 'so should this' %> -<?= $a?> - +This gets echoed twice <%= $a%> <? $b=3; ?> Notice: Undefined variable: b in %s on line %d + +Notice: Undefined variable: b in %s on line %d diff --git a/tests/output/bug46897.phpt b/tests/output/bug46897.phpt index a77db91d34..8fe80bcb65 100644 --- a/tests/output/bug46897.phpt +++ b/tests/output/bug46897.phpt @@ -18,10 +18,10 @@ echo 'Done'; ?> --EXPECTF-- [callback:1]Attempt to flush unerasable buffer - should fail... -Notice: ob_flush(): failed to flush buffer callback in %s on line %d +Notice: ob_flush(): failed to flush buffer of callback (0) in %s on line %d bool(false) string(%d) "Attempt to flush unerasable buffer - should fail... -Notice: ob_flush(): failed to flush buffer callback in %s on line %d +Notice: ob_flush(): failed to flush buffer of callback (0) in %s on line %d bool(false) " Done diff --git a/tests/output/bug60282.phpt b/tests/output/bug60282.phpt new file mode 100644 index 0000000000..08bcc0f201 --- /dev/null +++ b/tests/output/bug60282.phpt @@ -0,0 +1,12 @@ +--TEST-- +Bug #60282 (Segfault when using ob_gzhandler() with open buffers) +--SKIPIF-- +<?php if (!extension_loaded("zlib")) print "skip Zlib extension required"; ?> +--FILE-- +<?php +ob_start(); +ob_start(); +ob_start('ob_gzhandler'); +echo "done"; +--EXPECT-- +done diff --git a/tests/output/bug60321.phpt b/tests/output/bug60321.phpt new file mode 100644 index 0000000000..9802a57ccd --- /dev/null +++ b/tests/output/bug60321.phpt @@ -0,0 +1,9 @@ +--TEST-- +Bug #60321 (ob_get_status(true) no longer returns an array when buffer is empty) +--FILE-- +<?php +$return = ob_get_status(true); +var_dump($return); +--EXPECT-- +array(0) { +} diff --git a/tests/output/bug60322.phpt b/tests/output/bug60322.phpt new file mode 100644 index 0000000000..c28ab4d617 --- /dev/null +++ b/tests/output/bug60322.phpt @@ -0,0 +1,8 @@ +--TEST-- +Bug #60322 (ob_get_clean() now raises an E_NOTICE if no buffers exist) +--FILE-- +<?php +while(ob_get_clean()) ; +var_dump(ob_get_clean()); +--EXPECT-- +bool(false) diff --git a/tests/output/bug60768.phpt b/tests/output/bug60768.phpt new file mode 100644 index 0000000000..2527e8e84a --- /dev/null +++ b/tests/output/bug60768.phpt @@ -0,0 +1,25 @@ +--TEST-- +Bug #60768 Output buffer not discarded +--FILE-- +<?php + +global $storage; + +ob_start(function($buffer) use (&$storage) { $storage .= $buffer; }, 20); + +echo str_repeat("0", 20); // fill in the buffer + +for($i = 0; $i < 10; $i++) { + echo str_pad($i, 9, ' ', STR_PAD_LEFT) . "\n"; // full buffer dumped every time +} + +ob_end_flush(); + +printf("Output size: %d, expected %d\n", strlen($storage), 20 + 10 * 10); + +?> +DONE +--EXPECT-- +Output size: 120, expected 120 +DONE + diff --git a/tests/output/ob_013.phpt b/tests/output/ob_013.phpt index ce5b5e5455..e96de46a4b 100644 --- a/tests/output/ob_013.phpt +++ b/tests/output/ob_013.phpt @@ -37,67 +37,69 @@ Array ) Array ( - [level] => 5 - [type] => 1 - [status] => 1 [name] => d - [del] => 1 + [type] => 1 + [flags] => 4209 + [level] => 4 + [chunk_size] => %d + [buffer_size] => 16384 + [buffer_used] => 96 ) Array ( [0] => Array ( - [chunk_size] => 0 - [size] => 40960 - [block_size] => 10240 - [type] => 1 - [status] => 0 [name] => default output handler - [del] => 1 + [type] => 0 + [flags] => 112 + [level] => 0 + [chunk_size] => %d + [buffer_size] => 16384 + [buffer_used] => 0 ) [1] => Array ( - [chunk_size] => 0 - [size] => 40960 - [block_size] => 10240 - [type] => 1 - [status] => 0 [name] => a - [del] => 1 + [type] => 1 + [flags] => 113 + [level] => 1 + [chunk_size] => %d + [buffer_size] => 16384 + [buffer_used] => 0 ) [2] => Array ( - [chunk_size] => 0 - [size] => 40960 - [block_size] => 10240 - [type] => 1 - [status] => 0 [name] => b - [del] => 1 + [type] => 1 + [flags] => 113 + [level] => 2 + [chunk_size] => %d + [buffer_size] => 16384 + [buffer_used] => 0 ) [3] => Array ( - [chunk_size] => 0 - [size] => 40960 - [block_size] => 10240 - [type] => 1 - [status] => 0 [name] => c - [del] => 1 + [type] => 1 + [flags] => 113 + [level] => 3 + [chunk_size] => %d + [buffer_size] => 16384 + [buffer_used] => 4 ) [4] => Array ( - [chunk_size] => 0 - [size] => 40960 - [block_size] => 10240 - [type] => 1 - [status] => 1 [name] => d - [del] => 1 + [type] => 1 + [flags] => 4209 + [level] => 4 + [chunk_size] => %d + [buffer_size] => 16384 + [buffer_used] => %d ) -)
\ No newline at end of file +) diff --git a/tests/output/ob_017.phpt b/tests/output/ob_017.phpt index fc50e2f4ad..070df603fc 100644 --- a/tests/output/ob_017.phpt +++ b/tests/output/ob_017.phpt @@ -24,11 +24,11 @@ yes! yes! Array ( - [0] => 3: yes - [1] => 2: ! + [0] => 1: yes + [1] => 4: ! - [2] => 2: no - [3] => 2: yes! + [2] => 2: + [3] => 0: yes! - [4] => 4: no -)
\ No newline at end of file + [4] => 10: +) diff --git a/tests/output/ob_get_clean_basic_001.phpt b/tests/output/ob_get_clean_basic_001.phpt index 07673dfac4..635b58abf9 100644 --- a/tests/output/ob_get_clean_basic_001.phpt +++ b/tests/output/ob_get_clean_basic_001.phpt @@ -15,4 +15,4 @@ var_dump(ob_get_clean()); ?> --EXPECTF-- bool(false) -string(11) "Hello World"
\ No newline at end of file +string(11) "Hello World" diff --git a/tests/output/ob_get_status.phpt b/tests/output/ob_get_status.phpt index a6a3498ca3..95807293b5 100644 --- a/tests/output/ob_get_status.phpt +++ b/tests/output/ob_get_status.phpt @@ -15,20 +15,19 @@ var_dump($status); array(1) { [0]=> array(7) { + ["name"]=> + string(22) "default output handler" + ["type"]=> + int(0) + ["flags"]=> + int(112) + ["level"]=> + int(0) ["chunk_size"]=> int(0) - ["size"]=> - int(40960) - ["block_size"]=> - int(10240) - ["type"]=> - int(1) - ["status"]=> + ["buffer_size"]=> + int(16384) + ["buffer_used"]=> int(0) - ["name"]=> - string(22) "default output handler" - ["del"]=> - bool(true) } } - diff --git a/tests/output/ob_start_basic_004.phpt b/tests/output/ob_start_basic_004.phpt index 39d3aadc49..16f09e8a9a 100644 --- a/tests/output/ob_start_basic_004.phpt +++ b/tests/output/ob_start_basic_004.phpt @@ -1,12 +1,12 @@ --TEST-- -ob_start() chunk_size: confirm buffer is flushed after any output call that causes its length to equal or exceed chunk_size. +ob_start() chunk_size: confirm buffer is flushed after any output call that causes its length to equal or exceed chunk_size. --FILE-- <?php /* * proto bool ob_start([ string|array user_function [, int chunk_size [, bool erase]]]) * Function is implemented in main/output.c */ - +// In HEAD, $chunk_size value of 1 should not have any special behaviour (http://marc.info/?l=php-internals&m=123476465621346&w=2). function callback($string) { global $callback_invocations; $callback_invocations++; @@ -40,7 +40,15 @@ f[call:1; len:8]12345678 f[call:1; len:8]12345678 ----( chunk_size: 1, output append size: 1 )---- -f[call:1; len:8]12345678 +f[call:1; len:1]1 +f[call:2; len:1]2 +f[call:3; len:1]3 +f[call:4; len:1]4 +f[call:5; len:1]5 +f[call:6; len:1]6 +f[call:7; len:1]7 +f[call:8; len:1]8 +f[call:9; len:0] ----( chunk_size: 2, output append size: 1 )---- f[call:1; len:2]12 @@ -85,7 +93,9 @@ f[call:1; len:8]12345678 f[call:1; len:8]12345678 ----( chunk_size: 1, output append size: 4 )---- -f[call:1; len:8]12345678 +f[call:1; len:4]1234 +f[call:2; len:4]5678 +f[call:3; len:0] ----( chunk_size: 2, output append size: 4 )---- f[call:1; len:4]1234 diff --git a/tests/output/ob_start_basic_005.phpt b/tests/output/ob_start_basic_005.phpt index cd2b2e07e5..4048ad25a2 100644 --- a/tests/output/ob_start_basic_005.phpt +++ b/tests/output/ob_start_basic_005.phpt @@ -25,9 +25,9 @@ checkAndClean(); ?> --EXPECTF-- -Strict Standards: Non-static method C::h() should not be called statically in %s on line 20 +Warning: ob_start(): non-static method C::h() should not be called statically in %s on line 20 bool(true) Array ( [0] => C::h -)
\ No newline at end of file +) diff --git a/tests/output/ob_start_basic_006.phpt b/tests/output/ob_start_basic_006.phpt index e24ebd61c3..464e71be33 100644 --- a/tests/output/ob_start_basic_006.phpt +++ b/tests/output/ob_start_basic_006.phpt @@ -1,5 +1,5 @@ --TEST-- -ob_start(): multiple buffer initialization with a single call, using arrays. +ob_start(): ensure multiple buffer initialization with a single call using arrays is not supported on PHP6 (http://bugs.php.net/42641) --FILE-- <?php /* @@ -72,46 +72,47 @@ var_dump(ob_start(array('f', 'C::g', array(array($c, "g"), array($c, "h"))))); checkAndClean(); ?> --EXPECTF-- - ---> Test arrays: -f[call:1; len:34] - bool(true) + +Warning: ob_start(): array must have exactly two members in %s on line 44 + +Notice: ob_start(): failed to create buffer in %s on line 44 +bool(false) Array ( - [0] => f ) -f[call:3; len:68] - f[call:2; len:47] - bool(true) +Warning: ob_start(): class 'f' not found in %s on line 47 + +Notice: ob_start(): failed to create buffer in %s on line 47 +bool(false) Array ( - [0] => f - [1] => f ) +Warning: ob_start(): array must have exactly two members in %s on line 50 -f[call:5; len:150] - C::g[call:2; len:125] - f[call:4; len:103] - C::g[call:1; len:79] - bool(true) +Notice: ob_start(): failed to create buffer in %s on line 50 +bool(false) Array ( - [0] => f - [1] => C::g - [2] => f - [3] => C::g ) +Warning: ob_start(): array must have exactly two members in %s on line 53 - - -f[call:6; len:35] - bool(false) +Notice: ob_start(): failed to create buffer in %s on line 53 +bool(false) Array ( - [0] => f ) -f[call:7; len:35] - bool(false) +Warning: ob_start(): array must have exactly two members in %s on line 56 + +Notice: ob_start(): failed to create buffer in %s on line 56 +bool(false) Array ( - [0] => f ) - C::h[call:1; len:37; id:originalID] - bool(true) Array ( @@ -124,11 +125,11 @@ Array [0] => C::h ) -f[call:8; len:175] - C::g[call:4; len:150] - C::g[call:3; len:125] - C::h[call:3; len:82; id:changedIDagain] - bool(true) + +Warning: ob_start(): array must have exactly two members in %s on line 68 + +Notice: ob_start(): failed to create buffer in %s on line 68 +bool(false) Array ( - [0] => f - [1] => C::g - [2] => C::g - [3] => C::h -)
\ No newline at end of file +) diff --git a/tests/output/ob_start_basic_unerasable_002.phpt b/tests/output/ob_start_basic_unerasable_002.phpt index 3b8bd637ee..21db1f326c 100644 --- a/tests/output/ob_start_basic_unerasable_002.phpt +++ b/tests/output/ob_start_basic_unerasable_002.phpt @@ -21,13 +21,13 @@ var_dump(ob_get_level()); --EXPECTF-- [callback:1]All of the following calls will fail to clean/remove the topmost buffer: -Notice: ob_clean(): failed to delete buffer callback in %s on line 11 +Notice: ob_clean(): failed to delete buffer of callback (0) in %s on line 11 bool(false) -Notice: ob_end_clean(): failed to delete buffer callback in %s on line 12 +Notice: ob_end_clean(): failed to discard buffer of callback (0) in %s on line 12 bool(false) -Notice: ob_end_flush(): failed to delete buffer callback in %s on line 13 +Notice: ob_end_flush(): failed to send buffer of callback (0) in %s on line 13 bool(false) The OB nesting will still be 1 level deep: -int(1) +int(1)
\ No newline at end of file diff --git a/tests/output/ob_start_basic_unerasable_003.phpt b/tests/output/ob_start_basic_unerasable_003.phpt index e35902c89b..6eb6418388 100644 --- a/tests/output/ob_start_basic_unerasable_003.phpt +++ b/tests/output/ob_start_basic_unerasable_003.phpt @@ -10,12 +10,13 @@ function callback($string) { ob_start('callback', 0, false); -echo "This call will fail to obtain the content, since it is also requesting a clean:\n"; +echo "This call will obtain the content, but will not clean the buffer."; $str = ob_get_clean(); var_dump($str); ?> --EXPECTF-- -[callback:1]This call will fail to obtain the content, since it is also requesting a clean: +[callback:1]This call will obtain the content, but will not clean the buffer. +Notice: ob_get_clean(): failed to discard buffer of callback (0) in %s on line 11 -Notice: ob_get_clean(): failed to delete buffer callback in %s on line 11 -bool(false) +Notice: ob_get_clean(): failed to delete buffer of callback (0) in %s on line 11 +string(65) "This call will obtain the content, but will not clean the buffer."
\ No newline at end of file diff --git a/tests/output/ob_start_basic_unerasable_004.phpt b/tests/output/ob_start_basic_unerasable_004.phpt index 081875a788..62d9756e3f 100644 --- a/tests/output/ob_start_basic_unerasable_004.phpt +++ b/tests/output/ob_start_basic_unerasable_004.phpt @@ -10,12 +10,13 @@ function callback($string) { ob_start('callback', 0, false); -echo "This call will fail to flush and fail to obtain the content:\n"; +echo "This call will obtain the content, but will not flush the buffer."; $str = ob_get_flush(); var_dump($str); ?> --EXPECTF-- -[callback:1]This call will fail to flush and fail to obtain the content: +[callback:1]This call will obtain the content, but will not flush the buffer. +Notice: ob_get_flush(): failed to send buffer of callback (0) in %s on line 11 -Notice: ob_get_flush(): failed to delete buffer callback in %s on line 11 -bool(false) +Notice: ob_get_flush(): failed to delete buffer of callback (0) in %s on line 11 +string(65) "This call will obtain the content, but will not flush the buffer."
\ No newline at end of file diff --git a/tests/output/ob_start_basic_unerasable_005.phpt b/tests/output/ob_start_basic_unerasable_005.phpt index f1af201e67..2c52f00c24 100644 --- a/tests/output/ob_start_basic_unerasable_005.phpt +++ b/tests/output/ob_start_basic_unerasable_005.phpt @@ -17,9 +17,9 @@ var_dump(ob_get_contents()); ?> --EXPECTF-- [callback:1]Attempt to flush unerasable buffer - should fail... -Notice: ob_flush(): failed to flush buffer callback in %s on line 11 +Notice: ob_flush(): failed to flush buffer of callback (0) in %s on line 11 bool(false) string(%d) "Attempt to flush unerasable buffer - should fail... -Notice: ob_flush(): failed to flush buffer callback in %s on line 11 +Notice: ob_flush(): failed to flush buffer of callback (0) in %s on line 11 bool(false) " diff --git a/tests/output/ob_start_error_001.phpt b/tests/output/ob_start_error_001.phpt index ca028018bd..b45de831df 100644 --- a/tests/output/ob_start_error_001.phpt +++ b/tests/output/ob_start_error_001.phpt @@ -30,14 +30,17 @@ var_dump(ob_start("justPrint", 0, "this should be a bool")); ?> --EXPECTF-- - - Too many arguments Warning: ob_start() expects at most 3 parameters, 4 given in %s on line 17 NULL - Arg 1 wrong type -bool(true) + +Warning: ob_start(): no array or string given in %s on line 20 + +Notice: ob_start(): failed to create buffer in %s on line 20 +bool(false) - Arg 2 wrong type @@ -45,4 +48,6 @@ Warning: ob_start() expects parameter 2 to be long, string given in %s on line 2 NULL - Arg 3 wrong type -bool(true)
\ No newline at end of file + +Warning: ob_start() expects parameter 3 to be long, string given in %s on line 26 +NULL diff --git a/tests/output/ob_start_error_002.phpt b/tests/output/ob_start_error_002.phpt index aca2ad9d2c..38c789908d 100644 --- a/tests/output/ob_start_error_002.phpt +++ b/tests/output/ob_start_error_002.phpt @@ -20,8 +20,23 @@ var_dump(ob_start("no")); echo "done" ?> --EXPECTF-- +Warning: ob_start(): class 'nonExistent' not found in %s on line 13 + +Notice: ob_start(): failed to create buffer in %s on line 13 bool(false) + +Warning: ob_start(): class 'C' does not have a method 'nonExistent' in %s on line 14 + +Notice: ob_start(): failed to create buffer in %s on line 14 bool(false) + +Warning: ob_start(): class 'C' does not have a method 'no' in %s on line 15 + +Notice: ob_start(): failed to create buffer in %s on line 15 bool(false) + +Warning: ob_start(): function 'no' not found or invalid function name in %s on line 16 + +Notice: ob_start(): failed to create buffer in %s on line 16 bool(false) -done
\ No newline at end of file +done diff --git a/tests/output/ob_start_error_003.phpt b/tests/output/ob_start_error_003.phpt index ce2a2495d9..7fa292a739 100644 --- a/tests/output/ob_start_error_003.phpt +++ b/tests/output/ob_start_error_003.phpt @@ -15,4 +15,8 @@ var_dump(ob_start(array($c))); echo "done" ?> --EXPECTF-- -Catchable fatal error: Object of class C could not be converted to string in %s on line 11
\ No newline at end of file +Warning: ob_start(): array must have exactly two members in %s on line %d + +Notice: ob_start(): failed to create buffer in %s on line 11 +bool(false) +done diff --git a/tests/output/ob_start_error_004.phpt b/tests/output/ob_start_error_004.phpt index ec6d44d091..7ddf998557 100644 --- a/tests/output/ob_start_error_004.phpt +++ b/tests/output/ob_start_error_004.phpt @@ -15,4 +15,8 @@ var_dump(ob_start(array($c, 'f'))); echo "done" ?> --EXPECTF-- -Catchable fatal error: Object of class C could not be converted to string in %s on line 11
\ No newline at end of file +Warning: ob_start(): class 'C' does not have a method 'f' in %s on line %d + +Notice: ob_start(): failed to create buffer in %s on line 11 +bool(false) +done diff --git a/tests/security/magic_quotes_gpc.phpt b/tests/security/magic_quotes_gpc.phpt deleted file mode 100644 index 382ab94d2d..0000000000 --- a/tests/security/magic_quotes_gpc.phpt +++ /dev/null @@ -1,13 +0,0 @@ ---TEST-- -Test if magic_quotes_gpc works as expected ---INI-- -display_errors=0 -magic_quotes_gpc=1 ---GET-- -a=abc'"%00123 ---FILE-- -<?php -echo $_GET['a'],"\n"; -?> ---EXPECT-- -abc\'\"\0123 diff --git a/tests/security/open_basedir_linkinfo.phpt b/tests/security/open_basedir_linkinfo.phpt index 5c930dddce..f8be45305e 100644 --- a/tests/security/open_basedir_linkinfo.phpt +++ b/tests/security/open_basedir_linkinfo.phpt @@ -6,10 +6,13 @@ if (substr(PHP_OS, 0, 3) == 'WIN') { die('skip no symlinks on Windows'); } ?> ---INI-- -open_basedir=. +--XFAIL-- +BUG: open_basedir cannot delete symlink to prohibited file. See also +bugs 48111 and 52176. --FILE-- <?php +chdir(__DIR__); +ini_set("open_basedir", "."); require_once "open_basedir.inc"; $initdir = getcwd(); test_open_basedir_before("linkinfo", FALSE); @@ -57,8 +60,6 @@ int(%d) Warning: symlink(): open_basedir restriction in effect. File(%s/test/bad/bad.txt) is not within the allowed path(s): (.) in %s on line %d bool(false) int(%d) - -Warning: unlink(): open_basedir restriction in effect. File(%s/test/ok/symlink.txt) is not within the allowed path(s): (.) in %s on line %d -bool(false) +bool(true) *** Finished testing open_basedir configuration [linkinfo] *** diff --git a/tests/security/open_basedir_readlink.phpt b/tests/security/open_basedir_readlink.phpt index a632dce243..b102ee9d9c 100644 --- a/tests/security/open_basedir_readlink.phpt +++ b/tests/security/open_basedir_readlink.phpt @@ -6,10 +6,10 @@ if (substr(PHP_OS, 0, 3) == 'WIN') { die('skip no symlinks on Windows'); } ?> ---INI-- -open_basedir=. --FILE-- <?php +chdir(__DIR__); +ini_set("open_basedir", "."); require_once "open_basedir.inc"; $initdir = getcwd(); test_open_basedir_before("readlink", FALSE); @@ -32,7 +32,6 @@ $target = ($initdir."/test/ok/ok.txt"); $symlink = ($initdir."/test/ok/symlink.txt"); var_dump(symlink($target, $symlink)); var_dump(readlink($symlink)); -var_dump(unlink($symlink)); test_open_basedir_after("readlink"); ?> @@ -69,8 +68,5 @@ bool(false) Warning: readlink(): open_basedir restriction in effect. File(%s/test/ok/symlink.txt) is not within the allowed path(s): (.) in %s on line %d bool(false) - -Warning: unlink(): open_basedir restriction in effect. File(%s/test/ok/symlink.txt) is not within the allowed path(s): (.) in %s on line %d -bool(false) *** Finished testing open_basedir configuration [readlink] *** diff --git a/tests/strings/004.phpt b/tests/strings/004.phpt index a283fda699..7bcb452937 100644 --- a/tests/strings/004.phpt +++ b/tests/strings/004.phpt @@ -4,7 +4,6 @@ highlight_string() buffering highlight.string=#DD0000 highlight.comment=#FF9900 highlight.keyword=#007700 -highlight.bg=#FFFFFF highlight.default=#0000BB highlight.html=#000000 --FILE-- diff --git a/tests/strings/bug26703.phpt b/tests/strings/bug26703.phpt index ef2d81de4a..bea8fb1214 100644 --- a/tests/strings/bug26703.phpt +++ b/tests/strings/bug26703.phpt @@ -4,7 +4,6 @@ Bug #26703 (Certain characters inside strings incorrectly treated as keywords) highlight.string=#DD0000 highlight.comment=#FF9900 highlight.keyword=#007700 -highlight.bg=#FFFFFF highlight.default=#0000BB highlight.html=#000000 --FILE-- diff --git a/tests/strings/offsets_chaining_1.phpt b/tests/strings/offsets_chaining_1.phpt index 3aae90747c..eecdfb9637 100644 --- a/tests/strings/offsets_chaining_1.phpt +++ b/tests/strings/offsets_chaining_1.phpt @@ -8,4 +8,5 @@ $string = "foobar"; var_dump($string[0][0][0][0]); ?> --EXPECTF-- -Fatal error: Cannot use string offset as an array in %s on line %d +string(1) "f" + diff --git a/tests/strings/offsets_chaining_2.phpt b/tests/strings/offsets_chaining_2.phpt index 7a567cd125..07f67f0fd0 100644 --- a/tests/strings/offsets_chaining_2.phpt +++ b/tests/strings/offsets_chaining_2.phpt @@ -8,4 +8,5 @@ $string = "foobar"; var_dump($string{0}{0}[0][0]); ?> --EXPECTF-- -Fatal error: Cannot use string offset as an array in %s on line %d +string(1) "f" + diff --git a/tests/strings/offsets_chaining_3.phpt b/tests/strings/offsets_chaining_3.phpt index a5d1233a4c..23b8e70179 100644 --- a/tests/strings/offsets_chaining_3.phpt +++ b/tests/strings/offsets_chaining_3.phpt @@ -8,4 +8,5 @@ $string = "foobar"; var_dump(isset($string[0][0][0][0])); ?> --EXPECTF-- -Fatal error: Cannot use string offset as an array in %s on line %d +bool(true) + diff --git a/tests/strings/offsets_chaining_4.phpt b/tests/strings/offsets_chaining_4.phpt index 8049f66a09..79b95c135b 100644 --- a/tests/strings/offsets_chaining_4.phpt +++ b/tests/strings/offsets_chaining_4.phpt @@ -8,4 +8,5 @@ $string = "foobar"; var_dump(isset($string{0}{0}[0][0])); ?> --EXPECTF-- -Fatal error: Cannot use string offset as an array in %s on line %d +bool(true) + diff --git a/tests/strings/offsets_chaining_5.phpt b/tests/strings/offsets_chaining_5.phpt index bb811326f8..efcf2f3074 100644 --- a/tests/strings/offsets_chaining_5.phpt +++ b/tests/strings/offsets_chaining_5.phpt @@ -15,9 +15,13 @@ var_dump($array['expected_array']['foo']['bar']); --EXPECTF-- bool(true) string(6) "foobar" -bool(true) +bool(false) + +Warning: Illegal string offset 'foo' in %soffsets_chaining_5.php on line %d string(1) "f" bool(false) -Fatal error: Cannot use string offset as an array in %s on line %d +Warning: Illegal string offset 'foo' in %soffsets_chaining_5.php on line %d +Warning: Illegal string offset 'bar' in %soffsets_chaining_5.php on line %d +string(1) "f" diff --git a/tests/strings/offsets_general.phpt b/tests/strings/offsets_general.phpt index effe9dd1d2..9d69ea2bf5 100644 --- a/tests/strings/offsets_general.phpt +++ b/tests/strings/offsets_general.phpt @@ -18,16 +18,21 @@ var_dump(isset($string{0}{0})); var_dump($string{"foo"}); var_dump(isset($string{"foo"}{"bar"})); ?> ---EXPECT-- +--EXPECTF-- string(1) "f" string(1) "o" bool(true) -bool(false) +bool(true) + +Warning: Illegal string offset 'foo' in %s line %d string(1) "f" bool(false) string(1) "f" string(1) "o" bool(true) -bool(false) +bool(true) + +Warning: Illegal string offset 'foo' in %s line %d string(1) "f" bool(false) + |