diff options
author | Nikita Popov <nikita.ppv@gmail.com> | 2020-02-03 22:52:20 +0100 |
---|---|---|
committer | Nikita Popov <nikita.ppv@gmail.com> | 2020-02-03 22:52:20 +0100 |
commit | f8d795820e780a6322e054c26c581570613c14f0 (patch) | |
tree | 99d3ae01ce564752807341c5743863b4c92513f8 /ext/standard | |
parent | d2cb200e10ada6fa44c54a29292bb4665728fff0 (diff) | |
download | php-git-f8d795820e780a6322e054c26c581570613c14f0.tar.gz |
Reindent phpt files
Diffstat (limited to 'ext/standard')
949 files changed, 11539 insertions, 11539 deletions
diff --git a/ext/standard/tests/array/002.phpt b/ext/standard/tests/array/002.phpt index 8d088f9129..589514ae03 100644 --- a/ext/standard/tests/array/002.phpt +++ b/ext/standard/tests/array/002.phpt @@ -8,16 +8,16 @@ require(__DIR__ . '/data.inc'); function test_sort ($sort_function, $data) { echo "\n -- Testing $sort_function() -- \n"; - echo "No second argument:\n"; + echo "No second argument:\n"; $sort_function ($data); var_dump ($data); - echo "Using SORT_REGULAR:\n"; + echo "Using SORT_REGULAR:\n"; $sort_function ($data, SORT_REGULAR); var_dump ($data); - echo "Using SORT_NUMERIC:\n"; + echo "Using SORT_NUMERIC:\n"; $sort_function ($data, SORT_NUMERIC); var_dump ($data); - echo "Using SORT_STRING\n"; + echo "Using SORT_STRING\n"; $sort_function ($data, SORT_STRING); var_dump ($data); } diff --git a/ext/standard/tests/array/004.phpt b/ext/standard/tests/array/004.phpt index 765637b26c..0f9fc5507c 100644 --- a/ext/standard/tests/array/004.phpt +++ b/ext/standard/tests/array/004.phpt @@ -5,11 +5,11 @@ precision=14 --FILE-- <?php $data = array( - 'Test1', - 'teST2'=>0, - 5=>'test2', - 'abc'=>'test10', - 'test21' + 'Test1', + 'teST2'=>0, + 5=>'test2', + 'abc'=>'test10', + 'test21' ); var_dump($data); diff --git a/ext/standard/tests/array/007.phpt b/ext/standard/tests/array/007.phpt index 4a1270eca6..a1c984a18b 100644 --- a/ext/standard/tests/array/007.phpt +++ b/ext/standard/tests/array/007.phpt @@ -51,27 +51,27 @@ var_dump(array_diff_assoc($a,$b,$c)); echo "-=-=-=-=-=-=-=-=- New functionality from 5.0.0 -=-=-=-=-=-=-=-\n"; error_reporting(E_ALL); class cr { - private $priv_member; - public $public_member; - function __construct($val) { - $this->priv_member = $val; - $this->public_member = $val; - } - static function comp_func_cr($a, $b) { - if ($a->priv_member === $b->priv_member) return 0; - return ($a->priv_member > $b->priv_member)? 1:-1; - } + private $priv_member; + public $public_member; + function __construct($val) { + $this->priv_member = $val; + $this->public_member = $val; + } + static function comp_func_cr($a, $b) { + if ($a->priv_member === $b->priv_member) return 0; + return ($a->priv_member > $b->priv_member)? 1:-1; + } } function comp_func($a, $b) { - if ($a === $b) return 0; - return ($a > $b)? 1:-1; + if ($a === $b) return 0; + return ($a > $b)? 1:-1; } function comp_func_cr($a, $b) { - if ($a->public_member === $b->public_member) return 0; - return ($a->public_member > $b->public_member)? 1:-1; + if ($a->public_member === $b->public_member) return 0; + return ($a->public_member > $b->public_member)? 1:-1; } diff --git a/ext/standard/tests/array/array_change_key_case.phpt b/ext/standard/tests/array/array_change_key_case.phpt index ca9a21128b..115a7096d8 100644 --- a/ext/standard/tests/array/array_change_key_case.phpt +++ b/ext/standard/tests/array/array_change_key_case.phpt @@ -52,10 +52,10 @@ echo "*** Testing basic operations ***\n"; $loop_counter = 1; foreach ($arrays as $item) { echo "** Iteration $loop_counter **\n"; $loop_counter++; - var_dump(array_change_key_case($item)); - var_dump(array_change_key_case($item, CASE_UPPER)); - var_dump(array_change_key_case($item, CASE_LOWER)); - echo "\n"; + var_dump(array_change_key_case($item)); + var_dump(array_change_key_case($item, CASE_UPPER)); + var_dump(array_change_key_case($item, CASE_LOWER)); + echo "\n"; } echo "end\n"; diff --git a/ext/standard/tests/array/array_change_key_case_variation4.phpt b/ext/standard/tests/array/array_change_key_case_variation4.phpt index 52017177cc..eaacfaac58 100644 --- a/ext/standard/tests/array/array_change_key_case_variation4.phpt +++ b/ext/standard/tests/array/array_change_key_case_variation4.phpt @@ -15,9 +15,9 @@ echo "*** Testing array_change_key_case() : usage variations ***\n"; $input = array('One' => 'un', 'TWO' => 'deux', 'three' => 'trois'); for ($i = -5; $i <=5; $i += 1){ - echo "\n-- \$sort argument is $i --\n"; - $temp = $input; - var_dump(array_change_key_case($temp, $i)); + echo "\n-- \$sort argument is $i --\n"; + $temp = $input; + var_dump(array_change_key_case($temp, $i)); } echo "Done"; diff --git a/ext/standard/tests/array/array_change_key_case_variation8.phpt b/ext/standard/tests/array/array_change_key_case_variation8.phpt index 493862ccd4..17455c54da 100644 --- a/ext/standard/tests/array/array_change_key_case_variation8.phpt +++ b/ext/standard/tests/array/array_change_key_case_variation8.phpt @@ -14,18 +14,18 @@ Test array_change_key_case() function : usage variations - Different strings as echo "*** Testing array_change_key_case() : usage variations ***\n"; $inputs = array ( - // group of escape sequences - array(null => 1, NULL => 2, "\a" => 3, "\cx" => 4, "\e" => 5, "\f" => 6, "\n" => 7, "\t" => 8, "\xhh" => 9, "\ddd" => 10, "\v" => 11), + // group of escape sequences + array(null => 1, NULL => 2, "\a" => 3, "\cx" => 4, "\e" => 5, "\f" => 6, "\n" => 7, "\t" => 8, "\xhh" => 9, "\ddd" => 10, "\v" => 11), - // array contains combination of capital/small letters - array("lemoN" => 1, "Orange" => 2, "banana" => 3, "apple" => 4, "Test" => 5, "TTTT" => 6, "ttt" => 7, "ww" => 8, "x" => 9, "X" => 10, "oraNGe" => 11, "BANANA" => 12) + // array contains combination of capital/small letters + array("lemoN" => 1, "Orange" => 2, "banana" => 3, "apple" => 4, "Test" => 5, "TTTT" => 6, "ttt" => 7, "ww" => 8, "x" => 9, "X" => 10, "oraNGe" => 11, "BANANA" => 12) ); foreach($inputs as $input) { - echo "\n-- \$case = default --\n"; - var_dump(array_change_key_case($input)); - echo "-- \$case = upper --\n"; - var_dump(array_change_key_case($input, CASE_UPPER)); + echo "\n-- \$case = default --\n"; + var_dump(array_change_key_case($input)); + echo "-- \$case = upper --\n"; + var_dump(array_change_key_case($input, CASE_UPPER)); } echo "Done"; diff --git a/ext/standard/tests/array/array_chunk_variation10.phpt b/ext/standard/tests/array/array_chunk_variation10.phpt index be5fcdc7f3..326d7de98f 100644 --- a/ext/standard/tests/array/array_chunk_variation10.phpt +++ b/ext/standard/tests/array/array_chunk_variation10.phpt @@ -5,11 +5,11 @@ array_chunk() - variation 10 $array = array (1 => 1, 2 => 2, 3 => 3); var_dump ($array); for ($i = 1; $i < (sizeof($array) + 1); $i++) { - echo "[$i]\n"; - var_dump (array_chunk ($array, $i)); - var_dump (array_chunk ($array, $i, TRUE)); - var_dump (array_chunk ($array, $i, FALSE)); - echo "\n"; + echo "[$i]\n"; + var_dump (array_chunk ($array, $i)); + var_dump (array_chunk ($array, $i, TRUE)); + var_dump (array_chunk ($array, $i, FALSE)); + echo "\n"; } ?> --EXPECT-- diff --git a/ext/standard/tests/array/array_chunk_variation11.phpt b/ext/standard/tests/array/array_chunk_variation11.phpt index 09ec255744..e3ce445370 100644 --- a/ext/standard/tests/array/array_chunk_variation11.phpt +++ b/ext/standard/tests/array/array_chunk_variation11.phpt @@ -6,11 +6,11 @@ $array = array (0 => 0, 3 => 2); var_dump ($array); for ($i = 1; $i < (sizeof($array) + 1); $i++) { - echo "[$i]\n"; - var_dump (array_chunk ($array, $i)); - var_dump (array_chunk ($array, $i, TRUE)); - var_dump (array_chunk ($array, $i, FALSE)); - echo "\n"; + echo "[$i]\n"; + var_dump (array_chunk ($array, $i)); + var_dump (array_chunk ($array, $i, TRUE)); + var_dump (array_chunk ($array, $i, FALSE)); + echo "\n"; } ?> --EXPECT-- diff --git a/ext/standard/tests/array/array_chunk_variation12.phpt b/ext/standard/tests/array/array_chunk_variation12.phpt index f85f2a8c0d..3b0cb79beb 100644 --- a/ext/standard/tests/array/array_chunk_variation12.phpt +++ b/ext/standard/tests/array/array_chunk_variation12.phpt @@ -5,11 +5,11 @@ array_chunk() - variation 12 $array = array (1 => 1, 5 => 2, 8 => 3); var_dump ($array); for ($i = 1; $i < (sizeof($array) + 1); $i++) { - echo "[$i]\n"; - var_dump (array_chunk ($array, $i)); - var_dump (array_chunk ($array, $i, TRUE)); - var_dump (array_chunk ($array, $i, FALSE)); - echo "\n"; + echo "[$i]\n"; + var_dump (array_chunk ($array, $i)); + var_dump (array_chunk ($array, $i, TRUE)); + var_dump (array_chunk ($array, $i, FALSE)); + echo "\n"; } ?> --EXPECT-- diff --git a/ext/standard/tests/array/array_chunk_variation13.phpt b/ext/standard/tests/array/array_chunk_variation13.phpt index 5cd6f0ea34..f62d309c15 100644 --- a/ext/standard/tests/array/array_chunk_variation13.phpt +++ b/ext/standard/tests/array/array_chunk_variation13.phpt @@ -5,11 +5,11 @@ array_chunk() - variation 13 $array = array (1, 2); var_dump ($array); for ($i = 1; $i < (sizeof($array) + 1); $i++) { - echo "[$i]\n"; - var_dump (array_chunk ($array, $i)); - var_dump (array_chunk ($array, $i, TRUE)); - var_dump (array_chunk ($array, $i, FALSE)); - echo "\n"; + echo "[$i]\n"; + var_dump (array_chunk ($array, $i)); + var_dump (array_chunk ($array, $i, TRUE)); + var_dump (array_chunk ($array, $i, FALSE)); + echo "\n"; } ?> --EXPECT-- diff --git a/ext/standard/tests/array/array_chunk_variation14.phpt b/ext/standard/tests/array/array_chunk_variation14.phpt index 97fce1e722..64746bf6e7 100644 --- a/ext/standard/tests/array/array_chunk_variation14.phpt +++ b/ext/standard/tests/array/array_chunk_variation14.phpt @@ -5,11 +5,11 @@ array_chunk() - variation 14 $array = array (0, 1, 2); var_dump ($array); for ($i = 1; $i < (sizeof($array) + 1); $i++) { - echo "[$i]\n"; - var_dump (array_chunk ($array, $i)); - var_dump (array_chunk ($array, $i, TRUE)); - var_dump (array_chunk ($array, $i, FALSE)); - echo "\n"; + echo "[$i]\n"; + var_dump (array_chunk ($array, $i)); + var_dump (array_chunk ($array, $i, TRUE)); + var_dump (array_chunk ($array, $i, FALSE)); + echo "\n"; } ?> --EXPECT-- diff --git a/ext/standard/tests/array/array_chunk_variation15.phpt b/ext/standard/tests/array/array_chunk_variation15.phpt index c48af63f6c..294dd9f8f9 100644 --- a/ext/standard/tests/array/array_chunk_variation15.phpt +++ b/ext/standard/tests/array/array_chunk_variation15.phpt @@ -5,11 +5,11 @@ array_chunk() - variation 15 $array = array (1, 2, 3); var_dump ($array); for ($i = 1; $i < (sizeof($array) + 1); $i++) { - echo "[$i]\n"; - var_dump (array_chunk ($array, $i)); - var_dump (array_chunk ($array, $i, TRUE)); - var_dump (array_chunk ($array, $i, FALSE)); - echo "\n"; + echo "[$i]\n"; + var_dump (array_chunk ($array, $i)); + var_dump (array_chunk ($array, $i, TRUE)); + var_dump (array_chunk ($array, $i, FALSE)); + echo "\n"; } ?> --EXPECT-- diff --git a/ext/standard/tests/array/array_chunk_variation16.phpt b/ext/standard/tests/array/array_chunk_variation16.phpt index 3426f9278b..b7159cba99 100644 --- a/ext/standard/tests/array/array_chunk_variation16.phpt +++ b/ext/standard/tests/array/array_chunk_variation16.phpt @@ -5,11 +5,11 @@ array_chunk() - variation 16 $array = array (0, 1, 2, 3); var_dump ($array); for ($i = 1; $i < (sizeof($array) + 1); $i++) { - echo "[$i]\n"; - var_dump (array_chunk ($array, $i)); - var_dump (array_chunk ($array, $i, TRUE)); - var_dump (array_chunk ($array, $i, FALSE)); - echo "\n"; + echo "[$i]\n"; + var_dump (array_chunk ($array, $i)); + var_dump (array_chunk ($array, $i, TRUE)); + var_dump (array_chunk ($array, $i, FALSE)); + echo "\n"; } ?> --EXPECT-- diff --git a/ext/standard/tests/array/array_chunk_variation17.phpt b/ext/standard/tests/array/array_chunk_variation17.phpt index 1a8bb5d340..07826d06f8 100644 --- a/ext/standard/tests/array/array_chunk_variation17.phpt +++ b/ext/standard/tests/array/array_chunk_variation17.phpt @@ -5,11 +5,11 @@ array_chunk() - variation 17 $array = array (1, 2, 3, 4); var_dump ($array); for ($i = 1; $i < (sizeof($array) + 1); $i++) { - echo "[$i]\n"; - var_dump (array_chunk ($array, $i)); - var_dump (array_chunk ($array, $i, TRUE)); - var_dump (array_chunk ($array, $i, FALSE)); - echo "\n"; + echo "[$i]\n"; + var_dump (array_chunk ($array, $i)); + var_dump (array_chunk ($array, $i, TRUE)); + var_dump (array_chunk ($array, $i, FALSE)); + echo "\n"; } ?> --EXPECT-- diff --git a/ext/standard/tests/array/array_chunk_variation18.phpt b/ext/standard/tests/array/array_chunk_variation18.phpt index 593c702ce9..1fa9ca6ec4 100644 --- a/ext/standard/tests/array/array_chunk_variation18.phpt +++ b/ext/standard/tests/array/array_chunk_variation18.phpt @@ -5,11 +5,11 @@ array_chunk() - variation 18 $array = array (0, 1, 2, 3, 4); var_dump ($array); for ($i = 1; $i < (sizeof($array) + 1); $i++) { - echo "[$i]\n"; - var_dump (array_chunk ($array, $i)); - var_dump (array_chunk ($array, $i, TRUE)); - var_dump (array_chunk ($array, $i, FALSE)); - echo "\n"; + echo "[$i]\n"; + var_dump (array_chunk ($array, $i)); + var_dump (array_chunk ($array, $i, TRUE)); + var_dump (array_chunk ($array, $i, FALSE)); + echo "\n"; } ?> --EXPECT-- diff --git a/ext/standard/tests/array/array_chunk_variation19.phpt b/ext/standard/tests/array/array_chunk_variation19.phpt index f160cba263..2591db89eb 100644 --- a/ext/standard/tests/array/array_chunk_variation19.phpt +++ b/ext/standard/tests/array/array_chunk_variation19.phpt @@ -5,11 +5,11 @@ array_chunk() - variation 19 $array = array (1, 2, 3, 4, 5, 6, 7, 8, 9, 10); var_dump ($array); for ($i = 1; $i < (sizeof($array) + 1); $i++) { - echo "[$i]\n"; - var_dump (array_chunk ($array, $i)); - var_dump (array_chunk ($array, $i, TRUE)); - var_dump (array_chunk ($array, $i, FALSE)); - echo "\n"; + echo "[$i]\n"; + var_dump (array_chunk ($array, $i)); + var_dump (array_chunk ($array, $i, TRUE)); + var_dump (array_chunk ($array, $i, FALSE)); + echo "\n"; } ?> --EXPECT-- diff --git a/ext/standard/tests/array/array_chunk_variation20.phpt b/ext/standard/tests/array/array_chunk_variation20.phpt index d47279915c..ec2e45b104 100644 --- a/ext/standard/tests/array/array_chunk_variation20.phpt +++ b/ext/standard/tests/array/array_chunk_variation20.phpt @@ -5,11 +5,11 @@ array_chunk() - variation 20 $array = array (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10); var_dump ($array); for ($i = 1; $i < (sizeof($array) + 1); $i++) { - echo "[$i]\n"; - var_dump (array_chunk ($array, $i)); - var_dump (array_chunk ($array, $i, TRUE)); - var_dump (array_chunk ($array, $i, FALSE)); - echo "\n"; + echo "[$i]\n"; + var_dump (array_chunk ($array, $i)); + var_dump (array_chunk ($array, $i, TRUE)); + var_dump (array_chunk ($array, $i, FALSE)); + echo "\n"; } ?> --EXPECT-- diff --git a/ext/standard/tests/array/array_chunk_variation21.phpt b/ext/standard/tests/array/array_chunk_variation21.phpt index e8c7784325..ce672a9209 100644 --- a/ext/standard/tests/array/array_chunk_variation21.phpt +++ b/ext/standard/tests/array/array_chunk_variation21.phpt @@ -5,11 +5,11 @@ array_chunk() - variation 21 $array = array ("a" => 1); var_dump ($array); for ($i = 1; $i < (sizeof($array) + 1); $i++) { - echo "[$i]\n"; - var_dump (array_chunk ($array, $i)); - var_dump (array_chunk ($array, $i, TRUE)); - var_dump (array_chunk ($array, $i, FALSE)); - echo "\n"; + echo "[$i]\n"; + var_dump (array_chunk ($array, $i)); + var_dump (array_chunk ($array, $i, TRUE)); + var_dump (array_chunk ($array, $i, FALSE)); + echo "\n"; } ?> --EXPECT-- diff --git a/ext/standard/tests/array/array_chunk_variation22.phpt b/ext/standard/tests/array/array_chunk_variation22.phpt index b0eeade3ab..d67269f4e7 100644 --- a/ext/standard/tests/array/array_chunk_variation22.phpt +++ b/ext/standard/tests/array/array_chunk_variation22.phpt @@ -5,11 +5,11 @@ array_chunk() - variation 22 $array = array ("b" => 1, "c" => 2); var_dump ($array); for ($i = 1; $i < (sizeof($array) + 1); $i++) { - echo "[$i]\n"; - var_dump (array_chunk ($array, $i)); - var_dump (array_chunk ($array, $i, TRUE)); - var_dump (array_chunk ($array, $i, FALSE)); - echo "\n"; + echo "[$i]\n"; + var_dump (array_chunk ($array, $i)); + var_dump (array_chunk ($array, $i, TRUE)); + var_dump (array_chunk ($array, $i, FALSE)); + echo "\n"; } ?> --EXPECT-- diff --git a/ext/standard/tests/array/array_chunk_variation23.phpt b/ext/standard/tests/array/array_chunk_variation23.phpt index 87ced15132..99138eaeb3 100644 --- a/ext/standard/tests/array/array_chunk_variation23.phpt +++ b/ext/standard/tests/array/array_chunk_variation23.phpt @@ -5,11 +5,11 @@ array_chunk() - variation 23 $array = array ("p" => 1, "q" => 2, "r" => 3, "s" => 4, "u" => 5, "v" => 6); var_dump ($array); for ($i = 1; $i < (sizeof($array) + 1); $i++) { - echo "[$i]\n"; - var_dump (array_chunk ($array, $i)); - var_dump (array_chunk ($array, $i, TRUE)); - var_dump (array_chunk ($array, $i, FALSE)); - echo "\n"; + echo "[$i]\n"; + var_dump (array_chunk ($array, $i)); + var_dump (array_chunk ($array, $i, TRUE)); + var_dump (array_chunk ($array, $i, FALSE)); + echo "\n"; } ?> --EXPECT-- diff --git a/ext/standard/tests/array/array_chunk_variation24.phpt b/ext/standard/tests/array/array_chunk_variation24.phpt index 69dce7be17..c96d59d874 100644 --- a/ext/standard/tests/array/array_chunk_variation24.phpt +++ b/ext/standard/tests/array/array_chunk_variation24.phpt @@ -5,11 +5,11 @@ array_chunk() - variation 24 $array = array ("a" => "A"); var_dump ($array); for ($i = 1; $i < (sizeof($array) + 1); $i++) { - echo "[$i]\n"; - var_dump (array_chunk ($array, $i)); - var_dump (array_chunk ($array, $i, TRUE)); - var_dump (array_chunk ($array, $i, FALSE)); - echo "\n"; + echo "[$i]\n"; + var_dump (array_chunk ($array, $i)); + var_dump (array_chunk ($array, $i, TRUE)); + var_dump (array_chunk ($array, $i, FALSE)); + echo "\n"; } ?> --EXPECT-- diff --git a/ext/standard/tests/array/array_chunk_variation25.phpt b/ext/standard/tests/array/array_chunk_variation25.phpt index 09303c30ba..978588e02c 100644 --- a/ext/standard/tests/array/array_chunk_variation25.phpt +++ b/ext/standard/tests/array/array_chunk_variation25.phpt @@ -5,11 +5,11 @@ array_chunk() - variation 25 $array = array ("p" => "A", "q" => "B", "r" => "C", "s" => "D", "u" => "E", "v" => "F"); var_dump ($array); for ($i = 1; $i < (sizeof($array) + 1); $i++) { - echo "[$i]\n"; - var_dump (array_chunk ($array, $i)); - var_dump (array_chunk ($array, $i, TRUE)); - var_dump (array_chunk ($array, $i, FALSE)); - echo "\n"; + echo "[$i]\n"; + var_dump (array_chunk ($array, $i)); + var_dump (array_chunk ($array, $i, TRUE)); + var_dump (array_chunk ($array, $i, FALSE)); + echo "\n"; } ?> --EXPECT-- diff --git a/ext/standard/tests/array/array_chunk_variation26.phpt b/ext/standard/tests/array/array_chunk_variation26.phpt index ca6975a64e..7b46215ffb 100644 --- a/ext/standard/tests/array/array_chunk_variation26.phpt +++ b/ext/standard/tests/array/array_chunk_variation26.phpt @@ -5,11 +5,11 @@ array_chunk() - variation 26 $array =array (0); var_dump ($array); for ($i = 1; $i < (sizeof($array) + 1); $i++) { - echo "[$i]\n"; - var_dump (array_chunk ($array, $i)); - var_dump (array_chunk ($array, $i, TRUE)); - var_dump (array_chunk ($array, $i, FALSE)); - echo "\n"; + echo "[$i]\n"; + var_dump (array_chunk ($array, $i)); + var_dump (array_chunk ($array, $i, TRUE)); + var_dump (array_chunk ($array, $i, FALSE)); + echo "\n"; } ?> --EXPECT-- diff --git a/ext/standard/tests/array/array_chunk_variation27.phpt b/ext/standard/tests/array/array_chunk_variation27.phpt index aa91036a52..a91a8b91b9 100644 --- a/ext/standard/tests/array/array_chunk_variation27.phpt +++ b/ext/standard/tests/array/array_chunk_variation27.phpt @@ -5,11 +5,11 @@ array_chunk() - variation 27 $array = array (1); var_dump ($array); for ($i = 1; $i < (sizeof($array) + 1); $i++) { - echo "[$i]\n"; - var_dump (array_chunk ($array, $i)); - var_dump (array_chunk ($array, $i, TRUE)); - var_dump (array_chunk ($array, $i, FALSE)); - echo "\n"; + echo "[$i]\n"; + var_dump (array_chunk ($array, $i)); + var_dump (array_chunk ($array, $i, TRUE)); + var_dump (array_chunk ($array, $i, FALSE)); + echo "\n"; } ?> --EXPECT-- diff --git a/ext/standard/tests/array/array_chunk_variation28.phpt b/ext/standard/tests/array/array_chunk_variation28.phpt index 5389049ce4..707b0cdefc 100644 --- a/ext/standard/tests/array/array_chunk_variation28.phpt +++ b/ext/standard/tests/array/array_chunk_variation28.phpt @@ -5,11 +5,11 @@ array_chunk() - variation 28 $array = array (-1); var_dump ($array); for ($i = 1; $i < (sizeof($array) + 1); $i++) { - echo "[$i]\n"; - var_dump (array_chunk ($array, $i)); - var_dump (array_chunk ($array, $i, TRUE)); - var_dump (array_chunk ($array, $i, FALSE)); - echo "\n"; + echo "[$i]\n"; + var_dump (array_chunk ($array, $i)); + var_dump (array_chunk ($array, $i, TRUE)); + var_dump (array_chunk ($array, $i, FALSE)); + echo "\n"; } ?> --EXPECT-- diff --git a/ext/standard/tests/array/array_chunk_variation29.phpt b/ext/standard/tests/array/array_chunk_variation29.phpt index f18de5ea85..07187135be 100644 --- a/ext/standard/tests/array/array_chunk_variation29.phpt +++ b/ext/standard/tests/array/array_chunk_variation29.phpt @@ -5,11 +5,11 @@ array_chunk() - variation 29 $array = array (0, 2); var_dump ($array); for ($i = 1; $i < (sizeof($array) + 1); $i++) { - echo "[$i]\n"; - var_dump (array_chunk ($array, $i)); - var_dump (array_chunk ($array, $i, TRUE)); - var_dump (array_chunk ($array, $i, FALSE)); - echo "\n"; + echo "[$i]\n"; + var_dump (array_chunk ($array, $i)); + var_dump (array_chunk ($array, $i, TRUE)); + var_dump (array_chunk ($array, $i, FALSE)); + echo "\n"; } ?> --EXPECT-- diff --git a/ext/standard/tests/array/array_chunk_variation30.phpt b/ext/standard/tests/array/array_chunk_variation30.phpt index 0dbd9b6368..5400b595eb 100644 --- a/ext/standard/tests/array/array_chunk_variation30.phpt +++ b/ext/standard/tests/array/array_chunk_variation30.phpt @@ -5,11 +5,11 @@ array_chunk() - variation 30 $array = array (1, 2, 3); var_dump ($array); for ($i = 1; $i < (sizeof($array) + 1); $i++) { - echo "[$i]\n"; - var_dump (array_chunk ($array, $i)); - var_dump (array_chunk ($array, $i, TRUE)); - var_dump (array_chunk ($array, $i, FALSE)); - echo "\n"; + echo "[$i]\n"; + var_dump (array_chunk ($array, $i)); + var_dump (array_chunk ($array, $i, TRUE)); + var_dump (array_chunk ($array, $i, FALSE)); + echo "\n"; } ?> --EXPECT-- diff --git a/ext/standard/tests/array/array_chunk_variation31.phpt b/ext/standard/tests/array/array_chunk_variation31.phpt index fd7f358ca0..ffdfa2bc13 100644 --- a/ext/standard/tests/array/array_chunk_variation31.phpt +++ b/ext/standard/tests/array/array_chunk_variation31.phpt @@ -5,11 +5,11 @@ array_chunk() - variation 31 $array = array (1 => 0); var_dump ($array); for ($i = 1; $i < (sizeof($array) + 1); $i++) { - echo "[$i]\n"; - var_dump (array_chunk ($array, $i)); - var_dump (array_chunk ($array, $i, TRUE)); - var_dump (array_chunk ($array, $i, FALSE)); - echo "\n"; + echo "[$i]\n"; + var_dump (array_chunk ($array, $i)); + var_dump (array_chunk ($array, $i, TRUE)); + var_dump (array_chunk ($array, $i, FALSE)); + echo "\n"; } ?> --EXPECT-- diff --git a/ext/standard/tests/array/array_chunk_variation32.phpt b/ext/standard/tests/array/array_chunk_variation32.phpt index 09471a59aa..b0a01f209a 100644 --- a/ext/standard/tests/array/array_chunk_variation32.phpt +++ b/ext/standard/tests/array/array_chunk_variation32.phpt @@ -5,11 +5,11 @@ array_chunk() - variation 32 $array = array (2 => 1); var_dump ($array); for ($i = 1; $i < (sizeof($array) + 1); $i++) { - echo "[$i]\n"; - var_dump (array_chunk ($array, $i)); - var_dump (array_chunk ($array, $i, TRUE)); - var_dump (array_chunk ($array, $i, FALSE)); - echo "\n"; + echo "[$i]\n"; + var_dump (array_chunk ($array, $i)); + var_dump (array_chunk ($array, $i, TRUE)); + var_dump (array_chunk ($array, $i, FALSE)); + echo "\n"; } ?> --EXPECT-- diff --git a/ext/standard/tests/array/array_chunk_variation8.phpt b/ext/standard/tests/array/array_chunk_variation8.phpt index 64b9bb2036..2d8fa07c97 100644 --- a/ext/standard/tests/array/array_chunk_variation8.phpt +++ b/ext/standard/tests/array/array_chunk_variation8.phpt @@ -5,11 +5,11 @@ array_chunk() - variation 8 $array = array (3 => -1); var_dump ($array); for ($i = 1; $i < (sizeof($array) + 1); $i++) { - echo "[$i]\n"; - var_dump (array_chunk ($array, $i)); - var_dump (array_chunk ($array, $i, TRUE)); - var_dump (array_chunk ($array, $i, FALSE)); - echo "\n"; + echo "[$i]\n"; + var_dump (array_chunk ($array, $i)); + var_dump (array_chunk ($array, $i, TRUE)); + var_dump (array_chunk ($array, $i, FALSE)); + echo "\n"; } ?> --EXPECT-- diff --git a/ext/standard/tests/array/array_chunk_variation9.phpt b/ext/standard/tests/array/array_chunk_variation9.phpt index a68240e6f6..2be7b81e83 100644 --- a/ext/standard/tests/array/array_chunk_variation9.phpt +++ b/ext/standard/tests/array/array_chunk_variation9.phpt @@ -5,11 +5,11 @@ array_chunk() - variation 9 $array = array (1 => 0, 2 => 2); var_dump ($array); for ($i = 1; $i < (sizeof($array) + 1); $i++) { - echo "[$i]\n"; - var_dump (array_chunk ($array, $i)); - var_dump (array_chunk ($array, $i, TRUE)); - var_dump (array_chunk ($array, $i, FALSE)); - echo "\n"; + echo "[$i]\n"; + var_dump (array_chunk ($array, $i)); + var_dump (array_chunk ($array, $i, TRUE)); + var_dump (array_chunk ($array, $i, FALSE)); + echo "\n"; } ?> --EXPECT-- diff --git a/ext/standard/tests/array/array_column_basic.phpt b/ext/standard/tests/array/array_column_basic.phpt index 418f373872..57056b971f 100644 --- a/ext/standard/tests/array/array_column_basic.phpt +++ b/ext/standard/tests/array/array_column_basic.phpt @@ -12,21 +12,21 @@ Test array_column() function: basic functionality echo "*** Testing array_column() : basic functionality ***\n"; /* Array representing a possible record set returned from a database */ $records = array( - array( - 'id' => 1, - 'first_name' => 'John', - 'last_name' => 'Doe' - ), - array( - 'id' => 2, - 'first_name' => 'Sally', - 'last_name' => 'Smith' - ), - array( - 'id' => 3, - 'first_name' => 'Jane', - 'last_name' => 'Jones' - ) + array( + 'id' => 1, + 'first_name' => 'John', + 'last_name' => 'Doe' + ), + array( + 'id' => 2, + 'first_name' => 'Sally', + 'last_name' => 'Smith' + ), + array( + 'id' => 3, + 'first_name' => 'Jane', + 'last_name' => 'Jones' + ) ); echo "-- first_name column from recordset --\n"; @@ -44,47 +44,47 @@ var_dump(array_column($records, 'last_name', 'first_name')); echo "\n*** Testing multiple data types ***\n"; $fh = fopen(__FILE__, 'r', true); $values = array( - array( - 'id' => 1, - 'value' => new stdClass - ), - array( - 'id' => 2, - 'value' => 34.2345 - ), - array( - 'id' => 3, - 'value' => true - ), - array( - 'id' => 4, - 'value' => false - ), - array( - 'id' => 5, - 'value' => null - ), - array( - 'id' => 6, - 'value' => 1234 - ), - array( - 'id' => 7, - 'value' => 'Foo' - ), - array( - 'id' => 8, - 'value' => $fh - ) + array( + 'id' => 1, + 'value' => new stdClass + ), + array( + 'id' => 2, + 'value' => 34.2345 + ), + array( + 'id' => 3, + 'value' => true + ), + array( + 'id' => 4, + 'value' => false + ), + array( + 'id' => 5, + 'value' => null + ), + array( + 'id' => 6, + 'value' => 1234 + ), + array( + 'id' => 7, + 'value' => 'Foo' + ), + array( + 'id' => 8, + 'value' => $fh + ) ); var_dump(array_column($values, 'value')); var_dump(array_column($values, 'value', 'id')); echo "\n*** Testing numeric column keys ***\n"; $numericCols = array( - array('aaa', '111'), - array('bbb', '222'), - array('ccc', '333', -1 => 'ddd') + array('aaa', '111'), + array('bbb', '222'), + array('ccc', '333', -1 => 'ddd') ); var_dump(array_column($numericCols, 1)); var_dump(array_column($numericCols, 1, 0)); diff --git a/ext/standard/tests/array/array_column_variant_objects.phpt b/ext/standard/tests/array/array_column_variant_objects.phpt index dc9c0e7e8f..612573e8fd 100644 --- a/ext/standard/tests/array/array_column_variant_objects.phpt +++ b/ext/standard/tests/array/array_column_variant_objects.phpt @@ -5,14 +5,14 @@ Test array_column() function: testing with objects class User { - public $id, $first_name, $last_name; - - public function __construct($id, $first_name, $last_name) - { - $this->id = $id; - $this->first_name = $first_name; - $this->last_name = $last_name; - } + public $id, $first_name, $last_name; + + public function __construct($id, $first_name, $last_name) + { + $this->id = $id; + $this->first_name = $first_name; + $this->last_name = $last_name; + } } function newUser($id, $first_name, $last_name) @@ -27,15 +27,15 @@ function newUser($id, $first_name, $last_name) class Something { - public function __isset($name) - { - return $name == 'first_name'; - } - - public function __get($name) - { - return new User(4, 'Jack', 'Sparrow'); - } + public function __isset($name) + { + return $name == 'first_name'; + } + + public function __get($name) + { + return new User(4, 'Jack', 'Sparrow'); + } } $records = array( @@ -45,7 +45,7 @@ $records = array( new User(1, 'John', 'Doe'), new User(2, 'Sally', 'Smith'), new User(3, 'Jane', 'Jones'), - new Something, + new Something, ); echo "*** Testing array_column() : object property fetching (numeric property names) ***\n"; diff --git a/ext/standard/tests/array/array_combine.phpt b/ext/standard/tests/array/array_combine.phpt index 28eb54929e..b1b707aed6 100644 --- a/ext/standard/tests/array/array_combine.phpt +++ b/ext/standard/tests/array/array_combine.phpt @@ -2,30 +2,30 @@ basic array_combine test --FILE-- <?php - $array1 = array('green', 'red', 'yellow'); - $array2 = array('1', '2', '3'); - $array3 = array(0, 1, 2); - $array4 = array(TRUE, FALSE, NULL); - $a = array_combine($array1, $array1); - $b = array_combine($array1, $array2); - $c = array_combine($array1, $array3); - $d = array_combine($array1, $array4); - $e = array_combine($array2, $array1); - $f = array_combine($array2, $array2); - $g = array_combine($array2, $array3); - $h = array_combine($array2, $array4); - $i = array_combine($array3, $array1); - $j = array_combine($array3, $array2); - $k = array_combine($array3, $array3); - $l = array_combine($array3, $array4); - $m = array_combine($array4, $array1); - $n = array_combine($array4, $array2); - $o = array_combine($array4, $array3); - $p = array_combine($array4, $array4); - for($letter = "a"; $letter <= "p"; $letter++) - { - print_r($$letter); - } + $array1 = array('green', 'red', 'yellow'); + $array2 = array('1', '2', '3'); + $array3 = array(0, 1, 2); + $array4 = array(TRUE, FALSE, NULL); + $a = array_combine($array1, $array1); + $b = array_combine($array1, $array2); + $c = array_combine($array1, $array3); + $d = array_combine($array1, $array4); + $e = array_combine($array2, $array1); + $f = array_combine($array2, $array2); + $g = array_combine($array2, $array3); + $h = array_combine($array2, $array4); + $i = array_combine($array3, $array1); + $j = array_combine($array3, $array2); + $k = array_combine($array3, $array3); + $l = array_combine($array3, $array4); + $m = array_combine($array4, $array1); + $n = array_combine($array4, $array2); + $o = array_combine($array4, $array3); + $p = array_combine($array4, $array4); + for($letter = "a"; $letter <= "p"; $letter++) + { + print_r($$letter); + } ?> --EXPECT-- Array diff --git a/ext/standard/tests/array/array_count_values.phpt b/ext/standard/tests/array/array_count_values.phpt index a6424aab9a..eb51512430 100644 --- a/ext/standard/tests/array/array_count_values.phpt +++ b/ext/standard/tests/array/array_count_values.phpt @@ -3,23 +3,23 @@ array_count_values() --FILE-- <?php $arrays = array ( - array (), - array (0), - array (1), - array (-1), - array (0, 0), - array (0, 1), - array (1, 1), - array (1, "hello", 1, "world", "hello"), - array ("hello", "world", "hello"), - array ("", "world", "", "hello", "world", "hello", "hello", "world", "hello"), - array (0, array (1, "hello", 1, "world", "hello")), - array (1, array (1, "hello", 1, "world", "hello"), array (1, "hello", 1, "world", "hello"), array (1, "hello", 1, "world", "hello")), + array (), + array (0), + array (1), + array (-1), + array (0, 0), + array (0, 1), + array (1, 1), + array (1, "hello", 1, "world", "hello"), + array ("hello", "world", "hello"), + array ("", "world", "", "hello", "world", "hello", "hello", "world", "hello"), + array (0, array (1, "hello", 1, "world", "hello")), + array (1, array (1, "hello", 1, "world", "hello"), array (1, "hello", 1, "world", "hello"), array (1, "hello", 1, "world", "hello")), ); foreach ($arrays as $item) { - var_dump (@array_count_values ($item)); - echo "\n"; + var_dump (@array_count_values ($item)); + echo "\n"; } ?> --EXPECT-- diff --git a/ext/standard/tests/array/array_count_values2.phpt b/ext/standard/tests/array/array_count_values2.phpt index cb0c330965..a38b02c8be 100644 --- a/ext/standard/tests/array/array_count_values2.phpt +++ b/ext/standard/tests/array/array_count_values2.phpt @@ -3,18 +3,18 @@ basic array_count_values test --FILE-- <?php $array1 = array(1, - "hello", - 1, - "world", - "hello", - "", - "rabbit", - "foo", - "Foo", - TRUE, - FALSE, - NULL, - 0); + "hello", + 1, + "world", + "hello", + "", + "rabbit", + "foo", + "Foo", + TRUE, + FALSE, + NULL, + 0); var_dump(array_count_values($array1)); ?> --EXPECTF-- diff --git a/ext/standard/tests/array/array_count_values_variation.phpt b/ext/standard/tests/array/array_count_values_variation.phpt index 00f13c8a5b..2156db0ad9 100644 --- a/ext/standard/tests/array/array_count_values_variation.phpt +++ b/ext/standard/tests/array/array_count_values_variation.phpt @@ -15,9 +15,9 @@ Test array_count_values() function : Test all normal parameter variations echo "*** Testing array_count_values() : parameter variations ***\n"; class A { - static function hello() { - echo "Hello\n"; - } + static function hello() { + echo "Hello\n"; + } } $ob = new A(); diff --git a/ext/standard/tests/array/array_diff_assoc_variation1.phpt b/ext/standard/tests/array/array_diff_assoc_variation1.phpt index 270660a8cf..a723930b34 100644 --- a/ext/standard/tests/array/array_diff_assoc_variation1.phpt +++ b/ext/standard/tests/array/array_diff_assoc_variation1.phpt @@ -73,7 +73,7 @@ $inputs = array( // binary data /*21*/ b"binary", - (binary)"binary", + (binary)"binary", // object data /*23*/ new classA(), diff --git a/ext/standard/tests/array/array_diff_assoc_variation2.phpt b/ext/standard/tests/array/array_diff_assoc_variation2.phpt index 9185b53439..dc5e7c87c3 100644 --- a/ext/standard/tests/array/array_diff_assoc_variation2.phpt +++ b/ext/standard/tests/array/array_diff_assoc_variation2.phpt @@ -73,7 +73,7 @@ $inputs = array( // binary data /*21*/ b"binary", - (binary)"binary", + (binary)"binary", // object data /*23*/ new classA(), diff --git a/ext/standard/tests/array/array_diff_assoc_variation3.phpt b/ext/standard/tests/array/array_diff_assoc_variation3.phpt index 959ddd5428..023beb1ed0 100644 --- a/ext/standard/tests/array/array_diff_assoc_variation3.phpt +++ b/ext/standard/tests/array/array_diff_assoc_variation3.phpt @@ -39,7 +39,7 @@ $inputs = array( // int data /*1*/ 'int' => array( - 0, + 0, 1, 12345, -2345), @@ -84,7 +84,7 @@ $inputs = array( /*7*/ 'binary' => array( b"binary", - (binary)"binary"), + (binary)"binary"), // object data /*8*/ diff --git a/ext/standard/tests/array/array_diff_assoc_variation4.phpt b/ext/standard/tests/array/array_diff_assoc_variation4.phpt index 8cb05f8562..70ea73f96d 100644 --- a/ext/standard/tests/array/array_diff_assoc_variation4.phpt +++ b/ext/standard/tests/array/array_diff_assoc_variation4.phpt @@ -75,7 +75,7 @@ $inputs = array( /*7*/ 'binary' => array( b"binary1" => 'binary 1', - (binary)"binary2" => 'binary 2'), + (binary)"binary2" => 'binary 2'), // undefined data /*8*/ diff --git a/ext/standard/tests/array/array_diff_assoc_variation6.phpt b/ext/standard/tests/array/array_diff_assoc_variation6.phpt index bfbb0582ea..b4ef6d2304 100644 --- a/ext/standard/tests/array/array_diff_assoc_variation6.phpt +++ b/ext/standard/tests/array/array_diff_assoc_variation6.phpt @@ -28,41 +28,41 @@ $inputs = array ( //numeric keys => string values /*2*/ array(2 => '2.00000000000001', - 1 => '1', - 0 => 'zero', - 3 => 'a'), + 1 => '1', + 0 => 'zero', + 3 => 'a'), //string keys => string values /*3*/ array('2' => '2.00000000000001', - '1' => '1', - '0' => 'zero', - '3' => 'a') , + '1' => '1', + '0' => 'zero', + '3' => 'a') , //default keys => numeric values /*4*/ array(2, 1, 0), //numeric keys => numeric values /*5*/ array(2 => 2, - 1 => 1, - 0 => 0), + 1 => 1, + 0 => 0), //string keys => numeric values /*6*/ array('two' => 2, - '1' => 1, - '0' => 0), + '1' => 1, + '0' => 0), //default keys => float values /*7*/ array(2.00000000000001, 1.00, 0.01E-9), //numeric keys => float values /*8*/ array(2 => 2.00000000000001, - 1 => 1.00, - 0 => 0.01E-9), + 1 => 1.00, + 0 => 0.01E-9), //string keys => float values /*9*/ array ('two' => 2.00000000000001, - '1' => 1.00, - '0' =>0.01E-9) + '1' => 1.00, + '0' =>0.01E-9) ); // loop through each element of $inputs to check the behavior of array_diff_assoc diff --git a/ext/standard/tests/array/array_diff_key_variation1.phpt b/ext/standard/tests/array/array_diff_key_variation1.phpt index 7cc280c966..bdfac2c196 100644 --- a/ext/standard/tests/array/array_diff_key_variation1.phpt +++ b/ext/standard/tests/array/array_diff_key_variation1.phpt @@ -23,9 +23,9 @@ $fp = fopen(__FILE__, "r"); // define some classes class classWithToString { - public function __toString() { - return "Class A object"; - } + public function __toString() { + return "Class A object"; + } } class classWithoutToString diff --git a/ext/standard/tests/array/array_diff_key_variation2.phpt b/ext/standard/tests/array/array_diff_key_variation2.phpt index e38c10a3c9..4f84db5dd1 100644 --- a/ext/standard/tests/array/array_diff_key_variation2.phpt +++ b/ext/standard/tests/array/array_diff_key_variation2.phpt @@ -23,9 +23,9 @@ $fp = fopen(__FILE__, "r"); // define some classes class classWithToString { - public function __toString() { - return "Class A object"; - } + public function __toString() { + return "Class A object"; + } } class classWithoutToString diff --git a/ext/standard/tests/array/array_diff_key_variation8.phpt b/ext/standard/tests/array/array_diff_key_variation8.phpt index f96a1db578..65c09557a3 100644 --- a/ext/standard/tests/array/array_diff_key_variation8.phpt +++ b/ext/standard/tests/array/array_diff_key_variation8.phpt @@ -12,7 +12,7 @@ echo "*** Testing array_diff_key() : usage variation ***\n"; // Initialise function arguments not being substituted (if any) $array1 = array( - 'first' => array('blue' => 1, 'red' => 2), + 'first' => array('blue' => 1, 'red' => 2), 'second' => array('yellow' => 7), @@ -21,7 +21,7 @@ $array1 = array( $array2 = array ( - 'first' => array('blue' => 1, 'red' => 2,), + 'first' => array('blue' => 1, 'red' => 2,), 'second' => array('cyan' => 8), diff --git a/ext/standard/tests/array/array_diff_uassoc_variation1.phpt b/ext/standard/tests/array/array_diff_uassoc_variation1.phpt index b0cf97e0a4..0891cd2ee1 100644 --- a/ext/standard/tests/array/array_diff_uassoc_variation1.phpt +++ b/ext/standard/tests/array/array_diff_uassoc_variation1.phpt @@ -31,9 +31,9 @@ $fp = fopen(__FILE__, "r"); // define some classes class classWithToString { - public function __toString() { - return "Class A object"; - } + public function __toString() { + return "Class A object"; + } } class classWithoutToString diff --git a/ext/standard/tests/array/array_diff_uassoc_variation2.phpt b/ext/standard/tests/array/array_diff_uassoc_variation2.phpt index a05cc8332f..0d5271d6ec 100644 --- a/ext/standard/tests/array/array_diff_uassoc_variation2.phpt +++ b/ext/standard/tests/array/array_diff_uassoc_variation2.phpt @@ -31,9 +31,9 @@ $fp = fopen(__FILE__, "r"); // define some classes class classWithToString { - public function __toString() { - return "Class A object"; - } + public function __toString() { + return "Class A object"; + } } class classWithoutToString diff --git a/ext/standard/tests/array/array_diff_ukey_variation1.phpt b/ext/standard/tests/array/array_diff_ukey_variation1.phpt index 12df148790..a48ad44fd1 100644 --- a/ext/standard/tests/array/array_diff_ukey_variation1.phpt +++ b/ext/standard/tests/array/array_diff_ukey_variation1.phpt @@ -31,9 +31,9 @@ $fp = fopen(__FILE__, "r"); // define some classes class classWithToString { - public function __toString() { - return "Class A object"; - } + public function __toString() { + return "Class A object"; + } } class classWithoutToString diff --git a/ext/standard/tests/array/array_diff_ukey_variation2.phpt b/ext/standard/tests/array/array_diff_ukey_variation2.phpt index ee0251f177..d39453086d 100644 --- a/ext/standard/tests/array/array_diff_ukey_variation2.phpt +++ b/ext/standard/tests/array/array_diff_ukey_variation2.phpt @@ -33,9 +33,9 @@ $fp = fopen(__FILE__, "r"); // define some classes class classWithToString { - public function __toString() { - return "Class A object"; - } + public function __toString() { + return "Class A object"; + } } class classWithoutToString diff --git a/ext/standard/tests/array/array_diff_ukey_variation5.phpt b/ext/standard/tests/array/array_diff_ukey_variation5.phpt index 10946aa0ba..97ccfaab44 100644 --- a/ext/standard/tests/array/array_diff_ukey_variation5.phpt +++ b/ext/standard/tests/array/array_diff_ukey_variation5.phpt @@ -12,7 +12,7 @@ echo "*** Testing array_diff_ukey() : usage variation ***\n"; // Initialise function arguments not being substituted (if any) $array1 = array( - 'first' => array('blue' => 1, 'red' => 2), + 'first' => array('blue' => 1, 'red' => 2), 'second' => array('yellow' => 7), @@ -21,7 +21,7 @@ $array1 = array( $array2 = array ( - 'first' => array('blue' => 1, 'red' => 2,), + 'first' => array('blue' => 1, 'red' => 2,), 'second' => array('cyan' => 8), diff --git a/ext/standard/tests/array/array_diff_variation1.phpt b/ext/standard/tests/array/array_diff_variation1.phpt index 5b92231642..765fae39cd 100644 --- a/ext/standard/tests/array/array_diff_variation1.phpt +++ b/ext/standard/tests/array/array_diff_variation1.phpt @@ -73,7 +73,7 @@ $inputs = array( // binary data /*21*/ b"binary", - (binary)"binary", + (binary)"binary", // object data /*23*/ new classA(), diff --git a/ext/standard/tests/array/array_diff_variation2.phpt b/ext/standard/tests/array/array_diff_variation2.phpt index a9ddb22b82..0bceeea1f0 100644 --- a/ext/standard/tests/array/array_diff_variation2.phpt +++ b/ext/standard/tests/array/array_diff_variation2.phpt @@ -73,7 +73,7 @@ $inputs = array( // binary data /*21*/ b"binary", - (binary)"binary", + (binary)"binary", // object data /*23*/ new classA(), diff --git a/ext/standard/tests/array/array_diff_variation3.phpt b/ext/standard/tests/array/array_diff_variation3.phpt index b7c842f21b..073d6ca5c9 100644 --- a/ext/standard/tests/array/array_diff_variation3.phpt +++ b/ext/standard/tests/array/array_diff_variation3.phpt @@ -80,7 +80,7 @@ $values = array( "binary" => array( // binary data b"binary", - (binary)"binary"), + (binary)"binary"), /*9*/ "undefined" => array( diff --git a/ext/standard/tests/array/array_diff_variation4.phpt b/ext/standard/tests/array/array_diff_variation4.phpt index 3b02c21b36..07bb7293bc 100644 --- a/ext/standard/tests/array/array_diff_variation4.phpt +++ b/ext/standard/tests/array/array_diff_variation4.phpt @@ -80,7 +80,7 @@ $values = array( "binary" => array( // binary data b"binary", - (binary)"binary"), + (binary)"binary"), /*9*/ "undefined" => array( diff --git a/ext/standard/tests/array/array_fill.phpt b/ext/standard/tests/array/array_fill.phpt index 2c90402fe8..4f2aa41b01 100644 --- a/ext/standard/tests/array/array_fill.phpt +++ b/ext/standard/tests/array/array_fill.phpt @@ -11,9 +11,9 @@ foreach($array1 as $start) foreach($array2 as $value) { echo '==========================='."\n"; - echo 'start: '.$start.' num: '.$num.' value: '.$value."\n"; - $output = array_fill($start, $num, $value); - var_dump($output); + echo 'start: '.$start.' num: '.$num.' value: '.$value."\n"; + $output = array_fill($start, $num, $value); + var_dump($output); } } } diff --git a/ext/standard/tests/array/array_fill_keys.phpt b/ext/standard/tests/array/array_fill_keys.phpt index fb222a414b..eebfd0aafd 100644 --- a/ext/standard/tests/array/array_fill_keys.phpt +++ b/ext/standard/tests/array/array_fill_keys.phpt @@ -4,10 +4,10 @@ basic array_fill_keys test precision=14 --FILE-- <?php - var_dump(array_fill_keys(array(), 1)); - var_dump(array_fill_keys(array('foo', 'bar'), NULL)); - var_dump(array_fill_keys(array('5', 'foo', 10, 1.23), 123)); - var_dump(array_fill_keys(array('test', TRUE, 10, 100), '')); + var_dump(array_fill_keys(array(), 1)); + var_dump(array_fill_keys(array('foo', 'bar'), NULL)); + var_dump(array_fill_keys(array('5', 'foo', 10, 1.23), 123)); + var_dump(array_fill_keys(array('test', TRUE, 10, 100), '')); ?> --EXPECT-- array(0) { diff --git a/ext/standard/tests/array/array_filter_variation10.phpt b/ext/standard/tests/array/array_filter_variation10.phpt index a32fdadc05..265daf1fb4 100644 --- a/ext/standard/tests/array/array_filter_variation10.phpt +++ b/ext/standard/tests/array/array_filter_variation10.phpt @@ -35,9 +35,9 @@ var_dump( array_filter($input, 'dump2', true) ); echo "*** Testing array_filter() : usage variations - 'callback' expecting second argument ***\n"; try { - var_dump( array_filter($small, 'dump', false) ); + var_dump( array_filter($small, 'dump', false) ); } catch (Throwable $e) { - echo "Exception: " . $e->getMessage() . "\n"; + echo "Exception: " . $e->getMessage() . "\n"; } echo "*** Testing array_filter() with various use types ***\n"; diff --git a/ext/standard/tests/array/array_intersect_1.phpt b/ext/standard/tests/array/array_intersect_1.phpt index ce8fdd1cac..518dfd392f 100644 --- a/ext/standard/tests/array/array_intersect_1.phpt +++ b/ext/standard/tests/array/array_intersect_1.phpt @@ -4,27 +4,27 @@ Test of the *intersect* bunch of functions (both assoc and non-assoc) <?php error_reporting(E_ALL); class cr { - private $priv_member; - public $public_member; - function __construct($val) { - $this->priv_member = $val; - $this->public_member = $val; - } - static function comp_func_cr($a, $b) { - if ($a->priv_member === $b->priv_member) return 0; - return ($a->priv_member > $b->priv_member)? 1:-1; - } + private $priv_member; + public $public_member; + function __construct($val) { + $this->priv_member = $val; + $this->public_member = $val; + } + static function comp_func_cr($a, $b) { + if ($a->priv_member === $b->priv_member) return 0; + return ($a->priv_member > $b->priv_member)? 1:-1; + } } function comp_func($a, $b) { - if ($a === $b) return 0; - return ($a > $b)? 1:-1; + if ($a === $b) return 0; + return ($a > $b)? 1:-1; } function comp_func_cr($a, $b) { - if ($a->public_member === $b->public_member) return 0; - return ($a->public_member > $b->public_member)? 1:-1; + if ($a->public_member === $b->public_member) return 0; + return ($a->public_member > $b->public_member)? 1:-1; } $a = array("0.1" => new cr(9), "0.5" => new cr(12), 0 => new cr(23), 1=> new cr(4), 2 => new cr(-15),); diff --git a/ext/standard/tests/array/array_intersect_key_variation1.phpt b/ext/standard/tests/array/array_intersect_key_variation1.phpt index 198cb1dfc6..fc1d858516 100644 --- a/ext/standard/tests/array/array_intersect_key_variation1.phpt +++ b/ext/standard/tests/array/array_intersect_key_variation1.phpt @@ -23,9 +23,9 @@ $fp = fopen(__FILE__, "r"); // define some classes class classWithToString { - public function __toString() { - return "Class A object"; - } + public function __toString() { + return "Class A object"; + } } class classWithoutToString diff --git a/ext/standard/tests/array/array_intersect_key_variation2.phpt b/ext/standard/tests/array/array_intersect_key_variation2.phpt index c178480fca..bae7600b9d 100644 --- a/ext/standard/tests/array/array_intersect_key_variation2.phpt +++ b/ext/standard/tests/array/array_intersect_key_variation2.phpt @@ -23,9 +23,9 @@ $fp = fopen(__FILE__, "r"); // define some classes class classWithToString { - public function __toString() { - return "Class A object"; - } + public function __toString() { + return "Class A object"; + } } class classWithoutToString diff --git a/ext/standard/tests/array/array_intersect_key_variation8.phpt b/ext/standard/tests/array/array_intersect_key_variation8.phpt index 892863991a..faa56eeb3d 100644 --- a/ext/standard/tests/array/array_intersect_key_variation8.phpt +++ b/ext/standard/tests/array/array_intersect_key_variation8.phpt @@ -12,7 +12,7 @@ echo "*** Testing array_intersect_key() : usage variation ***\n"; /// Initialise function arguments not being substituted (if any) $array1 = array( - 'first' => array('blue' => 1, 'red' => 2), + 'first' => array('blue' => 1, 'red' => 2), 'second' => array('yellow' => 7), @@ -21,7 +21,7 @@ $array1 = array( $array2 = array ( - 'first' => array('blue' => 1, 'red' => 2,), + 'first' => array('blue' => 1, 'red' => 2,), 'second' => array('cyan' => 8), diff --git a/ext/standard/tests/array/array_intersect_uassoc_variation1.phpt b/ext/standard/tests/array/array_intersect_uassoc_variation1.phpt index a26a5d99ec..c663269b2a 100644 --- a/ext/standard/tests/array/array_intersect_uassoc_variation1.phpt +++ b/ext/standard/tests/array/array_intersect_uassoc_variation1.phpt @@ -31,9 +31,9 @@ $fp = fopen(__FILE__, "r"); // define some classes class classWithToString { - public function __toString() { - return "Class A object"; - } + public function __toString() { + return "Class A object"; + } } class classWithoutToString diff --git a/ext/standard/tests/array/array_intersect_uassoc_variation10.phpt b/ext/standard/tests/array/array_intersect_uassoc_variation10.phpt index d8accf2886..c7ef8174f1 100644 --- a/ext/standard/tests/array/array_intersect_uassoc_variation10.phpt +++ b/ext/standard/tests/array/array_intersect_uassoc_variation10.phpt @@ -15,13 +15,13 @@ $array2 = array("a" => "green", "yellow", "red"); // define some class with method class MyClass { - static function static_compare_func($a, $b) { - return strcasecmp($a, $b); - } + static function static_compare_func($a, $b) { + return strcasecmp($a, $b); + } - public function class_compare_func($a, $b) { - return strcasecmp($a, $b); - } + public function class_compare_func($a, $b) { + return strcasecmp($a, $b); + } } diff --git a/ext/standard/tests/array/array_intersect_uassoc_variation2.phpt b/ext/standard/tests/array/array_intersect_uassoc_variation2.phpt index 61877a0653..20701a5c0b 100644 --- a/ext/standard/tests/array/array_intersect_uassoc_variation2.phpt +++ b/ext/standard/tests/array/array_intersect_uassoc_variation2.phpt @@ -31,9 +31,9 @@ $fp = fopen(__FILE__, "r"); // define some classes class classWithToString { - public function __toString() { - return "Class A object"; - } + public function __toString() { + return "Class A object"; + } } class classWithoutToString diff --git a/ext/standard/tests/array/array_intersect_ukey_variation1.phpt b/ext/standard/tests/array/array_intersect_ukey_variation1.phpt index 417087feca..a02d3c03e3 100644 --- a/ext/standard/tests/array/array_intersect_ukey_variation1.phpt +++ b/ext/standard/tests/array/array_intersect_ukey_variation1.phpt @@ -32,9 +32,9 @@ $fp = fopen(__FILE__, "r"); // define some classes class classWithToString { - public function __toString() { - return "Class A object"; - } + public function __toString() { + return "Class A object"; + } } class classWithoutToString diff --git a/ext/standard/tests/array/array_intersect_ukey_variation2.phpt b/ext/standard/tests/array/array_intersect_ukey_variation2.phpt index f9f479915f..a8f01201d5 100644 --- a/ext/standard/tests/array/array_intersect_ukey_variation2.phpt +++ b/ext/standard/tests/array/array_intersect_ukey_variation2.phpt @@ -32,9 +32,9 @@ $fp = fopen(__FILE__, "r"); // define some classes class classWithToString { - public function __toString() { - return "Class A object"; - } + public function __toString() { + return "Class A object"; + } } class classWithoutToString diff --git a/ext/standard/tests/array/array_intersect_ukey_variation9.phpt b/ext/standard/tests/array/array_intersect_ukey_variation9.phpt index 09ff302a47..205991cd41 100644 --- a/ext/standard/tests/array/array_intersect_ukey_variation9.phpt +++ b/ext/standard/tests/array/array_intersect_ukey_variation9.phpt @@ -15,13 +15,13 @@ $array2 = array('green' => 5, 'blue' => 6, 'yellow' => 7, 'cyan' => 8); class MyClass { - static function static_compare_func($key1, $key2) { - return strcasecmp($key1, $key2); - } + static function static_compare_func($key1, $key2) { + return strcasecmp($key1, $key2); + } - public function class_compare_func($key1, $key2) { - return strcasecmp($key1, $key2); - } + public function class_compare_func($key1, $key2) { + return strcasecmp($key1, $key2); + } } diff --git a/ext/standard/tests/array/array_key_exists_variation3.phpt b/ext/standard/tests/array/array_key_exists_variation3.phpt index 11f0125be2..4a6409bb1f 100644 --- a/ext/standard/tests/array/array_key_exists_variation3.phpt +++ b/ext/standard/tests/array/array_key_exists_variation3.phpt @@ -21,15 +21,15 @@ $search = array ('zero', 'one', 'two'); $iterator = 1; foreach($keys as $key) { - echo "\n-- Iteration $iterator --\n"; - echo "Pass float as \$key:\n"; - try { - var_dump(array_key_exists($key, $search)); - } catch (TypeError $exception) { - echo $exception->getMessage() . "\n"; - } - echo "Cast float to int:\n"; - var_dump(array_key_exists((int)$key, $search)); + echo "\n-- Iteration $iterator --\n"; + echo "Pass float as \$key:\n"; + try { + var_dump(array_key_exists($key, $search)); + } catch (TypeError $exception) { + echo $exception->getMessage() . "\n"; + } + echo "Cast float to int:\n"; + var_dump(array_key_exists((int)$key, $search)); } echo "Done"; diff --git a/ext/standard/tests/array/array_key_exists_variation6.phpt b/ext/standard/tests/array/array_key_exists_variation6.phpt index a801acdd34..fb81d3277a 100644 --- a/ext/standard/tests/array/array_key_exists_variation6.phpt +++ b/ext/standard/tests/array/array_key_exists_variation6.phpt @@ -27,17 +27,17 @@ $array = array ('null' => null, //iterate through original array foreach($array as $name => $input) { - $iterator = 1; - echo "\n-- Key in \$search array is : $name --\n"; - $search[$input] = 'test'; + $iterator = 1; + echo "\n-- Key in \$search array is : $name --\n"; + $search[$input] = 'test'; - //iterate through array again to see which values are considered equal - foreach($array as $key) { - echo "Iteration $iterator: "; - var_dump(array_key_exists($key, $search)); - $iterator++; - } - $search = null; + //iterate through array again to see which values are considered equal + foreach($array as $key) { + echo "Iteration $iterator: "; + var_dump(array_key_exists($key, $search)); + $iterator++; + } + $search = null; } echo "Done"; diff --git a/ext/standard/tests/array/array_key_exists_variation8.phpt b/ext/standard/tests/array/array_key_exists_variation8.phpt index 1d98b0eefb..a52a9acdaa 100644 --- a/ext/standard/tests/array/array_key_exists_variation8.phpt +++ b/ext/standard/tests/array/array_key_exists_variation8.phpt @@ -95,16 +95,16 @@ $inputs = array( // loop through each element of $inputs to check the behavior of array_key_exists() $iterator = 1; foreach($inputs as $type => $input) { - echo "\n-- Iteration $iterator: $type data --\n"; + echo "\n-- Iteration $iterator: $type data --\n"; - //iterate over again to get all different key values - foreach ($inputs as $new_type => $new_input) { - echo "-- \$key arguments are $new_type data:\n"; - foreach ($new_input as $key => $search) { - var_dump(array_key_exists($key, $input)); - } - } - $iterator++; + //iterate over again to get all different key values + foreach ($inputs as $new_type => $new_input) { + echo "-- \$key arguments are $new_type data:\n"; + foreach ($new_input as $key => $search) { + var_dump(array_key_exists($key, $input)); + } + } + $iterator++; }; echo "Done"; diff --git a/ext/standard/tests/array/array_keys_variation_003.phpt b/ext/standard/tests/array/array_keys_variation_003.phpt index adb2baea66..3163820de0 100644 --- a/ext/standard/tests/array/array_keys_variation_003.phpt +++ b/ext/standard/tests/array/array_keys_variation_003.phpt @@ -20,8 +20,8 @@ $types_arr = array( ); $values = array(TRUE, FALSE, 1, 0, -1, "1", "0", "-1", NULL, array(), "php", ""); foreach ($values as $value){ - var_dump($value); - var_dump(array_keys($types_arr, $value)); + var_dump($value); + var_dump(array_keys($types_arr, $value)); } echo "Done\n"; diff --git a/ext/standard/tests/array/array_map_001.phpt b/ext/standard/tests/array/array_map_001.phpt index c5d78c257e..ffa56c1309 100644 --- a/ext/standard/tests/array/array_map_001.phpt +++ b/ext/standard/tests/array/array_map_001.phpt @@ -6,13 +6,13 @@ array_map() and exceptions in the callback $a = array(1,2,3); function foo() { - throw new exception(1); + throw new exception(1); } try { - array_map("foo", $a, array(2,3)); + array_map("foo", $a, array(2,3)); } catch (Exception $e) { - var_dump("exception caught!"); + var_dump("exception caught!"); } echo "Done\n"; diff --git a/ext/standard/tests/array/array_map_error.phpt b/ext/standard/tests/array/array_map_error.phpt index d15f28425e..4739bbf663 100644 --- a/ext/standard/tests/array/array_map_error.phpt +++ b/ext/standard/tests/array/array_map_error.phpt @@ -15,9 +15,9 @@ function callback1() { return 1; } try { - var_dump( array_map('callback1') ); + var_dump( array_map('callback1') ); } catch (Throwable $e) { - echo "Exception: " . $e->getMessage() . "\n"; + echo "Exception: " . $e->getMessage() . "\n"; } echo "\n-- Testing array_map() function with less no. of arrays than callback function arguments --\n"; @@ -26,9 +26,9 @@ function callback2($p, $q) { return $p * $q; } try { - var_dump( array_map('callback2', $arr1) ); + var_dump( array_map('callback2', $arr1) ); } catch (Throwable $e) { - echo "Exception: " . $e->getMessage() . "\n"; + echo "Exception: " . $e->getMessage() . "\n"; } echo "\n-- Testing array_map() function with more no. of arrays than callback function arguments --\n"; diff --git a/ext/standard/tests/array/array_map_variation10.phpt b/ext/standard/tests/array/array_map_variation10.phpt index 184019cdf1..d5324f3e28 100644 --- a/ext/standard/tests/array/array_map_variation10.phpt +++ b/ext/standard/tests/array/array_map_variation10.phpt @@ -21,9 +21,9 @@ var_dump( array_map( function($a, $b) { return array($a, $b); }, $array1, $array echo "-- anonymous function with two parameters and passing one array --\n"; try { - var_dump( array_map( function($a, $b) { return array($a, $b); }, $array1)); + var_dump( array_map( function($a, $b) { return array($a, $b); }, $array1)); } catch (Throwable $e) { - echo "Exception: " . $e->getMessage() . "\n"; + echo "Exception: " . $e->getMessage() . "\n"; } echo "-- anonymous function with NULL parameter --\n"; diff --git a/ext/standard/tests/array/array_map_variation9.phpt b/ext/standard/tests/array/array_map_variation9.phpt index 9c70340b30..7089f9abc6 100644 --- a/ext/standard/tests/array/array_map_variation9.phpt +++ b/ext/standard/tests/array/array_map_variation9.phpt @@ -30,9 +30,9 @@ var_dump( array_map('callback1', $arr1) ); echo "-- checking binary safe array with two parameter callback function --\n"; try { - var_dump( array_map(b"callback2", $arr1) ); + var_dump( array_map(b"callback2", $arr1) ); } catch (Throwable $e) { - echo "Exception: " . $e->getMessage() . "\n"; + echo "Exception: " . $e->getMessage() . "\n"; } echo "Done"; diff --git a/ext/standard/tests/array/array_merge_variation3.phpt b/ext/standard/tests/array/array_merge_variation3.phpt index b8444ffb09..1b15153c7f 100644 --- a/ext/standard/tests/array/array_merge_variation3.phpt +++ b/ext/standard/tests/array/array_merge_variation3.phpt @@ -42,7 +42,7 @@ $inputs = array( // int data /*1*/ 'int' => array( - 0, + 0, 1, 12345, -2345, diff --git a/ext/standard/tests/array/array_multisort_case.phpt b/ext/standard/tests/array/array_multisort_case.phpt index e56d297e49..39d9280c28 100644 --- a/ext/standard/tests/array/array_multisort_case.phpt +++ b/ext/standard/tests/array/array_multisort_case.phpt @@ -11,23 +11,23 @@ Test array_multisort() function : case-sensitive echo "*** Testing array_multisort() : case-sensitive\n"; $a = array( - 'Second', - 'First.1', - 'First.2', - 'First.3', - 'Twentieth', - 'Tenth', - 'Third', + 'Second', + 'First.1', + 'First.2', + 'First.3', + 'Twentieth', + 'Tenth', + 'Third', ); $b = array( - '2 a', - '1 bb 1', - '1 bB 2', - '1 BB 3', - '20 c', - '10 d', - '3 e', + '2 a', + '1 bb 1', + '1 bB 2', + '1 BB 3', + '20 c', + '10 d', + '3 e', ); array_multisort($b, SORT_STRING, $a); diff --git a/ext/standard/tests/array/array_multisort_incase.phpt b/ext/standard/tests/array/array_multisort_incase.phpt index 4799d8bcb5..98be7d06bc 100644 --- a/ext/standard/tests/array/array_multisort_incase.phpt +++ b/ext/standard/tests/array/array_multisort_incase.phpt @@ -11,23 +11,23 @@ Test array_multisort() function : case-insensitive echo "*** Testing array_multisort() : case-insensitive\n"; $a = array( - 'Second', - 'First.1', - 'First.2', - 'First.3', - 'Twentieth', - 'Tenth', - 'Third', + 'Second', + 'First.1', + 'First.2', + 'First.3', + 'Twentieth', + 'Tenth', + 'Third', ); $b = array( - '2 a', - '1 bb 1', - '1 bB 2', - '1 BB 3', - '20 c', - '10 d', - '3 e', + '2 a', + '1 bb 1', + '1 bB 2', + '1 BB 3', + '20 c', + '10 d', + '3 e', ); array_multisort($b, SORT_STRING | SORT_FLAG_CASE, $a); diff --git a/ext/standard/tests/array/array_multisort_natural.phpt b/ext/standard/tests/array/array_multisort_natural.phpt index 27b22a799d..f56c1b00a2 100644 --- a/ext/standard/tests/array/array_multisort_natural.phpt +++ b/ext/standard/tests/array/array_multisort_natural.phpt @@ -11,19 +11,19 @@ Test array_multisort() function : natural sorting echo "*** Testing array_multisort() : natural sorting\n"; $a = array( - 'Second', - 'First', - 'Twentieth', - 'Tenth', - 'Third', + 'Second', + 'First', + 'Twentieth', + 'Tenth', + 'Third', ); $b = array( - '2 a', - '1 b', - '20 c', - '10 d', - '3 e', + '2 a', + '1 b', + '20 c', + '10 d', + '3 e', ); array_multisort($b, SORT_NATURAL, $a); diff --git a/ext/standard/tests/array/array_multisort_natural_case.phpt b/ext/standard/tests/array/array_multisort_natural_case.phpt index 75db1565df..fc42219972 100644 --- a/ext/standard/tests/array/array_multisort_natural_case.phpt +++ b/ext/standard/tests/array/array_multisort_natural_case.phpt @@ -11,23 +11,23 @@ Test array_multisort() function : natural sorting case-sensitive echo "*** Testing array_multisort() : natural sorting case-sensitive\n"; $a = array( - 'Second', - 'First.1', - 'First.2', - 'First.3', - 'Twentieth', - 'Tenth', - 'Third', + 'Second', + 'First.1', + 'First.2', + 'First.3', + 'Twentieth', + 'Tenth', + 'Third', ); $b = array( - '2 a', - '1 bb 1', - '1 bB 2', - '1 BB 3', - '20 c', - '10 d', - '3 e', + '2 a', + '1 bb 1', + '1 bB 2', + '1 BB 3', + '20 c', + '10 d', + '3 e', ); array_multisort($b, SORT_NATURAL, $a); diff --git a/ext/standard/tests/array/array_multisort_natural_incase.phpt b/ext/standard/tests/array/array_multisort_natural_incase.phpt index b603dd57a4..0b12bf776d 100644 --- a/ext/standard/tests/array/array_multisort_natural_incase.phpt +++ b/ext/standard/tests/array/array_multisort_natural_incase.phpt @@ -11,23 +11,23 @@ Test array_multisort() function : natural sorting case-insensitive echo "*** Testing array_multisort() : natural sorting case-insensitive\n"; $a = array( - 'Second', - 'First.1', - 'First.2', - 'First.3', - 'Twentieth', - 'Tenth', - 'Third', + 'Second', + 'First.1', + 'First.2', + 'First.3', + 'Twentieth', + 'Tenth', + 'Third', ); $b = array( - '2 a', - '1 bb 1', - '1 bB 2', - '1 BB 3', - '20 c', - '10 d', - '3 e', + '2 a', + '1 bb 1', + '1 bB 2', + '1 BB 3', + '20 c', + '10 d', + '3 e', ); array_multisort($b, SORT_NATURAL | SORT_FLAG_CASE, $a); diff --git a/ext/standard/tests/array/array_multisort_variation1.phpt b/ext/standard/tests/array/array_multisort_variation1.phpt index a912680421..4cedadf071 100644 --- a/ext/standard/tests/array/array_multisort_variation1.phpt +++ b/ext/standard/tests/array/array_multisort_variation1.phpt @@ -12,10 +12,10 @@ echo "*** Testing array_multisort() : usage variation ***\n"; // Define error handler function test_error_handler($err_no, $err_msg, $filename, $linenum) { - if (error_reporting() & $err_no) { - // report non-silenced errors - echo "Error: $err_no - $err_msg, $filename($linenum)\n"; - } + if (error_reporting() & $err_no) { + // report non-silenced errors + echo "Error: $err_no - $err_msg, $filename($linenum)\n"; + } } set_error_handler('test_error_handler'); @@ -28,9 +28,9 @@ unset ($unset_var); // define some classes class classWithToString { - public function __toString() { - return "Class A object"; - } + public function __toString() { + return "Class A object"; + } } class classWithoutToString diff --git a/ext/standard/tests/array/array_multisort_variation2.phpt b/ext/standard/tests/array/array_multisort_variation2.phpt index f28988ecfa..4900b838ae 100644 --- a/ext/standard/tests/array/array_multisort_variation2.phpt +++ b/ext/standard/tests/array/array_multisort_variation2.phpt @@ -12,10 +12,10 @@ echo "*** Testing array_multisort() : usage variation ***\n"; // Define error handler function test_error_handler($err_no, $err_msg, $filename, $linenum) { - if (error_reporting() & $err_no) { - // report non-silenced errors - echo "Error: $err_no - $err_msg, $filename($linenum)\n"; - } + if (error_reporting() & $err_no) { + // report non-silenced errors + echo "Error: $err_no - $err_msg, $filename($linenum)\n"; + } } set_error_handler('test_error_handler'); @@ -30,9 +30,9 @@ unset ($unset_var); // define some classes class classWithToString { - public function __toString() { - return "Class A object"; - } + public function __toString() { + return "Class A object"; + } } class classWithoutToString diff --git a/ext/standard/tests/array/array_multisort_variation3.phpt b/ext/standard/tests/array/array_multisort_variation3.phpt index 07669d7fd2..02883e87d1 100644 --- a/ext/standard/tests/array/array_multisort_variation3.phpt +++ b/ext/standard/tests/array/array_multisort_variation3.phpt @@ -12,10 +12,10 @@ echo "*** Testing array_multisort() : usage variation ***\n"; // Define error handler function test_error_handler($err_no, $err_msg, $filename, $linenum) { - if (error_reporting() & $err_no) { - // report non-silenced errors - echo "Error: $err_no - $err_msg, $filename($linenum)\n"; - } + if (error_reporting() & $err_no) { + // report non-silenced errors + echo "Error: $err_no - $err_msg, $filename($linenum)\n"; + } } set_error_handler('test_error_handler'); @@ -29,9 +29,9 @@ unset ($unset_var); // define some classes class classWithToString { - public function __toString() { - return "Class A object"; - } + public function __toString() { + return "Class A object"; + } } class classWithoutToString diff --git a/ext/standard/tests/array/array_multisort_variation7.phpt b/ext/standard/tests/array/array_multisort_variation7.phpt index f073cd5df2..7ad9bd72a7 100644 --- a/ext/standard/tests/array/array_multisort_variation7.phpt +++ b/ext/standard/tests/array/array_multisort_variation7.phpt @@ -12,9 +12,9 @@ echo "*** Testing array_multisort() : usage variation - test sort order of all // define some classes class classWithToString { - public function __toString() { - return "Class A object"; - } + public function __toString() { + return "Class A object"; + } } class classWithoutToString { } diff --git a/ext/standard/tests/array/array_multisort_variation8.phpt b/ext/standard/tests/array/array_multisort_variation8.phpt index f0ef3e0dd5..5658e12420 100644 --- a/ext/standard/tests/array/array_multisort_variation8.phpt +++ b/ext/standard/tests/array/array_multisort_variation8.phpt @@ -12,15 +12,15 @@ echo "*** Testing array_multisort() : usage variation - test sort order of all // Define error handler function test_error_handler($err_no, $err_msg, $filename, $linenum) { - // We're testing sort order not errors so ignore. + // We're testing sort order not errors so ignore. } set_error_handler('test_error_handler'); // define some classes class classWithToString { - public function __toString() { - return "Class A object"; - } + public function __toString() { + return "Class A object"; + } } class classWithoutToString { } diff --git a/ext/standard/tests/array/array_multisort_variation9.phpt b/ext/standard/tests/array/array_multisort_variation9.phpt index a5d689cc87..63f42f407d 100644 --- a/ext/standard/tests/array/array_multisort_variation9.phpt +++ b/ext/standard/tests/array/array_multisort_variation9.phpt @@ -12,9 +12,9 @@ echo "*** Testing array_multisort() : usage variation - test sort order of all // define some classes class classWithToString { - public function __toString() { - return "Class A object"; - } + public function __toString() { + return "Class A object"; + } } class classWithoutToString { } diff --git a/ext/standard/tests/array/array_reduce_variation1.phpt b/ext/standard/tests/array/array_reduce_variation1.phpt index 34c2856bac..6b1d21e046 100644 --- a/ext/standard/tests/array/array_reduce_variation1.phpt +++ b/ext/standard/tests/array/array_reduce_variation1.phpt @@ -26,9 +26,9 @@ var_dump(array_reduce($array, "oneArg", 2)); echo "\n--- Testing with a callback with too many parameters ---\n"; try { - var_dump(array_reduce($array, "threeArgs", 2)); + var_dump(array_reduce($array, "threeArgs", 2)); } catch (Throwable $e) { - echo "Exception: " . $e->getMessage() . "\n"; + echo "Exception: " . $e->getMessage() . "\n"; } ?> diff --git a/ext/standard/tests/array/array_replace.phpt b/ext/standard/tests/array/array_replace.phpt index 48b616ab04..c3edba008c 100644 --- a/ext/standard/tests/array/array_replace.phpt +++ b/ext/standard/tests/array/array_replace.phpt @@ -4,26 +4,26 @@ Test array_replace and array_replace_recursive <?php $array1 = array( - 0 => 'dontclobber', - '1' => 'unclobbered', - 'test2' => 0.0, - 'test3' => array( - 'testarray2' => true, - 1 => array( - 'testsubarray1' => 'dontclobber2', - 'testsubarray2' => 'dontclobber3', - ), + 0 => 'dontclobber', + '1' => 'unclobbered', + 'test2' => 0.0, + 'test3' => array( + 'testarray2' => true, + 1 => array( + 'testsubarray1' => 'dontclobber2', + 'testsubarray2' => 'dontclobber3', + ), ), ); $array2 = array( - 1 => 'clobbered', - 'test3' => array( - 'testarray2' => false, - ), - 'test4' => array( - 'clobbered3' => array(0, 1, 2), - ), + 1 => 'clobbered', + 'test3' => array( + 'testarray2' => false, + ), + 'test4' => array( + 'clobbered3' => array(0, 1, 2), + ), ); $array3 = array(array(array(array()))); diff --git a/ext/standard/tests/array/array_shift_variation2.phpt b/ext/standard/tests/array/array_shift_variation2.phpt index 9e37cbb204..fae2e06e0f 100644 --- a/ext/standard/tests/array/array_shift_variation2.phpt +++ b/ext/standard/tests/array/array_shift_variation2.phpt @@ -39,7 +39,7 @@ $inputs = array( // int data /*1*/ 'int' => array( - 0, + 0, 1, 12345, -2345, diff --git a/ext/standard/tests/array/array_slice_variation5.phpt b/ext/standard/tests/array/array_slice_variation5.phpt index 5f127fd2eb..06f79c7168 100644 --- a/ext/standard/tests/array/array_slice_variation5.phpt +++ b/ext/standard/tests/array/array_slice_variation5.phpt @@ -16,8 +16,8 @@ echo "*** Testing array_slice() : usage variations ***\n"; $input = array ('one' => 1, 2 => 'two', 'three', 9 => 'nine', 'ten' => 10); for ($i = -7; $i <= 7; $i++) { - echo "\n-- \$offset is $i --\n"; - var_dump(array_slice($input, $i)); + echo "\n-- \$offset is $i --\n"; + var_dump(array_slice($input, $i)); } echo "\n-- \$offset is maximum integer value --\n"; var_dump(array_slice($input, PHP_INT_MAX)); diff --git a/ext/standard/tests/array/array_slice_variation6.phpt b/ext/standard/tests/array/array_slice_variation6.phpt index 86bde4ae3c..b54cd1a16b 100644 --- a/ext/standard/tests/array/array_slice_variation6.phpt +++ b/ext/standard/tests/array/array_slice_variation6.phpt @@ -17,8 +17,8 @@ $input = array ('one' => 1, 2 => 'two', 'three', 9 => 'nine', 'ten' => 10); $offset = 1; for ($i = -6; $i <= 6; $i++) { - echo "\n-- \$length is $i --\n"; - var_dump(array_slice($input, $offset, $i)); + echo "\n-- \$length is $i --\n"; + var_dump(array_slice($input, $offset, $i)); } echo "\n-- \$length is maximum integer value --\n"; var_dump(array_slice($input, $offset, PHP_INT_MAX)); diff --git a/ext/standard/tests/array/array_splice_variation3.phpt b/ext/standard/tests/array/array_splice_variation3.phpt index b5a55ca144..d5f76ac805 100644 --- a/ext/standard/tests/array/array_splice_variation3.phpt +++ b/ext/standard/tests/array/array_splice_variation3.phpt @@ -12,14 +12,14 @@ echo "*** array_splice() function : usage variations - lengths and offsets\n"; function test_splice ($offset, $length) { - echo " - No replacement\n"; - $input_array=array(0,1,2,3,4,5); - var_dump (array_splice ($input_array,$offset,$length)); - var_dump ($input_array); + echo " - No replacement\n"; + $input_array=array(0,1,2,3,4,5); + var_dump (array_splice ($input_array,$offset,$length)); + var_dump ($input_array); echo " - With replacement\n"; $input_array=array(0,1,2,3,4,5); var_dump (array_splice ($input_array,$offset,$length,array ("A","B","C"))); - var_dump ($input_array); + var_dump ($input_array); } echo "absolute offset - absolute length - cut from beginning\n"; diff --git a/ext/standard/tests/array/array_splice_variation4.phpt b/ext/standard/tests/array/array_splice_variation4.phpt index ddd966780e..06eecdf005 100644 --- a/ext/standard/tests/array/array_splice_variation4.phpt +++ b/ext/standard/tests/array/array_splice_variation4.phpt @@ -9,9 +9,9 @@ Test array_splice() function : usage variations - non array replacement values function test_splice ($replacement) { - $input_array=array(0,1); - var_dump (array_splice ($input_array,2,0,$replacement)); - var_dump ($input_array); + $input_array=array(0,1); + var_dump (array_splice ($input_array,2,0,$replacement)); + var_dump ($input_array); } test_splice (2); diff --git a/ext/standard/tests/array/array_sum.phpt b/ext/standard/tests/array/array_sum.phpt index 08aec2155e..9ba80beba6 100644 --- a/ext/standard/tests/array/array_sum.phpt +++ b/ext/standard/tests/array/array_sum.phpt @@ -7,8 +7,8 @@ memory_limit=128M <?php $i = 0; while ($i++ < 1000) { - $a[] = $i; - $b[] = (string)$i; + $a[] = $i; + $b[] = (string)$i; } $s1 = array_sum($a); $s2 = array_sum($b); @@ -16,8 +16,8 @@ var_dump($s1, $s2); $j = 0; while ($j++ < 100000) { - $c[] = $j; - $d[] = (string) $j; + $c[] = $j; + $d[] = (string) $j; } $s3 = array_sum($c); $s4 = array_sum($d); diff --git a/ext/standard/tests/array/array_udiff_assoc_variation1.phpt b/ext/standard/tests/array/array_udiff_assoc_variation1.phpt index cc9e035f70..76dd2972c5 100644 --- a/ext/standard/tests/array/array_udiff_assoc_variation1.phpt +++ b/ext/standard/tests/array/array_udiff_assoc_variation1.phpt @@ -23,9 +23,9 @@ unset ($unset_var); // define some classes class classWithToString { - public function __toString() { - return "Class A object"; - } + public function __toString() { + return "Class A object"; + } } class classWithoutToString diff --git a/ext/standard/tests/array/array_udiff_assoc_variation2.phpt b/ext/standard/tests/array/array_udiff_assoc_variation2.phpt index 4ded746508..9b84e8d489 100644 --- a/ext/standard/tests/array/array_udiff_assoc_variation2.phpt +++ b/ext/standard/tests/array/array_udiff_assoc_variation2.phpt @@ -23,9 +23,9 @@ unset ($unset_var); // define some classes class classWithToString { - public function __toString() { - return "Class A object"; - } + public function __toString() { + return "Class A object"; + } } class classWithoutToString diff --git a/ext/standard/tests/array/array_udiff_assoc_variation5.phpt b/ext/standard/tests/array/array_udiff_assoc_variation5.phpt index a48bda09b0..bfed60d30d 100644 --- a/ext/standard/tests/array/array_udiff_assoc_variation5.phpt +++ b/ext/standard/tests/array/array_udiff_assoc_variation5.phpt @@ -25,9 +25,9 @@ function too_many_parameters ($val1, $val2, $val3) { return 1; } try { - var_dump(array_udiff_assoc($arr1, $arr2, 'too_many_parameters')); + var_dump(array_udiff_assoc($arr1, $arr2, 'too_many_parameters')); } catch (Throwable $e) { - echo "Exception: " . $e->getMessage() . "\n"; + echo "Exception: " . $e->getMessage() . "\n"; } echo "\n-- comparison function taking too few parameters --\n"; diff --git a/ext/standard/tests/array/array_udiff_uassoc_variation1.phpt b/ext/standard/tests/array/array_udiff_uassoc_variation1.phpt index dcfe07083f..e59012cbb6 100644 --- a/ext/standard/tests/array/array_udiff_uassoc_variation1.phpt +++ b/ext/standard/tests/array/array_udiff_uassoc_variation1.phpt @@ -24,9 +24,9 @@ unset ($unset_var); // define some classes class classWithToString { - public function __toString() { - return "Class A object"; - } + public function __toString() { + return "Class A object"; + } } class classWithoutToString diff --git a/ext/standard/tests/array/array_udiff_uassoc_variation2.phpt b/ext/standard/tests/array/array_udiff_uassoc_variation2.phpt index e15076db5f..ee7cf405dc 100644 --- a/ext/standard/tests/array/array_udiff_uassoc_variation2.phpt +++ b/ext/standard/tests/array/array_udiff_uassoc_variation2.phpt @@ -24,9 +24,9 @@ unset ($unset_var); // define some classes class classWithToString { - public function __toString() { - return "Class A object"; - } + public function __toString() { + return "Class A object"; + } } class classWithoutToString diff --git a/ext/standard/tests/array/array_udiff_uassoc_variation6.phpt b/ext/standard/tests/array/array_udiff_uassoc_variation6.phpt index e6f256d79a..2c917014ca 100644 --- a/ext/standard/tests/array/array_udiff_uassoc_variation6.phpt +++ b/ext/standard/tests/array/array_udiff_uassoc_variation6.phpt @@ -24,9 +24,9 @@ function too_many_parameters ($val1, $val2, $val3) { return 1; } try { - var_dump(array_udiff_uassoc($arr1, $arr2, 'too_many_parameters', 'too_many_parameters')); + var_dump(array_udiff_uassoc($arr1, $arr2, 'too_many_parameters', 'too_many_parameters')); } catch (Throwable $e) { - echo "Exception: " . $e->getMessage() . "\n"; + echo "Exception: " . $e->getMessage() . "\n"; } echo "\n-- comparison function taking too few parameters --\n"; diff --git a/ext/standard/tests/array/array_udiff_variation1.phpt b/ext/standard/tests/array/array_udiff_variation1.phpt index a90e3b0e67..9e98bda727 100644 --- a/ext/standard/tests/array/array_udiff_variation1.phpt +++ b/ext/standard/tests/array/array_udiff_variation1.phpt @@ -23,9 +23,9 @@ unset ($unset_var); // define some classes class classWithToString { - public function __toString() { - return "Class A object"; - } + public function __toString() { + return "Class A object"; + } } class classWithoutToString diff --git a/ext/standard/tests/array/array_udiff_variation2.phpt b/ext/standard/tests/array/array_udiff_variation2.phpt index 5c37a3a20a..28f1e8e1b1 100644 --- a/ext/standard/tests/array/array_udiff_variation2.phpt +++ b/ext/standard/tests/array/array_udiff_variation2.phpt @@ -23,9 +23,9 @@ unset ($unset_var); // define some classes class classWithToString { - public function __toString() { - return "Class A object"; - } + public function __toString() { + return "Class A object"; + } } class classWithoutToString diff --git a/ext/standard/tests/array/array_udiff_variation5.phpt b/ext/standard/tests/array/array_udiff_variation5.phpt index 1ca7977999..24d1207ed4 100644 --- a/ext/standard/tests/array/array_udiff_variation5.phpt +++ b/ext/standard/tests/array/array_udiff_variation5.phpt @@ -25,9 +25,9 @@ function too_many_parameters ($val1, $val2, $val3) { return 0; } try { - var_dump(array_udiff($arr1, $arr2, 'too_many_parameters')); + var_dump(array_udiff($arr1, $arr2, 'too_many_parameters')); } catch (Throwable $e) { - echo "Exception: " . $e->getMessage() . "\n"; + echo "Exception: " . $e->getMessage() . "\n"; } echo "\n-- comparison function taking too few parameters --\n"; diff --git a/ext/standard/tests/array/array_uintersect_assoc_variation1.phpt b/ext/standard/tests/array/array_uintersect_assoc_variation1.phpt index c99a9947c5..8111006e3c 100644 --- a/ext/standard/tests/array/array_uintersect_assoc_variation1.phpt +++ b/ext/standard/tests/array/array_uintersect_assoc_variation1.phpt @@ -23,9 +23,9 @@ unset ($unset_var); // define some classes class classWithToString { - public function __toString() { - return "Class A object"; - } + public function __toString() { + return "Class A object"; + } } class classWithoutToString diff --git a/ext/standard/tests/array/array_uintersect_assoc_variation2.phpt b/ext/standard/tests/array/array_uintersect_assoc_variation2.phpt index 00a50f3c2f..5ce935321f 100644 --- a/ext/standard/tests/array/array_uintersect_assoc_variation2.phpt +++ b/ext/standard/tests/array/array_uintersect_assoc_variation2.phpt @@ -23,9 +23,9 @@ unset ($unset_var); // define some classes class classWithToString { - public function __toString() { - return "Class A object"; - } + public function __toString() { + return "Class A object"; + } } class classWithoutToString diff --git a/ext/standard/tests/array/array_uintersect_assoc_variation5.phpt b/ext/standard/tests/array/array_uintersect_assoc_variation5.phpt index 3b6befcc5e..990a711219 100644 --- a/ext/standard/tests/array/array_uintersect_assoc_variation5.phpt +++ b/ext/standard/tests/array/array_uintersect_assoc_variation5.phpt @@ -24,9 +24,9 @@ function too_many_parameters ($val1, $val2, $val3) { return 1; } try { - var_dump(array_uintersect_assoc($arr1, $arr2, 'too_many_parameters')); + var_dump(array_uintersect_assoc($arr1, $arr2, 'too_many_parameters')); } catch (Throwable $e) { - echo "Exception: " . $e->getMessage() . "\n"; + echo "Exception: " . $e->getMessage() . "\n"; } echo "\n-- comparison function taking too few parameters --\n"; diff --git a/ext/standard/tests/array/array_uintersect_uassoc_variation1.phpt b/ext/standard/tests/array/array_uintersect_uassoc_variation1.phpt index 4889025872..908b39c859 100644 --- a/ext/standard/tests/array/array_uintersect_uassoc_variation1.phpt +++ b/ext/standard/tests/array/array_uintersect_uassoc_variation1.phpt @@ -24,9 +24,9 @@ unset ($unset_var); // define some classes class classWithToString { - public function __toString() { - return "Class A object"; - } + public function __toString() { + return "Class A object"; + } } class classWithoutToString diff --git a/ext/standard/tests/array/array_uintersect_uassoc_variation2.phpt b/ext/standard/tests/array/array_uintersect_uassoc_variation2.phpt index a1d897d86e..c9b3e051c3 100644 --- a/ext/standard/tests/array/array_uintersect_uassoc_variation2.phpt +++ b/ext/standard/tests/array/array_uintersect_uassoc_variation2.phpt @@ -24,9 +24,9 @@ unset ($unset_var); // define some classes class classWithToString { - public function __toString() { - return "Class A object"; - } + public function __toString() { + return "Class A object"; + } } class classWithoutToString diff --git a/ext/standard/tests/array/array_uintersect_uassoc_variation6.phpt b/ext/standard/tests/array/array_uintersect_uassoc_variation6.phpt index 5553adffb5..76d387d9c8 100644 --- a/ext/standard/tests/array/array_uintersect_uassoc_variation6.phpt +++ b/ext/standard/tests/array/array_uintersect_uassoc_variation6.phpt @@ -24,9 +24,9 @@ function too_many_parameters ($val1, $val2, $val3) { return 1; } try { - var_dump(array_uintersect_uassoc($arr1, $arr2, 'too_many_parameters', 'too_many_parameters')); + var_dump(array_uintersect_uassoc($arr1, $arr2, 'too_many_parameters', 'too_many_parameters')); } catch (Throwable $e) { - echo "Exception: " . $e->getMessage() . "\n"; + echo "Exception: " . $e->getMessage() . "\n"; } echo "\n-- comparison function taking too few parameters --\n"; diff --git a/ext/standard/tests/array/array_uintersect_variation1.phpt b/ext/standard/tests/array/array_uintersect_variation1.phpt index 47534f70bc..336ce0a169 100644 --- a/ext/standard/tests/array/array_uintersect_variation1.phpt +++ b/ext/standard/tests/array/array_uintersect_variation1.phpt @@ -23,9 +23,9 @@ unset ($unset_var); // define some classes class classWithToString { - public function __toString() { - return "Class A object"; - } + public function __toString() { + return "Class A object"; + } } class classWithoutToString diff --git a/ext/standard/tests/array/array_uintersect_variation2.phpt b/ext/standard/tests/array/array_uintersect_variation2.phpt index d79cf66c21..851927e98b 100644 --- a/ext/standard/tests/array/array_uintersect_variation2.phpt +++ b/ext/standard/tests/array/array_uintersect_variation2.phpt @@ -23,9 +23,9 @@ unset ($unset_var); // define some classes class classWithToString { - public function __toString() { - return "Class A object"; - } + public function __toString() { + return "Class A object"; + } } class classWithoutToString diff --git a/ext/standard/tests/array/array_uintersect_variation5.phpt b/ext/standard/tests/array/array_uintersect_variation5.phpt index 1996d386f1..bcfdac094b 100644 --- a/ext/standard/tests/array/array_uintersect_variation5.phpt +++ b/ext/standard/tests/array/array_uintersect_variation5.phpt @@ -24,9 +24,9 @@ function too_many_parameters ($val1, $val2, $val3) { return 1; } try { - var_dump(array_uintersect($arr1, $arr2, 'too_many_parameters')); + var_dump(array_uintersect($arr1, $arr2, 'too_many_parameters')); } catch (Throwable $e) { - echo "Exception: " . $e->getMessage() . "\n"; + echo "Exception: " . $e->getMessage() . "\n"; } echo "\n-- comparison function taking too few parameters --\n"; diff --git a/ext/standard/tests/array/array_values_variation2.phpt b/ext/standard/tests/array/array_values_variation2.phpt index 5105168c1e..a334140001 100644 --- a/ext/standard/tests/array/array_values_variation2.phpt +++ b/ext/standard/tests/array/array_values_variation2.phpt @@ -38,7 +38,7 @@ $inputs = array( // int data /*1*/ 'int' => array( - 0, + 0, 1, 12345, -2345, diff --git a/ext/standard/tests/array/array_walk.phpt b/ext/standard/tests/array/array_walk.phpt index cf792bfa19..1f5457c9f7 100644 --- a/ext/standard/tests/array/array_walk.phpt +++ b/ext/standard/tests/array/array_walk.phpt @@ -4,22 +4,22 @@ array_walk() tests <?php function foo($v1, $v2, $v3) { - var_dump($v1); - var_dump($v2); - var_dump($v3); + var_dump($v1); + var_dump($v2); + var_dump($v3); } $var = array(1,2); var_dump(array_walk($var, "foo", "data")); function foo2($v1, $v2, $v3) { - throw new Exception($v3); + throw new Exception($v3); } try { - var_dump(array_walk($var,"foo2", "data")); + var_dump(array_walk($var,"foo2", "data")); } catch (Exception $e) { - var_dump($e->getMessage()); + var_dump($e->getMessage()); } echo "Done\n"; diff --git a/ext/standard/tests/array/array_walk_closure.phpt b/ext/standard/tests/array/array_walk_closure.phpt index 7ac62d7484..6cc49cf9d3 100644 --- a/ext/standard/tests/array/array_walk_closure.phpt +++ b/ext/standard/tests/array/array_walk_closure.phpt @@ -10,8 +10,8 @@ echo "\nclosure with array\n"; $ar = ["one" => 1, "two"=>2, "three" => 3]; $user_data = ["sum" => 42]; $func = function($value, $key, &$udata) { - var_dump($udata); - $udata["sum"] += $value; + var_dump($udata); + $udata["sum"] += $value; }; var_dump(array_walk($ar, $func, $user_data)); @@ -22,8 +22,8 @@ echo "\nclosure with use\n"; $ar = ["one" => 1, "two"=>2, "three" => 3]; $user_data = ["sum" => 42]; $func = function($value, $key) use (&$user_data) { - var_dump($user_data); - $user_data["sum"] += $value; + var_dump($user_data); + $user_data["sum"] += $value; }; var_dump(array_walk($ar, $func, $user_data)); @@ -35,8 +35,8 @@ echo "\nclosure with object\n"; $ar = ["one" => 1, "two"=>2, "three" => 3]; $user_data = (object)["sum" => 42]; $func = function($value, $key, &$udata) { - var_dump($udata); - $udata->sum += $value; + var_dump($udata); + $udata->sum += $value; }; var_dump(array_walk($ar, $func, $user_data)); @@ -48,8 +48,8 @@ var_dump($user_data->sum); echo "\nfunction with object\n"; function sum_it_up_object($value, $key, $udata) { - var_dump($udata); - $udata->sum += $value; + var_dump($udata); + $udata->sum += $value; } $ar = ["one" => 1, "two"=>2, "three" => 3]; @@ -63,8 +63,8 @@ var_dump($user_data->sum); echo "\nfunction with array\n"; function sum_it_up_array($value, $key, $udata) { - var_dump($udata); - $udata['sum'] += $value; + var_dump($udata); + $udata['sum'] += $value; } $ar = ["one" => 1, "two"=>2, "three" => 3]; @@ -77,9 +77,9 @@ var_dump($user_data['sum']); echo "\nclosure and exception\n"; $ar = ["one" => 1, "two"=>2, "three" => 3]; try { - var_dump(array_walk($ar, function($v, $k) { if ($v == 2) throw new Exception; } )); + var_dump(array_walk($ar, function($v, $k) { if ($v == 2) throw new Exception; } )); } catch (Exception $e) { - var_dump($e->getTrace()); + var_dump($e->getTrace()); } diff --git a/ext/standard/tests/array/array_walk_error2.phpt b/ext/standard/tests/array/array_walk_error2.phpt index 73445892a6..dfc95d3af8 100644 --- a/ext/standard/tests/array/array_walk_error2.phpt +++ b/ext/standard/tests/array/array_walk_error2.phpt @@ -23,33 +23,33 @@ echo "*** Testing array_walk() : error conditions - callback parameters ***\n"; // expected: Missing argument Warning try { - var_dump( array_walk($input, "callback1") ); + var_dump( array_walk($input, "callback1") ); } catch (Throwable $e) { - echo "Exception: " . $e->getMessage() . "\n"; + echo "Exception: " . $e->getMessage() . "\n"; } try { - var_dump( array_walk($input, "callback2", 4) ); + var_dump( array_walk($input, "callback2", 4) ); } catch (Throwable $e) { - echo "Exception: " . $e->getMessage() . "\n"; + echo "Exception: " . $e->getMessage() . "\n"; } // expected: Warning is suppressed try { - var_dump( @array_walk($input, "callback1") ); + var_dump( @array_walk($input, "callback1") ); } catch (Throwable $e) { - echo "Exception: " . $e->getMessage() . "\n"; + echo "Exception: " . $e->getMessage() . "\n"; } try { - var_dump( @array_walk($input, "callback2", 4) ); + var_dump( @array_walk($input, "callback2", 4) ); } catch (Throwable $e) { - echo "Exception: " . $e->getMessage() . "\n"; + echo "Exception: " . $e->getMessage() . "\n"; } echo "-- Testing array_walk() function with too many callback parameters --\n"; try { - var_dump( array_walk($input, "callback1", 20, 10) ); + var_dump( array_walk($input, "callback1", 20, 10) ); } catch (Throwable $e) { - echo "Exception: " . $e->getMessage() . "\n"; + echo "Exception: " . $e->getMessage() . "\n"; } echo "Done"; diff --git a/ext/standard/tests/array/array_walk_objects.phpt b/ext/standard/tests/array/array_walk_objects.phpt index 9f3ac8c1cd..a4a517746d 100644 --- a/ext/standard/tests/array/array_walk_objects.phpt +++ b/ext/standard/tests/array/array_walk_objects.phpt @@ -4,13 +4,13 @@ array_walk() and objects <?php function walk($key, $value) { - var_dump($value, $key); + var_dump($value, $key); } class test { - private $var_pri = "test_private"; - protected $var_pro = "test_protected"; - public $var_pub = "test_public"; + private $var_pri = "test_private"; + protected $var_pro = "test_protected"; + public $var_pub = "test_public"; } $stdclass = new stdclass; diff --git a/ext/standard/tests/array/array_walk_rec_objects.phpt b/ext/standard/tests/array/array_walk_rec_objects.phpt index 097143e8ec..51aeae11c9 100644 --- a/ext/standard/tests/array/array_walk_rec_objects.phpt +++ b/ext/standard/tests/array/array_walk_rec_objects.phpt @@ -4,13 +4,13 @@ array_walk_recursive() and objects <?php function walk($key, $value) { - var_dump($value, $key); + var_dump($value, $key); } class test { - private $var_pri = "test_private"; - protected $var_pro = "test_protected"; - public $var_pub = "test_public"; + private $var_pri = "test_private"; + protected $var_pro = "test_protected"; + public $var_pub = "test_public"; } $stdclass = new stdclass; diff --git a/ext/standard/tests/array/array_walk_recursive.phpt b/ext/standard/tests/array/array_walk_recursive.phpt index c8523055e9..0a7fc03a85 100644 --- a/ext/standard/tests/array/array_walk_recursive.phpt +++ b/ext/standard/tests/array/array_walk_recursive.phpt @@ -3,11 +3,11 @@ Test array_walk_recursive() --FILE-- <?php function foo($value) { - echo $value . " foo\n"; + echo $value . " foo\n"; } function bar($value) { - echo $value . " bar\n"; + echo $value . " bar\n"; } $arr = array (1,2,3); diff --git a/ext/standard/tests/array/array_walk_recursive1.phpt b/ext/standard/tests/array/array_walk_recursive1.phpt index f952b4410b..472cb1032d 100644 --- a/ext/standard/tests/array/array_walk_recursive1.phpt +++ b/ext/standard/tests/array/array_walk_recursive1.phpt @@ -4,22 +4,22 @@ array_walk_recursive() tests <?php function foo($v1, $v2, $v3) { - var_dump($v1); - var_dump($v2); - var_dump($v3); + var_dump($v1); + var_dump($v2); + var_dump($v3); } $var = array(1,2, array(2,3)); var_dump(array_walk_recursive($var, "foo", "data")); function foo2($v1, $v2, $v3) { - throw new Exception($v3); + throw new Exception($v3); } try { - var_dump(array_walk_recursive($var,"foo2", "data")); + var_dump(array_walk_recursive($var,"foo2", "data")); } catch (Exception $e) { - var_dump($e->getMessage()); + var_dump($e->getMessage()); } echo "Done\n"; diff --git a/ext/standard/tests/array/array_walk_recursive_error2.phpt b/ext/standard/tests/array/array_walk_recursive_error2.phpt index e9bd7ea175..f1686d7acd 100644 --- a/ext/standard/tests/array/array_walk_recursive_error2.phpt +++ b/ext/standard/tests/array/array_walk_recursive_error2.phpt @@ -23,33 +23,33 @@ echo "*** Testing array_walk_recursive() : error conditions - callback parameter // expected: Missing argument Warning try { - var_dump( array_walk_recursive($input, "callback1") ); + var_dump( array_walk_recursive($input, "callback1") ); } catch (Throwable $e) { - echo "Exception: " . $e->getMessage() . "\n"; + echo "Exception: " . $e->getMessage() . "\n"; } try { - var_dump( array_walk_recursive($input, "callback2", 4) ); + var_dump( array_walk_recursive($input, "callback2", 4) ); } catch (Throwable $e) { - echo "Exception: " . $e->getMessage() . "\n"; + echo "Exception: " . $e->getMessage() . "\n"; } // expected: Warning is suppressed try { - var_dump( @array_walk_recursive($input, "callback1") ); + var_dump( @array_walk_recursive($input, "callback1") ); } catch (Throwable $e) { - echo "Exception: " . $e->getMessage() . "\n"; + echo "Exception: " . $e->getMessage() . "\n"; } try { - var_dump( @array_walk_recursive($input, "callback2", 4) ); + var_dump( @array_walk_recursive($input, "callback2", 4) ); } catch (Throwable $e) { - echo "Exception: " . $e->getMessage() . "\n"; + echo "Exception: " . $e->getMessage() . "\n"; } echo "-- Testing array_walk_recursive() function with too many callback parameters --\n"; try { - var_dump( array_walk_recursive($input, "callback1", 20, 10) ); + var_dump( array_walk_recursive($input, "callback1", 20, 10) ); } catch (Throwable $e) { - echo "Exception: " . $e->getMessage() . "\n"; + echo "Exception: " . $e->getMessage() . "\n"; } echo "Done"; diff --git a/ext/standard/tests/array/arsort_basic.phpt b/ext/standard/tests/array/arsort_basic.phpt index afd8bb8f49..7ed285aac7 100644 --- a/ext/standard/tests/array/arsort_basic.phpt +++ b/ext/standard/tests/array/arsort_basic.phpt @@ -21,9 +21,9 @@ echo "*** Testing arsort() : basic functionality ***\n"; // an array containing unsorted string values with indices $unsorted_strings = array( - "l" => "lemon", "o" => "orange", - "O" => "Orange", "O1" => "Orange1", "o2" => "orange2", "O3" => "Orange3", "o20" => "orange20", - "b" => "banana", + "l" => "lemon", "o" => "orange", + "O" => "Orange", "O1" => "Orange1", "o2" => "orange2", "O3" => "Orange3", "o20" => "orange20", + "b" => "banana", ); // an array containing unsorted numeric values with indices $unsorted_numerics = array( 1 => 100, 2 => 33, 3 => 555, 4 => 22 ); diff --git a/ext/standard/tests/array/asort_basic.phpt b/ext/standard/tests/array/asort_basic.phpt index c0ae2bc88d..8b4a7c2081 100644 --- a/ext/standard/tests/array/asort_basic.phpt +++ b/ext/standard/tests/array/asort_basic.phpt @@ -21,9 +21,9 @@ echo "*** Testing asort() : basic functionality ***\n"; // an array containing unsorted string values with indices $unsorted_strings = array( - "l" => "lemon", "o" => "orange", - "O" => "Orange", "O1" => "Orange1", "o2" => "orange2", "O3" => "Orange3", "o20" => "orange20", - "b" => "banana", + "l" => "lemon", "o" => "orange", + "O" => "Orange", "O1" => "Orange1", "o2" => "orange2", "O3" => "Orange3", "o20" => "orange20", + "b" => "banana", ); // an array containing unsorted numeric values with indices $unsorted_numerics = array( 1 => 100, 2 => 33, 3 => 555, 4 => 22 ); diff --git a/ext/standard/tests/array/bug12776.phpt b/ext/standard/tests/array/bug12776.phpt index 54c6f6fceb..957832b97e 100644 --- a/ext/standard/tests/array/bug12776.phpt +++ b/ext/standard/tests/array/bug12776.phpt @@ -5,10 +5,10 @@ Bug #12776 (array_walk crash) function test($val,$key) { - global $globalArray; - $globalArray[]=$key; // this will end up crashing - $globalArray[]=(string)$key; // this will end up OK - print "val: $val; key: $key\n"; flush(); + global $globalArray; + $globalArray[]=$key; // this will end up crashing + $globalArray[]=(string)$key; // this will end up OK + print "val: $val; key: $key\n"; flush(); } $arr=array('k'=>'v'); diff --git a/ext/standard/tests/array/bug14580.phpt b/ext/standard/tests/array/bug14580.phpt index 1cf27f22d6..8f4c7d5bd3 100644 --- a/ext/standard/tests/array/bug14580.phpt +++ b/ext/standard/tests/array/bug14580.phpt @@ -2,10 +2,10 @@ Bug #14580 (key() not binary safe) --FILE-- <?php - $arr = array ("foo\0bar" => "foo\0bar"); - $key = key($arr); - echo strlen($key), ': '; - echo urlencode($key), "\n"; + $arr = array ("foo\0bar" => "foo\0bar"); + $key = key($arr); + echo strlen($key), ': '; + echo urlencode($key), "\n"; ?> --EXPECT-- 7: foo%00bar diff --git a/ext/standard/tests/array/bug20381.phpt b/ext/standard/tests/array/bug20381.phpt index 1adaa863b7..0da52d9fd9 100644 --- a/ext/standard/tests/array/bug20381.phpt +++ b/ext/standard/tests/array/bug20381.phpt @@ -3,20 +3,20 @@ Bug #20381 (array_merge_recursive mangles input arrays) --FILE-- <?php $a = array( - 'a1' => 1, - 'a2' => array( 1, 2, 3 ), - 'a3' => array( - 'a' => array( 10, 20, 30 ), - 'b' => 'b' - ) - ); + 'a1' => 1, + 'a2' => array( 1, 2, 3 ), + 'a3' => array( + 'a' => array( 10, 20, 30 ), + 'b' => 'b' + ) + ); $b = array( 'a1' => 2, - 'a2' => array( 3, 4, 5 ), - 'a3' => array( - 'c' => 'cc', - 'a' => array( 10, 40 ) - ) - ); + 'a2' => array( 3, 4, 5 ), + 'a3' => array( + 'c' => 'cc', + 'a' => array( 10, 40 ) + ) + ); var_dump($a); array_merge_recursive( $a, $b ); diff --git a/ext/standard/tests/array/bug20865.phpt b/ext/standard/tests/array/bug20865.phpt index f1edbabab5..6dfad2bcec 100644 --- a/ext/standard/tests/array/bug20865.phpt +++ b/ext/standard/tests/array/bug20865.phpt @@ -2,10 +2,10 @@ Bug #20865 (array_key_exists and NULL key) --FILE-- <?php - $ta = array(1, 2, 3); - $ta[NULL] = "Null Value"; + $ta = array(1, 2, 3); + $ta[NULL] = "Null Value"; - var_dump(array_key_exists(NULL, $ta)); + var_dump(array_key_exists(NULL, $ta)); ?> --EXPECT-- bool(true) diff --git a/ext/standard/tests/array/bug21918.phpt b/ext/standard/tests/array/bug21918.phpt index 8e440baf8c..e855aacd7e 100644 --- a/ext/standard/tests/array/bug21918.phpt +++ b/ext/standard/tests/array/bug21918.phpt @@ -7,8 +7,8 @@ echo "==Mixed==\n"; $a = array(-1=>'a', '-2'=>'b', 3=>'c', '4'=>'d', 5=>'e', '6001'=>'f', '07'=>'g'); foreach($a as $k => $v) { - var_dump($k); - var_dump($v); + var_dump($k); + var_dump($v); } echo "==Normal==\n"; @@ -16,16 +16,16 @@ $b = array(); $b[] = 'a'; foreach($b as $k => $v) { - var_dump($k); - var_dump($v); + var_dump($k); + var_dump($v); } echo "==Negative==\n"; $c = array('-2' => 'a'); foreach($c as $k => $v) { - var_dump($k); - var_dump($v); + var_dump($k); + var_dump($v); } ?> diff --git a/ext/standard/tests/array/bug22463.phpt b/ext/standard/tests/array/bug22463.phpt index 7993ac2576..434c2b6e23 100644 --- a/ext/standard/tests/array/bug22463.phpt +++ b/ext/standard/tests/array/bug22463.phpt @@ -4,23 +4,23 @@ Bug #22463 (array_reduce() segfaults) <?php function a($ary) { - return (is_array($ary) ? array_reduce($ary, 'cb', 0) : 1); + return (is_array($ary) ? array_reduce($ary, 'cb', 0) : 1); } function cb($v, $elem) { - return $v + a($elem); + return $v + a($elem); } $ary = array( - array( - array( - array( - array( - array(0, 1, 2, 3, 4) - ) - ) - ) - ) + array( + array( + array( + array( + array(0, 1, 2, 3, 4) + ) + ) + ) + ) ); var_dump(a($ary)); diff --git a/ext/standard/tests/array/bug24220.phpt b/ext/standard/tests/array/bug24220.phpt index c8e25709e9..d0242e6bf9 100644 --- a/ext/standard/tests/array/bug24220.phpt +++ b/ext/standard/tests/array/bug24220.phpt @@ -2,9 +2,9 @@ Bug #24220 (range() numeric string handling) --FILE-- <?php - var_dump(range("2003", "2004")); - var_dump(range("a", "z")); - var_dump(range("1", "10")); + var_dump(range("2003", "2004")); + var_dump(range("a", "z")); + var_dump(range("1", "10")); ?> --EXPECT-- array(2) { diff --git a/ext/standard/tests/array/bug24980.phpt b/ext/standard/tests/array/bug24980.phpt index 6c97562f6c..829e156afd 100644 --- a/ext/standard/tests/array/bug24980.phpt +++ b/ext/standard/tests/array/bug24980.phpt @@ -5,9 +5,9 @@ Bug #24980 (array_reduce() uses first element as default running total) /* test #1: numeric data */ function add_up($running_total, $current_value) { - echo "running_total is ".(int)$running_total.", current_value is {$current_value}\n"; - $running_total += $current_value * $current_value; - return $running_total; + echo "running_total is ".(int)$running_total.", current_value is {$current_value}\n"; + $running_total += $current_value * $current_value; + return $running_total; } $numbers = array (2,3,5,7); @@ -18,20 +18,20 @@ print "Total is $total\n"; $a = array("a", "b", "c"); function foo ($a, $b) { - return $a . $b; + return $a . $b; } var_dump(array_reduce($a, "foo")); /* test #3: basic test (used to leak memory) */ function rsum($v, $w) { - $v += $w; - return $v; + $v += $w; + return $v; } function rmul($v, $w) { - $v *= $w; - return $v; + $v *= $w; + return $v; } $a = array(1, 2, 3, 4, 5); $x = array(); diff --git a/ext/standard/tests/array/bug25708.phpt b/ext/standard/tests/array/bug25708.phpt index ff8b9f4304..0e695b69c9 100644 --- a/ext/standard/tests/array/bug25708.phpt +++ b/ext/standard/tests/array/bug25708.phpt @@ -3,55 +3,55 @@ Bug #25708 (extract($GLOBALS, EXTR_REFS) mangles $GLOBALS) --FILE-- <?php function foo($ref, $alt) { - unset($GLOBALS['a']); - unset($GLOBALS['b']); - $GLOBALS['a'] = 1; - $GLOBALS['b'] = 2; + unset($GLOBALS['a']); + unset($GLOBALS['b']); + $GLOBALS['a'] = 1; + $GLOBALS['b'] = 2; - $org_a = $GLOBALS['a']; - $org_b = $GLOBALS['b']; + $org_a = $GLOBALS['a']; + $org_b = $GLOBALS['b']; - if ($ref) { - global $a, $b; - } else { - /* zval temp_var(NULL); // refcount = 1 - * a = temp_var[x] // refcount = 2 - */ - $a = NULL; - $b = NULL; - } + if ($ref) { + global $a, $b; + } else { + /* zval temp_var(NULL); // refcount = 1 + * a = temp_var[x] // refcount = 2 + */ + $a = NULL; + $b = NULL; + } - debug_zval_dump($a, $b, $GLOBALS['a'], $GLOBALS['b']); - echo "--\n"; - if ($alt) { - $a = &$GLOBALS['a']; - $b = &$GLOBALS['b']; - } else { - extract($GLOBALS, EXTR_REFS); - } - debug_zval_dump($a, $b, $GLOBALS['a'], $GLOBALS['b']); - echo "--\n"; - $a = &$GLOBALS['a']; - $b = &$GLOBALS['b']; - debug_zval_dump($a, $b, $GLOBALS['a'], $GLOBALS['b']); - echo "--\n"; - $GLOBALS['b'] = 3; - debug_zval_dump($a, $b, $GLOBALS['a'], $GLOBALS['b']); - echo "--\n"; - $a = 4; - debug_zval_dump($a, $b, $GLOBALS['a'], $GLOBALS['b']); - echo "--\n"; - $c = $b; - debug_zval_dump($b, $GLOBALS['b'], $c); - echo "--\n"; - $b = 'x'; - debug_zval_dump($a, $b, $GLOBALS['a'], $GLOBALS['b'], $c); - echo "--\n"; - debug_zval_dump($org_a, $org_b); - echo "----"; - if ($ref) echo 'r'; - if ($alt) echo 'a'; - echo "\n"; + debug_zval_dump($a, $b, $GLOBALS['a'], $GLOBALS['b']); + echo "--\n"; + if ($alt) { + $a = &$GLOBALS['a']; + $b = &$GLOBALS['b']; + } else { + extract($GLOBALS, EXTR_REFS); + } + debug_zval_dump($a, $b, $GLOBALS['a'], $GLOBALS['b']); + echo "--\n"; + $a = &$GLOBALS['a']; + $b = &$GLOBALS['b']; + debug_zval_dump($a, $b, $GLOBALS['a'], $GLOBALS['b']); + echo "--\n"; + $GLOBALS['b'] = 3; + debug_zval_dump($a, $b, $GLOBALS['a'], $GLOBALS['b']); + echo "--\n"; + $a = 4; + debug_zval_dump($a, $b, $GLOBALS['a'], $GLOBALS['b']); + echo "--\n"; + $c = $b; + debug_zval_dump($b, $GLOBALS['b'], $c); + echo "--\n"; + $b = 'x'; + debug_zval_dump($a, $b, $GLOBALS['a'], $GLOBALS['b'], $c); + echo "--\n"; + debug_zval_dump($org_a, $org_b); + echo "----"; + if ($ref) echo 'r'; + if ($alt) echo 'a'; + echo "\n"; } $a = 'ok'; diff --git a/ext/standard/tests/array/bug25758.phpt b/ext/standard/tests/array/bug25758.phpt index ff97d2e3fb..a2d2952d85 100644 --- a/ext/standard/tests/array/bug25758.phpt +++ b/ext/standard/tests/array/bug25758.phpt @@ -2,8 +2,8 @@ Bug #25758 (var_export does not escape ' & \ inside array keys) --FILE-- <?php - $a = array ("quote'" => array("quote'")); - echo var_export($a, true); + $a = array ("quote'" => array("quote'")); + echo var_export($a, true); ?> --EXPECT-- array ( diff --git a/ext/standard/tests/array/bug29493.phpt b/ext/standard/tests/array/bug29493.phpt index 0cfe45910b..30a7c058c2 100644 --- a/ext/standard/tests/array/bug29493.phpt +++ b/ext/standard/tests/array/bug29493.phpt @@ -4,68 +4,68 @@ Bug #29493 (extract(EXTR_REFS) fails if array has multiple referrals) <?php function t1() { - $a = array('foo' => 'aaa'); - // refcount($a) = 1 - // refcount($a['foo']) = 1 - $b = $a; - // refcount($a) = 2 - // refcount($a['foo']) = 1 - $b['foo'] = 'bbb'; - // refcount($a) = 1 - // refcount($a['foo']) = 1 + $a = array('foo' => 'aaa'); + // refcount($a) = 1 + // refcount($a['foo']) = 1 + $b = $a; + // refcount($a) = 2 + // refcount($a['foo']) = 1 + $b['foo'] = 'bbb'; + // refcount($a) = 1 + // refcount($a['foo']) = 1 - var_dump($a, $b); + var_dump($a, $b); - extract($a, EXTR_REFS); + extract($a, EXTR_REFS); - $foo = 'noo'; + $foo = 'noo'; - var_dump($a, $b); + var_dump($a, $b); } function t2() { - $a = array('foo' => 'aaa'); - // refcount($a) = 1 - // refcount($a['foo']) = 1 - $b = &$a; - // refcount($a) = 2 - // is_ref($a) = true - // refcount($a['foo']) = 1 - $b['foo'] = 'bbb'; - // refcount($a) = 2 - // refcount($a['foo']) = 1 + $a = array('foo' => 'aaa'); + // refcount($a) = 1 + // refcount($a['foo']) = 1 + $b = &$a; + // refcount($a) = 2 + // is_ref($a) = true + // refcount($a['foo']) = 1 + $b['foo'] = 'bbb'; + // refcount($a) = 2 + // refcount($a['foo']) = 1 - var_dump($a, $b); + var_dump($a, $b); - extract($a, EXTR_REFS); + extract($a, EXTR_REFS); - $foo = 'noo'; + $foo = 'noo'; - var_dump($a, $b); + var_dump($a, $b); } function t3() { - $a = array('foo' => 'aaa'); - // refcount($a) = 1 - // refcount($a['foo']) = 1 - $b = &$a; - // refcount($a) = 2 - // is_ref($a) = true - // refcount($a['foo']) = 1 - unset($b); - // refcount($a) = 1 - // is_ref($a) = true - // refcount($a['foo']) = 1 + $a = array('foo' => 'aaa'); + // refcount($a) = 1 + // refcount($a['foo']) = 1 + $b = &$a; + // refcount($a) = 2 + // is_ref($a) = true + // refcount($a['foo']) = 1 + unset($b); + // refcount($a) = 1 + // is_ref($a) = true + // refcount($a['foo']) = 1 - var_dump($a); + var_dump($a); - extract($a, EXTR_REFS); + extract($a, EXTR_REFS); - $foo = 'noo'; + $foo = 'noo'; - var_dump($a); + var_dump($a); } t1(); diff --git a/ext/standard/tests/array/bug30266.phpt b/ext/standard/tests/array/bug30266.phpt index 0a196c0cb8..2579714ae7 100644 --- a/ext/standard/tests/array/bug30266.phpt +++ b/ext/standard/tests/array/bug30266.phpt @@ -4,13 +4,13 @@ Bug #30266 (Invalid opcode 137/1/8) and array_walk <?php class testc { - public $b = "c"; + public $b = "c"; - function crash($val) - { - $this->b = $val; - throw new Exception("Error"); - } + function crash($val) + { + $this->b = $val; + throw new Exception("Error"); + } } $fruits = array ("d"=>"lemon", "a"=>"orange", "b"=>"banana", "c"=>"apple"); @@ -19,16 +19,16 @@ $myobj = new testc(); function test($item2, $key, $userd) { - $userd->crash($item2); + $userd->crash($item2); } try { - array_walk($fruits, 'test', $myobj); + array_walk($fruits, 'test', $myobj); } catch(Exception $e) { - echo "Caught: " . $e->getMessage() . "\n"; + echo "Caught: " . $e->getMessage() . "\n"; } ?> --EXPECT-- diff --git a/ext/standard/tests/array/bug31213.phpt b/ext/standard/tests/array/bug31213.phpt index 6aa31d5e0e..829c657d1e 100644 --- a/ext/standard/tests/array/bug31213.phpt +++ b/ext/standard/tests/array/bug31213.phpt @@ -3,27 +3,27 @@ Bug #31213 (Sideeffects caused by bug #29493) --FILE-- <?php function test($use_extract) { - $a = 1; - $b = 1; + $a = 1; + $b = 1; - $arr = array( - '_a' => $a, - '_b' => &$b - ); + $arr = array( + '_a' => $a, + '_b' => &$b + ); - var_dump($a, $b); + var_dump($a, $b); - if ($use_extract) { - extract($arr, EXTR_REFS); - } else { - $_a = &$arr['_a']; - $_b = &$arr['_b']; - } + if ($use_extract) { + extract($arr, EXTR_REFS); + } else { + $_a = &$arr['_a']; + $_b = &$arr['_b']; + } - $_a++; - $_b++; + $_a++; + $_b++; - var_dump($a, $b, $_a, $_b, $arr); + var_dump($a, $b, $_a, $_b, $arr); } test(false); diff --git a/ext/standard/tests/array/bug34066.phpt b/ext/standard/tests/array/bug34066.phpt index 44710b0426..df524feb9c 100644 --- a/ext/standard/tests/array/bug34066.phpt +++ b/ext/standard/tests/array/bug34066.phpt @@ -245,21 +245,21 @@ function gen_xml($val, $key, $prefix) global $xml_fd; print "gen_xml(prefix=$prefix)\n"; if (is_array($val)) { - if (preg_match('/^\d+$/', $key)) { - if ($key == 1) { - print substr($prefix, 0, -1) . "\n"; - } - array_walk($val, "gen_xml", "$prefix@"); - } - else { - array_walk($val, "gen_xml", "$prefix$key/"); - } + if (preg_match('/^\d+$/', $key)) { + if ($key == 1) { + print substr($prefix, 0, -1) . "\n"; + } + array_walk($val, "gen_xml", "$prefix@"); } else { - if (strlen($val) > 0) - print "$prefix$key=$val\n"; - else - print "$prefix$key\n"; + array_walk($val, "gen_xml", "$prefix$key/"); + } + } + else { + if (strlen($val) > 0) + print "$prefix$key=$val\n"; + else + print "$prefix$key\n"; } print "gen_xml(prefix=$prefix) end\n"; } diff --git a/ext/standard/tests/array/bug34066_1.phpt b/ext/standard/tests/array/bug34066_1.phpt index 5200fa86a6..5ded4ea816 100644 --- a/ext/standard/tests/array/bug34066_1.phpt +++ b/ext/standard/tests/array/bug34066_1.phpt @@ -245,21 +245,21 @@ function gen_xml($val, $key, $prefix) global $xml_fd; print "gen_xml(prefix=$prefix)\n"; if (is_array($val)) { - if (preg_match('/^\d+$/', $key)) { - if ($key == 1) { - print substr($prefix, 0, -1) . "\n"; - } - array_walk_recursive($val, "gen_xml", "$prefix@"); - } - else { - array_walk_recursive($val, "gen_xml", "$prefix$key/"); - } + if (preg_match('/^\d+$/', $key)) { + if ($key == 1) { + print substr($prefix, 0, -1) . "\n"; + } + array_walk_recursive($val, "gen_xml", "$prefix@"); } else { - if (strlen($val) > 0) - print "$prefix$key=$val\n"; - else - print "$prefix$key\n"; + array_walk_recursive($val, "gen_xml", "$prefix$key/"); + } + } + else { + if (strlen($val) > 0) + print "$prefix$key=$val\n"; + else + print "$prefix$key\n"; } print "gen_xml(prefix=$prefix) end\n"; } diff --git a/ext/standard/tests/array/bug35014.phpt b/ext/standard/tests/array/bug35014.phpt index b674590fd6..8980f00d80 100644 --- a/ext/standard/tests/array/bug35014.phpt +++ b/ext/standard/tests/array/bug35014.phpt @@ -7,18 +7,18 @@ precision=14 --FILE-- <?php $tests = array( - array(), - array(0), - array(3), - array(3, 3), - array(0.5, 2), - array(99999999, 99999999), - array(8.993, 7443241,988, sprintf("%u", -1)+0.44), - array(2,sprintf("%u", -1)), + array(), + array(0), + array(3), + array(3, 3), + array(0.5, 2), + array(99999999, 99999999), + array(8.993, 7443241,988, sprintf("%u", -1)+0.44), + array(2,sprintf("%u", -1)), ); foreach ($tests as $v) { - var_dump(array_product($v)); + var_dump(array_product($v)); } ?> --EXPECT-- diff --git a/ext/standard/tests/array/bug35014_64bit.phpt b/ext/standard/tests/array/bug35014_64bit.phpt index 3b3d29b5be..91face05af 100644 --- a/ext/standard/tests/array/bug35014_64bit.phpt +++ b/ext/standard/tests/array/bug35014_64bit.phpt @@ -7,18 +7,18 @@ precision=14 --FILE-- <?php $tests = array( - array(), - array(0), - array(3), - array(3, 3), - array(0.5, 2), - array(99999999, 99999999), - array(8.993, 7443241,988, sprintf("%u", -1)+0.44), - array(2,sprintf("%u", -1)), + array(), + array(0), + array(3), + array(3, 3), + array(0.5, 2), + array(99999999, 99999999), + array(8.993, 7443241,988, sprintf("%u", -1)+0.44), + array(2,sprintf("%u", -1)), ); foreach ($tests as $v) { - var_dump(array_product($v)); + var_dump(array_product($v)); } ?> --EXPECT-- diff --git a/ext/standard/tests/array/bug35022.phpt b/ext/standard/tests/array/bug35022.phpt index 07138f138d..8c67c5201a 100644 --- a/ext/standard/tests/array/bug35022.phpt +++ b/ext/standard/tests/array/bug35022.phpt @@ -6,7 +6,7 @@ $state = array("one" => 1, "two" => 2, "three" => 3); function foo( &$state ) { $contentDict = end( $state ); for ( $contentDict = end( $state ); $contentDict !== false; $contentDict = prev( $state ) ) { - echo key($state) . " => " . current($state) . "\n"; + echo key($state) . " => " . current($state) . "\n"; } } foo($state); diff --git a/ext/standard/tests/array/bug35821.phpt b/ext/standard/tests/array/bug35821.phpt index 3b1ecb6278..e01ec6e392 100644 --- a/ext/standard/tests/array/bug35821.phpt +++ b/ext/standard/tests/array/bug35821.phpt @@ -5,15 +5,15 @@ Bug #35821 (array_map() segfaults when exception is throwed from the callback) class Element { - public function ThrowException () - { - throw new Exception(); - } + public function ThrowException () + { + throw new Exception(); + } - public static function CallBack(Element $elem) - { - $elem->ThrowException(); - } + public static function CallBack(Element $elem) + { + $elem->ThrowException(); + } } $arr = array(new Element(), new Element(), new Element()); diff --git a/ext/standard/tests/array/bug39576.phpt b/ext/standard/tests/array/bug39576.phpt index bb58e79183..3ac9756941 100644 --- a/ext/standard/tests/array/bug39576.phpt +++ b/ext/standard/tests/array/bug39576.phpt @@ -5,9 +5,9 @@ Bug #39576 (array_walk() doesn't separate userdata zval) class Test { - public $_table = ''; - public $_columns = array (); - public $_primary = array (); + public $_table = ''; + public $_columns = array (); + public $_primary = array (); } @@ -18,16 +18,16 @@ $test->_columns['name'] = new stdClass; function test ($value, $column, &$columns) {} array_walk ( - get_object_vars ($test), - 'test', - $test->_columns + get_object_vars ($test), + 'test', + $test->_columns ); var_dump($test); array_intersect_key ( - get_object_vars ($test), - $test->_primary + get_object_vars ($test), + $test->_primary ); echo "Done\n"; diff --git a/ext/standard/tests/array/bug41686.phpt b/ext/standard/tests/array/bug41686.phpt index d293fdf175..b94acb608d 100644 --- a/ext/standard/tests/array/bug41686.phpt +++ b/ext/standard/tests/array/bug41686.phpt @@ -6,12 +6,12 @@ $a = array(1,2,3); $b = array('a'=>1,'b'=>1,'c'=>2); var_dump( - array_slice($a, 1), - array_slice($a, 1, 2, TRUE), - array_slice($a, 1, NULL, TRUE), - array_slice($b, 1), - array_slice($b, 1, 2, TRUE), - array_slice($b, 1, NULL, TRUE) + array_slice($a, 1), + array_slice($a, 1, 2, TRUE), + array_slice($a, 1, NULL, TRUE), + array_slice($b, 1), + array_slice($b, 1, 2, TRUE), + array_slice($b, 1, NULL, TRUE) ); echo "Done\n"; diff --git a/ext/standard/tests/array/bug42233.phpt b/ext/standard/tests/array/bug42233.phpt index 0cebc428f7..c02a620ae6 100644 --- a/ext/standard/tests/array/bug42233.phpt +++ b/ext/standard/tests/array/bug42233.phpt @@ -4,9 +4,9 @@ Bug #42233 (extract(): scandic characters not allowed as variable name) <?php $test = array( - 'a' => '1', - 'æ' => '2', - 'æøåäö' => '3', + 'a' => '1', + 'æ' => '2', + 'æøåäö' => '3', ); var_dump($test); diff --git a/ext/standard/tests/array/bug42838.phpt b/ext/standard/tests/array/bug42838.phpt index 5a09ae9c8e..fbd8234987 100644 --- a/ext/standard/tests/array/bug42838.phpt +++ b/ext/standard/tests/array/bug42838.phpt @@ -5,10 +5,10 @@ Bug #42838 (Wrong results in array_diff_uassoc()) function key_compare_func($a, $b) { - if ($a === $b) { - return 0; - } - return ($a > $b)? 1:-1; + if ($a === $b) { + return 0; + } + return ($a > $b)? 1:-1; } $array1 = array("a" => "green", "b" => "Brown", 'c' => 'blue', 0 => 'red'); diff --git a/ext/standard/tests/array/bug45312.phpt b/ext/standard/tests/array/bug45312.phpt index 858bdfa4bf..a315814108 100644 --- a/ext/standard/tests/array/bug45312.phpt +++ b/ext/standard/tests/array/bug45312.phpt @@ -12,7 +12,7 @@ class cr { return ($a->priv_member > $b->priv_member) ? 1 : -1; } static function comp_func_cr2($a, $b) { - echo "."; + echo "."; if ($a->priv_member === $b->priv_member) return 0; return ($a->priv_member < $b->priv_member) ? 1 : -1; } @@ -24,11 +24,11 @@ $a = array("0.1" => new cr(9), "0.5" => new cr(12), 0 => new cr(23), 1 => new cr $b = array("0.2" => new cr(9), "0.5" => new cr(22), 0 => new cr(3), 1 => new cr(4), 2 => new cr(-15),); $result = array_udiff_assoc($a, $b, array("cr", "comp_func_cr")); foreach($result as $val) { - $val->dump(); + $val->dump(); } $result = array_udiff_assoc($a, $b, array("cr", "comp_func_cr2")); foreach($result as $val) { - $val->dump(); + $val->dump(); } ?> --EXPECT-- diff --git a/ext/standard/tests/array/bug68553.phpt b/ext/standard/tests/array/bug68553.phpt index fbee975d17..966c98b544 100644 --- a/ext/standard/tests/array/bug68553.phpt +++ b/ext/standard/tests/array/bug68553.phpt @@ -5,19 +5,19 @@ Bug #68553 (array_column: null values in $index_key become incrementing keys in $i = 100; /* increase the resource id to make test stable */ while ($i--) { - $fd = fopen(__FILE__, "r"); - fclose($fd); + $fd = fopen(__FILE__, "r"); + fclose($fd); } $a = [ - ['a' => 10], - ['a' => 20], - ['a' => true], - ['a' => false], - ['a' => fopen(__FILE__, "r")], - ['a' => -5], - ['a' => 7.38], - ['a' => null, "test"], - ['a' => null], + ['a' => 10], + ['a' => 20], + ['a' => true], + ['a' => false], + ['a' => fopen(__FILE__, "r")], + ['a' => -5], + ['a' => 7.38], + ['a' => null, "test"], + ['a' => null], ]; var_dump(array_column($a, null, 'a')); diff --git a/ext/standard/tests/array/bug69198.phpt b/ext/standard/tests/array/bug69198.phpt index 96a0f9a963..3441bee5d7 100644 --- a/ext/standard/tests/array/bug69198.phpt +++ b/ext/standard/tests/array/bug69198.phpt @@ -3,7 +3,7 @@ Bug #69198 (Compact function generate array with length but no content) --FILE-- <?php if (false) { - $willNeverBeDefined = true; + $willNeverBeDefined = true; } $result = compact('willNeverBeDefined'); var_dump($result, empty($result), $result === array(), empty($willNeverBeDefined)); diff --git a/ext/standard/tests/array/bug69299.phpt b/ext/standard/tests/array/bug69299.phpt index 088b10fd13..77c76166af 100644 --- a/ext/standard/tests/array/bug69299.phpt +++ b/ext/standard/tests/array/bug69299.phpt @@ -4,12 +4,12 @@ Bug #69299 (Regression in array_filter's $flag argument in PHP 7) <?php $toFilter = array('foo' => 'bar', 'fiz' => 'buz'); $filtered = array_filter($toFilter, function ($value, $key) { - if ($value === 'buz' - || $key === 'foo' - ) { - return false; - } - return true; + if ($value === 'buz' + || $key === 'foo' + ) { + return false; + } + return true; }, ARRAY_FILTER_USE_BOTH); var_dump($filtered); ?> diff --git a/ext/standard/tests/array/bug69723.phpt b/ext/standard/tests/array/bug69723.phpt index 23b3576a51..88183c5aae 100644 --- a/ext/standard/tests/array/bug69723.phpt +++ b/ext/standard/tests/array/bug69723.phpt @@ -3,23 +3,23 @@ Bug #69723 (Passing parameters by reference and array_column) --FILE-- <?php function byReference( & $array){ - foreach($array as &$item){ - $item['nanana'] = 'batman'; - $item['superhero'] = 'robin'; - } + foreach($array as &$item){ + $item['nanana'] = 'batman'; + $item['superhero'] = 'robin'; + } } $array = [ - [ - 'superhero'=> 'superman', - 'nanana' => 'no nana' - ], - [ - 'superhero'=> 'acuaman', - 'nanana' => 'no nana' - ], + [ + 'superhero'=> 'superman', + 'nanana' => 'no nana' + ], + [ + 'superhero'=> 'acuaman', + 'nanana' => 'no nana' + ], - ]; + ]; var_dump(array_column($array, 'superhero')); byReference($array); diff --git a/ext/standard/tests/array/bug70713.phpt b/ext/standard/tests/array/bug70713.phpt index f24720607d..fab1661e84 100644 --- a/ext/standard/tests/array/bug70713.phpt +++ b/ext/standard/tests/array/bug70713.phpt @@ -5,17 +5,17 @@ Bug #70713: Use After Free Vulnerability in array_walk()/array_walk_recursive() class obj { - function __tostring() - { - global $arr; + function __tostring() + { + global $arr; - $arr = 1; - for ($i = 0; $i < 5; $i++) { - $v[$i] = 'hi'.$i; - } + $arr = 1; + for ($i = 0; $i < 5; $i++) { + $v[$i] = 'hi'.$i; + } - return 'hi'; - } + return 'hi'; + } } $arr = array('string' => new obj); diff --git a/ext/standard/tests/array/bug71334.phpt b/ext/standard/tests/array/bug71334.phpt index 7a37d0953a..ba14f08c18 100644 --- a/ext/standard/tests/array/bug71334.phpt +++ b/ext/standard/tests/array/bug71334.phpt @@ -5,29 +5,29 @@ Bug #71334: Cannot access array keys while uksort() class myClass { - private $a = [ - 'foo-test' => [1], - '-' => [2], - 'bar-test' => [3] - ]; + private $a = [ + 'foo-test' => [1], + '-' => [2], + 'bar-test' => [3] + ]; - private function _mySort($x, $y) - { - if (!isset($this->a[$x])) { - throw new Exception('Missing X: "' . $x . '"'); - } + private function _mySort($x, $y) + { + if (!isset($this->a[$x])) { + throw new Exception('Missing X: "' . $x . '"'); + } - if (!isset($this->a[$y])) { - throw new Exception('Missing Y: "' . $y . '"'); - } + if (!isset($this->a[$y])) { + throw new Exception('Missing Y: "' . $y . '"'); + } - return $x < $y; - } + return $x < $y; + } - public function __construct() - { - uksort($this->a, [$this, '_mySort']); - } + public function __construct() + { + uksort($this->a, [$this, '_mySort']); + } } new myClass(); diff --git a/ext/standard/tests/array/bug71660.phpt b/ext/standard/tests/array/bug71660.phpt index c2d7192378..067f533381 100644 --- a/ext/standard/tests/array/bug71660.phpt +++ b/ext/standard/tests/array/bug71660.phpt @@ -4,7 +4,7 @@ Bug #71660 (array_column behaves incorrectly after foreach by reference) <?php $arr = array('id' => 12345, 'name' => 'sam'); foreach ($arr as &$v) { - $v = $v; + $v = $v; } $arr = [$arr]; diff --git a/ext/standard/tests/array/bug72622.phpt b/ext/standard/tests/array/bug72622.phpt index 66e22f3bf9..cf1a3ece8a 100644 --- a/ext/standard/tests/array/bug72622.phpt +++ b/ext/standard/tests/array/bug72622.phpt @@ -4,11 +4,11 @@ Bug #72622 (array_walk + array_replace_recursive create references from nothing) <?php function walk (array $arr) { - array_walk($arr, function (&$val, $name) { + array_walk($arr, function (&$val, $name) { - }); + }); - return $arr; + return $arr; } $arr3 = ['foo' => 'foo']; diff --git a/ext/standard/tests/array/bug76713.phpt b/ext/standard/tests/array/bug76713.phpt index 0c993f5721..8bb8bf221f 100644 --- a/ext/standard/tests/array/bug76713.phpt +++ b/ext/standard/tests/array/bug76713.phpt @@ -4,7 +4,7 @@ Bug #76713 (Segmentation fault caused by property corruption) <?php function test($obj) { - return array_column(array($obj), "prop"); + return array_column(array($obj), "prop"); } $obj = new Stdclass(); @@ -18,10 +18,10 @@ test($obj); var_dump($obj->prop); class C { - public $name; - public function __get($name) { - return $this->name; - } + public $name; + public function __get($name) { + return $this->name; + } } $obj = new C; diff --git a/ext/standard/tests/array/bug77395.phpt b/ext/standard/tests/array/bug77395.phpt index bca1e3136c..a4a79f5e2f 100644 --- a/ext/standard/tests/array/bug77395.phpt +++ b/ext/standard/tests/array/bug77395.phpt @@ -3,10 +3,10 @@ Bug #77395 (segfault about array_multisort) --FILE-- <?php function error_handle($level, $message, $file = '', $line = 0){ - $a = [1,2,3]; - $b = [3,2,1]; - echo $message; - array_multisort($a, SORT_ASC, $b); // if comment this line, no segfault happen + $a = [1,2,3]; + $b = [3,2,1]; + echo $message; + array_multisort($a, SORT_ASC, $b); // if comment this line, no segfault happen } set_error_handler('error_handle'); $data = [['aa'=> 'bb',], ['aa'=> 'bb',],]; diff --git a/ext/standard/tests/array/compact_variation2.phpt b/ext/standard/tests/array/compact_variation2.phpt index 17ac7882c7..fb186ae002 100644 --- a/ext/standard/tests/array/compact_variation2.phpt +++ b/ext/standard/tests/array/compact_variation2.phpt @@ -13,10 +13,10 @@ $a = 'main.a'; $b = 'main.b'; function f() { - $b = 'f.b'; - $c = 'f.c'; - var_dump(compact('a','b','c')); - var_dump(compact(array('a','b','c'))); + $b = 'f.b'; + $c = 'f.c'; + var_dump(compact('a','b','c')); + var_dump(compact(array('a','b','c'))); } f(); diff --git a/ext/standard/tests/array/count_recursive.phpt b/ext/standard/tests/array/count_recursive.phpt index dd5c2342fc..a7d4afb53b 100644 --- a/ext/standard/tests/array/count_recursive.phpt +++ b/ext/standard/tests/array/count_recursive.phpt @@ -31,7 +31,7 @@ print "COUNT_NORMAL: should be 1, is ".count("string")."\n"; print "COUNT_NORMAL: should be 2, is ".count(array("a", array("b")))."\n"; $arr = array('a'=>array(NULL, NULL, NULL), 1=>array(NULL=>1, 1=>NULL), - array(array(array(array(array(NULL)))))); + array(array(array(array(array(NULL)))))); print "-- Testing really cool arrays --\n"; print "COUNT_NORMAL: should be 3, is ".count($arr, COUNT_NORMAL)."\n"; print "COUNT_RECURSIVE: should be 13, is ".count($arr, COUNT_RECURSIVE)."\n"; @@ -47,7 +47,7 @@ $count_array = array( array( 4 => 1, 3 => -2.344, "3" => "string", "2" => NULL, 1 => -2.344, array()), array( TRUE => TRUE, FALSE => FALSE, "" => "", " " => " ", - NULL => NULL, "\x000" => "\x000", "\000" => "\000"), + NULL => NULL, "\x000" => "\x000", "\000" => "\000"), array( NULL, 1.23 => "Hi", "string" => "hello", array("" => "World", "-2.34" => "a", "0" => "b")) ); diff --git a/ext/standard/tests/array/current_variation2.phpt b/ext/standard/tests/array/current_variation2.phpt index 2bbc5dca42..8a6b56d99a 100644 --- a/ext/standard/tests/array/current_variation2.phpt +++ b/ext/standard/tests/array/current_variation2.phpt @@ -39,7 +39,7 @@ $inputs = array( // int data /*1*/ 'int' => array( - 0, + 0, 1, 12345, -2345, diff --git a/ext/standard/tests/array/data.inc b/ext/standard/tests/array/data.inc index bbc8d43c23..c8ad4fe295 100644 --- a/ext/standard/tests/array/data.inc +++ b/ext/standard/tests/array/data.inc @@ -1,13 +1,13 @@ <?php $tmp = pow(2,24); $data = array( - 'PHP', - 17=>'PHP: Hypertext Preprocessor', - 5=>'Test', - 'test'=>27, - 1000=>'test', - "-1000"=>array('banana', 'orange'), - 'monkey', - $tmp=>-1/3 + 'PHP', + 17=>'PHP: Hypertext Preprocessor', + 5=>'Test', + 'test'=>27, + 1000=>'test', + "-1000"=>array('banana', 'orange'), + 'monkey', + $tmp=>-1/3 ); ?> diff --git a/ext/standard/tests/array/extract_typed_ref.phpt b/ext/standard/tests/array/extract_typed_ref.phpt index 8b697d5ccb..6d2a5a9272 100644 --- a/ext/standard/tests/array/extract_typed_ref.phpt +++ b/ext/standard/tests/array/extract_typed_ref.phpt @@ -2,17 +2,17 @@ extract() into typed references must respect their type --FILE-- <?php - + class Test { - public int $i = 0; - public string $s = ""; + public int $i = 0; + public string $s = ""; } $test = new Test; $i =& $test->i; $s =& $test->s; try { - extract(['i' => 'foo', 's' => 42]); + extract(['i' => 'foo', 's' => 42]); } catch (TypeError $e) { echo $e->getMessage(), "\n"; } var_dump($test->i, $test->s); diff --git a/ext/standard/tests/array/extract_variation7.phpt b/ext/standard/tests/array/extract_variation7.phpt index 1502a52380..eb5171bfc7 100644 --- a/ext/standard/tests/array/extract_variation7.phpt +++ b/ext/standard/tests/array/extract_variation7.phpt @@ -9,7 +9,7 @@ $a = array( "1" => "one", "2" => "two", "3" => "three", "4" => "four", "5" => "f var_dump ( extract($a, EXTR_PREFIX_ALL, "same")); $b = array( "f" => "fff", "1" => "one", 4 => 6, "" => "blank", 2.4 => "float", "F" => "FFF", - "blank" => "", 3.7 => 3.7, 5.4 => 7, 6 => 8.6, '5' => "Five", "4name" => "jonny", "a" => NULL, NULL => 3 ); + "blank" => "", 3.7 => 3.7, 5.4 => 7, 6 => 8.6, '5' => "Five", "4name" => "jonny", "a" => NULL, NULL => 3 ); var_dump ( extract($b, EXTR_PREFIX_ALL, "same")); var_dump ( extract($b, EXTR_PREFIX_ALL, "diff")); diff --git a/ext/standard/tests/array/key_variation2.phpt b/ext/standard/tests/array/key_variation2.phpt index 67c7105ec6..3a6022e08a 100644 --- a/ext/standard/tests/array/key_variation2.phpt +++ b/ext/standard/tests/array/key_variation2.phpt @@ -97,8 +97,8 @@ $iterator = 1; foreach($inputs as $key => $input) { echo "\n-- Iteration $iterator : $key data --\n"; while (key($input) !== NULL) { - var_dump(key($input)); - next($input); + var_dump(key($input)); + next($input); } $iterator++; }; diff --git a/ext/standard/tests/array/krsort_basic.phpt b/ext/standard/tests/array/krsort_basic.phpt index 642dfc2070..393b7f06e4 100644 --- a/ext/standard/tests/array/krsort_basic.phpt +++ b/ext/standard/tests/array/krsort_basic.phpt @@ -21,9 +21,9 @@ echo "*** Testing krsort() : basic functionality ***\n"; // an array containing unsorted string values with indices $unsorted_strings = array( "lemon" => "l", "orange" => "o", "banana" => "b" ); $unsorted_strings = array( - "l" => "lemon", "o" => "orange", - "O" => "Orange", "O1" => "Orange1", "o2" => "orange2", "O3" => "Orange3", "o20" => "orange20", - "b" => "banana", + "l" => "lemon", "o" => "orange", + "O" => "Orange", "O1" => "Orange1", "o2" => "orange2", "O3" => "Orange3", "o20" => "orange20", + "b" => "banana", ); // an array containing unsorted numeric values with indices $unsorted_numerics = array( 100 => 4, 33 => 3, 555 => 2, 22 => 1 ); diff --git a/ext/standard/tests/array/ksort_basic.phpt b/ext/standard/tests/array/ksort_basic.phpt index a24674ff33..1a62f3ac2c 100644 --- a/ext/standard/tests/array/ksort_basic.phpt +++ b/ext/standard/tests/array/ksort_basic.phpt @@ -19,9 +19,9 @@ echo "*** Testing ksort() : basic functionality ***\n"; // an array containing unsorted string values with indices $unsorted_strings = array( - "l" => "lemon", "o" => "orange", - "O" => "Orange", "O1" => "Orange1", "o2" => "orange2", "O3" => "Orange3", "o20" => "orange20", - "b" => "banana", + "l" => "lemon", "o" => "orange", + "O" => "Orange", "O1" => "Orange1", "o2" => "orange2", "O3" => "Orange3", "o20" => "orange20", + "b" => "banana", ); // an array containing unsorted numeric values with indices $unsorted_numerics = array( 100 => 4, 33 => 3, 555 => 2, 22 => 1 ); diff --git a/ext/standard/tests/array/natcasesort_object2.phpt b/ext/standard/tests/array/natcasesort_object2.phpt index 3eef437588..b82d0a0b7a 100644 --- a/ext/standard/tests/array/natcasesort_object2.phpt +++ b/ext/standard/tests/array/natcasesort_object2.phpt @@ -17,20 +17,20 @@ echo "*** Testing natcasesort() : object functionality ***\n"; // class declaration for string objects class for_string_natcasesort { - public $public_class_value; - private $private_class_value; - protected $protected_class_value; - // initializing object member value - function __construct($value1, $value2,$value3){ - $this->public_class_value = $value1; - $this->private_class_value = $value2; - $this->protected_class_value = $value3; - } + public $public_class_value; + private $private_class_value; + protected $protected_class_value; + // initializing object member value + function __construct($value1, $value2,$value3){ + $this->public_class_value = $value1; + $this->private_class_value = $value2; + $this->protected_class_value = $value3; + } - // return string value - function __tostring() { - return (string)$this->public_class_value; - } + // return string value + function __tostring() { + return (string)$this->public_class_value; + } } diff --git a/ext/standard/tests/array/natcasesort_variation11.phpt b/ext/standard/tests/array/natcasesort_variation11.phpt index 365600edd7..27e41865f1 100644 --- a/ext/standard/tests/array/natcasesort_variation11.phpt +++ b/ext/standard/tests/array/natcasesort_variation11.phpt @@ -103,10 +103,10 @@ $inputs = array( // loop through each element of $inputs to check the behavior of natcasesort() $iterator = 1; foreach($inputs as $input) { - echo "\n-- Iteration $iterator --\n"; - var_dump( natcasesort($input) ); - var_dump($input); - $iterator++; + echo "\n-- Iteration $iterator --\n"; + var_dump( natcasesort($input) ); + var_dump($input); + $iterator++; }; echo "Done"; diff --git a/ext/standard/tests/array/natcasesort_variation2.phpt b/ext/standard/tests/array/natcasesort_variation2.phpt index ce34db1246..c9dbec1e1f 100644 --- a/ext/standard/tests/array/natcasesort_variation2.phpt +++ b/ext/standard/tests/array/natcasesort_variation2.phpt @@ -39,7 +39,7 @@ $inputs = array( // int data /*1*/ 'int' => array( - 0, + 0, 1, 12345, -2345, @@ -107,10 +107,10 @@ $inputs = array( // loop through each element of $inputs to check the behavior of natcasesort() $iterator = 1; foreach($inputs as $input) { - echo "\n-- Iteration $iterator --\n"; - var_dump( natcasesort($input) ); - var_dump($input); - $iterator++; + echo "\n-- Iteration $iterator --\n"; + var_dump( natcasesort($input) ); + var_dump($input); + $iterator++; }; fclose($fp); diff --git a/ext/standard/tests/array/natcasesort_variation3.phpt b/ext/standard/tests/array/natcasesort_variation3.phpt index c3400f4d65..b2523dc426 100644 --- a/ext/standard/tests/array/natcasesort_variation3.phpt +++ b/ext/standard/tests/array/natcasesort_variation3.phpt @@ -34,9 +34,9 @@ $inputs = array ( $iterator = 1; foreach ($inputs as $array_arg) { - echo "\n-- Iteration $iterator --\n"; - var_dump(natcasesort($array_arg)); - var_dump($array_arg); + echo "\n-- Iteration $iterator --\n"; + var_dump(natcasesort($array_arg)); + var_dump($array_arg); } echo "Done"; diff --git a/ext/standard/tests/array/natcasesort_variation4.phpt b/ext/standard/tests/array/natcasesort_variation4.phpt index b8d4d2c220..452e2e48b2 100644 --- a/ext/standard/tests/array/natcasesort_variation4.phpt +++ b/ext/standard/tests/array/natcasesort_variation4.phpt @@ -14,16 +14,16 @@ Test natcasesort() function : usage variations - different string types echo "*** Testing natcasesort() : usage variation ***\n"; $inputs = array ( - // group of escape sequences - array(null, NULL, "\a", "\cx", "\e", "\f", "\n", "\t", "\xhh", "\ddd", "\v"), + // group of escape sequences + array(null, NULL, "\a", "\cx", "\e", "\f", "\n", "\t", "\xhh", "\ddd", "\v"), - // array contains combination of capital/small letters - array("lemoN", "Orange", "banana", "apple", "Test", "TTTT", "ttt", "ww", "x", "X", "oraNGe", "BANANA") + // array contains combination of capital/small letters + array("lemoN", "Orange", "banana", "apple", "Test", "TTTT", "ttt", "ww", "x", "X", "oraNGe", "BANANA") ); foreach ($inputs as $array_arg) { - var_dump( natcasesort($array_arg) ); - var_dump($array_arg); + var_dump( natcasesort($array_arg) ); + var_dump($array_arg); } echo "Done"; diff --git a/ext/standard/tests/array/prev_error2.phpt b/ext/standard/tests/array/prev_error2.phpt index 37049cf854..45d2930ad7 100644 --- a/ext/standard/tests/array/prev_error2.phpt +++ b/ext/standard/tests/array/prev_error2.phpt @@ -12,8 +12,8 @@ prev - ensure warning is received when passing an indirect temporary. */ function f() { - $array = array(1,2); - end($array); + $array = array(1,2); + end($array); return $array; } diff --git a/ext/standard/tests/array/rsort_basic.phpt b/ext/standard/tests/array/rsort_basic.phpt index 9d82ea5c94..76123b7c02 100644 --- a/ext/standard/tests/array/rsort_basic.phpt +++ b/ext/standard/tests/array/rsort_basic.phpt @@ -15,9 +15,9 @@ echo "*** Testing rsort() : basic functionality ***\n"; // associative array containing unsorted string values $unsorted_strings = array( - "l" => "lemon", "o" => "orange", - "O" => "Orange", "O1" => "Orange1", "o2" => "orange2", "O3" => "Orange3", "o20" => "orange20", - "b" => "banana", + "l" => "lemon", "o" => "orange", + "O" => "Orange", "O1" => "Orange1", "o2" => "orange2", "O3" => "Orange3", "o20" => "orange20", + "b" => "banana", ); // array with default keys containing unsorted numeric values diff --git a/ext/standard/tests/array/rsort_object1.phpt b/ext/standard/tests/array/rsort_object1.phpt index fdbdaedb7b..df7ca491ff 100644 --- a/ext/standard/tests/array/rsort_object1.phpt +++ b/ext/standard/tests/array/rsort_object1.phpt @@ -16,27 +16,27 @@ echo "*** Testing rsort() : object functionality ***\n"; // class declaration for integer objects class for_integer_rsort { - public $class_value; - // initializing object member value - function __construct($value){ - $this->class_value = $value; - } + public $class_value; + // initializing object member value + function __construct($value){ + $this->class_value = $value; + } } // class declaration for string objects class for_string_rsort { - public $class_value; - // initializing object member value - function __construct($value){ - $this->class_value = $value; - } - - // return string value - function __tostring() { - return (string)$this->value; - } + public $class_value; + // initializing object member value + function __construct($value){ + $this->class_value = $value; + } + + // return string value + function __tostring() { + return (string)$this->value; + } } diff --git a/ext/standard/tests/array/rsort_object2.phpt b/ext/standard/tests/array/rsort_object2.phpt index 5f2eba168e..21789ba026 100644 --- a/ext/standard/tests/array/rsort_object2.phpt +++ b/ext/standard/tests/array/rsort_object2.phpt @@ -16,36 +16,36 @@ echo "*** Testing rsort() : object functionality ***\n"; // class declaration for integer objects class for_integer_rsort { - public $public_class_value; - private $private_class_value; - protected $protected_class_value; + public $public_class_value; + private $private_class_value; + protected $protected_class_value; - // initializing object member value - function __construct($value1, $value2,$value3){ - $this->public_class_value = $value1; - $this->private_class_value = $value2; - $this->protected_class_value = $value3; - } + // initializing object member value + function __construct($value1, $value2,$value3){ + $this->public_class_value = $value1; + $this->private_class_value = $value2; + $this->protected_class_value = $value3; + } } // class declaration for string objects class for_string_rsort { - public $public_class_value; - private $private_class_value; - protected $protected_class_value; - // initializing object member value - function __construct($value1, $value2,$value3){ - $this->public_class_value = $value1; - $this->private_class_value = $value2; - $this->protected_class_value = $value3; - } + public $public_class_value; + private $private_class_value; + protected $protected_class_value; + // initializing object member value + function __construct($value1, $value2,$value3){ + $this->public_class_value = $value1; + $this->private_class_value = $value2; + $this->protected_class_value = $value3; + } - // return string value - function __tostring() { - return (string)$this->value; - } + // return string value + function __tostring() { + return (string)$this->value; + } } diff --git a/ext/standard/tests/array/rsort_variation5.phpt b/ext/standard/tests/array/rsort_variation5.phpt index 44a8b2b473..20d061f4c4 100644 --- a/ext/standard/tests/array/rsort_variation5.phpt +++ b/ext/standard/tests/array/rsort_variation5.phpt @@ -26,22 +26,22 @@ $flags = array("SORT_REGULAR" => SORT_REGULAR, "SORT_STRING" => SORT_STRING); $count = 1; // loop through to test rsort() with different arrays foreach ($various_arrays as $array) { - echo "\n-- Iteration $count --\n"; + echo "\n-- Iteration $count --\n"; - echo "- With Default sort flag -\n"; - $temp_array = $array; - var_dump(rsort($temp_array) ); - var_dump($temp_array); + echo "- With Default sort flag -\n"; + $temp_array = $array; + var_dump(rsort($temp_array) ); + var_dump($temp_array); - // loop through $flags array and setting all possible flag values - foreach($flags as $key => $flag){ - echo "- Sort flag = $key -\n"; + // loop through $flags array and setting all possible flag values + foreach($flags as $key => $flag){ + echo "- Sort flag = $key -\n"; - $temp_array = $array; - var_dump(rsort($temp_array, $flag) ); - var_dump($temp_array); - } - $count++; + $temp_array = $array; + var_dump(rsort($temp_array, $flag) ); + var_dump($temp_array); + } + $count++; } echo "Done"; diff --git a/ext/standard/tests/array/rsort_variation9.phpt b/ext/standard/tests/array/rsort_variation9.phpt index d3b44ec0bb..93cdff2228 100644 --- a/ext/standard/tests/array/rsort_variation9.phpt +++ b/ext/standard/tests/array/rsort_variation9.phpt @@ -15,22 +15,22 @@ echo "*** Testing rsort() : variation ***\n"; // Associative arrays $various_arrays = array( - // numeric assoc. only array - array(5 => 55, 6 => 66, 2 => 22, 3 => 33, 1 => 11), + // numeric assoc. only array + array(5 => 55, 6 => 66, 2 => 22, 3 => 33, 1 => 11), - // two-dimensional assoc. and default key array - array("fruits" => array("a" => "orange", "b" => "banana", "c" => "apple"), - "numbers" => array(1, 2, 3, 4, 5, 6), - "holes" => array("first", 5 => "second", "third")), + // two-dimensional assoc. and default key array + array("fruits" => array("a" => "orange", "b" => "banana", "c" => "apple"), + "numbers" => array(1, 2, 3, 4, 5, 6), + "holes" => array("first", 5 => "second", "third")), - // numeric assoc. and default key array - array(1, 1, 8 => 1, 4 => 1, 19, 3 => 13), + // numeric assoc. and default key array + array(1, 1, 8 => 1, 4 => 1, 19, 3 => 13), - // mixed assoc. array - array('bar' => 'baz', "foo" => 1), + // mixed assoc. array + array('bar' => 'baz', "foo" => 1), - // assoc. only multi-dimensional array - array('a' => 1,'b' => array('e' => 2,'f' => 3),'c' => array('g' => 4),'d' => 5), + // assoc. only multi-dimensional array + array('a' => 1,'b' => array('e' => 2,'f' => 3),'c' => array('g' => 4),'d' => 5), ); $count = 1; diff --git a/ext/standard/tests/array/sort_basic.phpt b/ext/standard/tests/array/sort_basic.phpt index e409ac3d33..451fd5788f 100644 --- a/ext/standard/tests/array/sort_basic.phpt +++ b/ext/standard/tests/array/sort_basic.phpt @@ -21,9 +21,9 @@ echo "*** Testing sort() : basic functionality ***\n"; // associative array containing unsorted string values $unsorted_strings = array( - "l" => "lemon", "o" => "orange", - "O" => "Orange", "O1" => "Orange1", "o2" => "orange2", "O3" => "Orange3", "o20" => "orange20", - "b" => "banana", + "l" => "lemon", "o" => "orange", + "O" => "Orange", "O1" => "Orange1", "o2" => "orange2", "O3" => "Orange3", "o20" => "orange20", + "b" => "banana", ); // array with default keys containing unsorted numeric values diff --git a/ext/standard/tests/array/usort_object1.phpt b/ext/standard/tests/array/usort_object1.phpt index c1e20b181c..b1002a53e4 100644 --- a/ext/standard/tests/array/usort_object1.phpt +++ b/ext/standard/tests/array/usort_object1.phpt @@ -16,51 +16,51 @@ echo "*** Testing usort() : object functionality ***\n"; function simple_cmp($value1, $value2) { - if($value1 == $value2) { - return 0; - } - else if($value1 > $value2) { - return 1; - } - else - return -1; + if($value1 == $value2) { + return 0; + } + else if($value1 > $value2) { + return 1; + } + else + return -1; } // comparison function for SimpleClass2 objects which has more than one member function multiple_cmp($value1, $value2) { - if($value1->getValue() == $value2->getValue()) - return 0; - else if($value1->getValue() > $value2->getValue()) - return 1; - else - return -1; + if($value1->getValue() == $value2->getValue()) + return 0; + else if($value1->getValue() > $value2->getValue()) + return 1; + else + return -1; } // Simple class with single property class SimpleClass1 { - private $int_value; + private $int_value; - public function __construct($value) { - $this->int_value = $value; - } + public function __construct($value) { + $this->int_value = $value; + } } // Simple class with more than one property class SimpleClass2 { - private $int_value; - protected $float_value; - public $string_value; - public function __construct($int, $float, $str) { - $this->int_value = $int; - $this->float_value = $float; - $this->string_value = $str; - } - public function getValue() { - return $this->int_value; - } + private $int_value; + protected $float_value; + public $string_value; + public function __construct($int, $float, $str) { + $this->int_value = $int; + $this->float_value = $float; + $this->string_value = $str; + } + public function getValue() { + return $this->int_value; + } } // array of SimpleClass objects with only one property diff --git a/ext/standard/tests/array/usort_variation11.phpt b/ext/standard/tests/array/usort_variation11.phpt index b6cdeef766..d07dfb48e0 100644 --- a/ext/standard/tests/array/usort_variation11.phpt +++ b/ext/standard/tests/array/usort_variation11.phpt @@ -4,20 +4,20 @@ Test usort() function : usage variations - binary return cmp <?php function ucmp($a, $b) { - return $a > $b; + return $a > $b; } $range = array(2, 4, 8, 16, 32, 64, 128); foreach ($range as $r) { - $backup = $array = range(0, $r); - shuffle($array); - usort($array, "ucmp"); - if ($array != $backup) { - var_dump($array); - var_dump($backup); - die("Whatever sorting algo you used, this test should never be broken"); - } + $backup = $array = range(0, $r); + shuffle($array); + usort($array, "ucmp"); + if ($array != $backup) { + var_dump($array); + var_dump($backup); + die("Whatever sorting algo you used, this test should never be broken"); + } } echo "okey"; ?> diff --git a/ext/standard/tests/array/var_export3.phpt b/ext/standard/tests/array/var_export3.phpt index 6d39946916..e7d3c851f2 100644 --- a/ext/standard/tests/array/var_export3.phpt +++ b/ext/standard/tests/array/var_export3.phpt @@ -3,14 +3,14 @@ var_export() and classes --FILE-- <?php class kake { - public $mann; - protected $kvinne; + public $mann; + protected $kvinne; - function __construct() - { - $this->mann = 42; - $this->kvinne = 43; - } + function __construct() + { + $this->mann = 42; + $this->kvinne = 43; + } } $kake = new kake; diff --git a/ext/standard/tests/assert/assert.phpt b/ext/standard/tests/assert/assert.phpt index 71b0649141..7935b7c8fd 100644 --- a/ext/standard/tests/assert/assert.phpt +++ b/ext/standard/tests/assert/assert.phpt @@ -9,15 +9,15 @@ assert.bail = 0 <?php function a($file, $line, $unused, $desc) { - echo "assertion failed $line,\"$desc\"\n"; + echo "assertion failed $line,\"$desc\"\n"; } class a { - static function assert($file, $line, $unused, $desc) - { - echo "class assertion failed $line,\"$desc\"\n"; - } + static function assert($file, $line, $unused, $desc) + { + echo "class assertion failed $line,\"$desc\"\n"; + } } assert_options(ASSERT_ACTIVE,1); diff --git a/ext/standard/tests/assert/assert03.phpt b/ext/standard/tests/assert/assert03.phpt index a15e936af3..4428790fa2 100644 --- a/ext/standard/tests/assert/assert03.phpt +++ b/ext/standard/tests/assert/assert03.phpt @@ -9,12 +9,12 @@ assert.bail = 0 <?php function a($file, $line, $unused, $desc) { - echo "assertion failed - a - $line,\"$desc\"\n"; + echo "assertion failed - a - $line,\"$desc\"\n"; } function b($file, $line, $unused, $desc) { - echo "assertion failed - b - $line,\"$desc\"\n"; + echo "assertion failed - b - $line,\"$desc\"\n"; } assert_options(ASSERT_ACTIVE,1); diff --git a/ext/standard/tests/assert/assert_basic.phpt b/ext/standard/tests/assert/assert_basic.phpt index ce53a17a61..dbf15c1998 100644 --- a/ext/standard/tests/assert/assert_basic.phpt +++ b/ext/standard/tests/assert/assert_basic.phpt @@ -9,7 +9,7 @@ assert.bail = 0 <?php function f1() { - echo "f1 called\n"; + echo "f1 called\n"; } var_dump($r2 = assert(0)); diff --git a/ext/standard/tests/assert/assert_basic1.phpt b/ext/standard/tests/assert/assert_basic1.phpt index cd4a5601ab..5961811468 100644 --- a/ext/standard/tests/assert/assert_basic1.phpt +++ b/ext/standard/tests/assert/assert_basic1.phpt @@ -9,7 +9,7 @@ assert.bail = 0 <?php function f1() { - echo "f1 called\n"; + echo "f1 called\n"; } var_dump($r2=assert(0)); diff --git a/ext/standard/tests/assert/assert_basic2.phpt b/ext/standard/tests/assert/assert_basic2.phpt index 052e7d4e89..9d768e0d36 100644 --- a/ext/standard/tests/assert/assert_basic2.phpt +++ b/ext/standard/tests/assert/assert_basic2.phpt @@ -9,12 +9,12 @@ assert.bail = 0 <?php function f2() { - echo "f2 called\n"; + echo "f2 called\n"; } function f1() { - echo "f1 called\n"; + echo "f1 called\n"; } var_dump($o = assert_options(ASSERT_CALLBACK)); diff --git a/ext/standard/tests/assert/assert_basic3.phpt b/ext/standard/tests/assert/assert_basic3.phpt index 87103cbfbb..8374eff951 100644 --- a/ext/standard/tests/assert/assert_basic3.phpt +++ b/ext/standard/tests/assert/assert_basic3.phpt @@ -9,7 +9,7 @@ assert.bail = 0 <?php function f1() { - echo "f1 called\n"; + echo "f1 called\n"; } //bail out on error diff --git a/ext/standard/tests/assert/assert_basic5.phpt b/ext/standard/tests/assert/assert_basic5.phpt index cf2ed6ded3..98053c7313 100644 --- a/ext/standard/tests/assert/assert_basic5.phpt +++ b/ext/standard/tests/assert/assert_basic5.phpt @@ -9,7 +9,7 @@ assert.bail = 0 <?php function f1() { - echo "f1 called\n"; + echo "f1 called\n"; } //switch warning on and test return value diff --git a/ext/standard/tests/assert/assert_error2.phpt b/ext/standard/tests/assert/assert_error2.phpt index de00743b1b..027bd03067 100644 --- a/ext/standard/tests/assert/assert_error2.phpt +++ b/ext/standard/tests/assert/assert_error2.phpt @@ -11,7 +11,7 @@ display_errors = 1 <?php function f1($script, $line, $message, $user_message) { - echo "f1 called\n"; + echo "f1 called\n"; } //bail out on error diff --git a/ext/standard/tests/assert/assert_variation.phpt b/ext/standard/tests/assert/assert_variation.phpt index d0cb90ff66..a28ea58d5a 100644 --- a/ext/standard/tests/assert/assert_variation.phpt +++ b/ext/standard/tests/assert/assert_variation.phpt @@ -9,22 +9,22 @@ assert.bail = 0 <?php function f1() { - echo "f1 called\n"; + echo "f1 called\n"; } function f2() { - echo "f2 called\n"; + echo "f2 called\n"; } function f3() { - echo "f3 called\n"; + echo "f3 called\n"; } class c1 { - static function assert($file, $line, $unused, $desc) - { - echo "Class assertion failed $line, \"$desc\"\n"; - } + static function assert($file, $line, $unused, $desc) + { + echo "Class assertion failed $line, \"$desc\"\n"; + } } echo "Initial values: assert_options(ASSERT_CALLBACK) => [".assert_options(ASSERT_CALLBACK)."]\n"; echo "Initial values: ini.get(\"assert.callback\") => [".ini_get("assert.callback")."]\n"; diff --git a/ext/standard/tests/bug49244.phpt b/ext/standard/tests/bug49244.phpt index 60942966a7..a50aacee8d 100644 --- a/ext/standard/tests/bug49244.phpt +++ b/ext/standard/tests/bug49244.phpt @@ -4,8 +4,8 @@ Bug #49244 (Floating point NaN cause garbage characters) <?php for ($i = 0; $i < 10; $i++) { - printf("{%f} %1\$f\n", pow(-1.0, 0.3)); - printf("{%f} %1\$f\n", pow(-1.0, 0.3)); + printf("{%f} %1\$f\n", pow(-1.0, 0.3)); + printf("{%f} %1\$f\n", pow(-1.0, 0.3)); } ?> diff --git a/ext/standard/tests/bug64370_var2.phpt b/ext/standard/tests/bug64370_var2.phpt index 3618a46980..601f8b93e0 100644 --- a/ext/standard/tests/bug64370_var2.phpt +++ b/ext/standard/tests/bug64370_var2.phpt @@ -5,15 +5,15 @@ Test bug #64370 sequential microtime(true) calls $i = 0; while(100000 > $i++) { - $m0 = microtime(true); - $m1 = microtime(true); - $d = $m1 - $m0; + $m0 = microtime(true); + $m1 = microtime(true); + $d = $m1 - $m0; - /*echo "$d\n";*/ + /*echo "$d\n";*/ - if ($d < 0) { - die("failed in {$i}th iteration"); - } + if ($d < 0) { + die("failed in {$i}th iteration"); + } } echo "ok\n"; ?> diff --git a/ext/standard/tests/bug75220.phpt b/ext/standard/tests/bug75220.phpt index ca6c3ef4ea..f0ba55a702 100644 --- a/ext/standard/tests/bug75220.phpt +++ b/ext/standard/tests/bug75220.phpt @@ -9,16 +9,16 @@ $a->bar('foo'); class B {}; class A extends B { - function bar($func) - { - var_dump('foo'); - var_dump(is_callable('parent::foo')); - var_dump(is_callable(array('parent', 'foo'))); - } + function bar($func) + { + var_dump('foo'); + var_dump(is_callable('parent::foo')); + var_dump(is_callable(array('parent', 'foo'))); + } - function __call($func, $args) - { - } + function __call($func, $args) + { + } }; ?> diff --git a/ext/standard/tests/class_object/bug71442.phpt b/ext/standard/tests/class_object/bug71442.phpt index d6b3d6699b..27a025c4e4 100644 --- a/ext/standard/tests/class_object/bug71442.phpt +++ b/ext/standard/tests/class_object/bug71442.phpt @@ -5,29 +5,29 @@ Bug #71442 (forward_static_call crash) class A { - const NAME = 'A'; - public static function test() { - $args = func_get_args(); - echo static::NAME, " ".join(',', $args)." \n"; - } + const NAME = 'A'; + public static function test() { + $args = func_get_args(); + echo static::NAME, " ".join(',', $args)." \n"; + } } class B extends A { - const NAME = 'B'; + const NAME = 'B'; - public static function test() { - echo self::NAME, "\n"; - forward_static_call(array('A', 'test'), 'more', 'args'); - forward_static_call( 'test', 'other', 'args'); - } + public static function test() { + echo self::NAME, "\n"; + forward_static_call(array('A', 'test'), 'more', 'args'); + forward_static_call( 'test', 'other', 'args'); + } } B::test('foo'); function test() { - $args = func_get_args(); - echo "C ".join(',', $args)." \n"; + $args = func_get_args(); + echo "C ".join(',', $args)." \n"; } ?> diff --git a/ext/standard/tests/class_object/class_exists_basic_001.phpt b/ext/standard/tests/class_object/class_exists_basic_001.phpt index b95efecd65..9192ea80b7 100644 --- a/ext/standard/tests/class_object/class_exists_basic_001.phpt +++ b/ext/standard/tests/class_object/class_exists_basic_001.phpt @@ -11,7 +11,7 @@ Test class_exists() function : basic functionality echo "*** Testing class_exists() : basic functionality ***\n"; spl_autoload_register(function ($className) { - echo "In autoload($className)\n"; + echo "In autoload($className)\n"; }); echo "Calling class_exists() on non-existent class with autoload explicitly enabled:\n"; diff --git a/ext/standard/tests/class_object/forward_static_call_001.phpt b/ext/standard/tests/class_object/forward_static_call_001.phpt index 0eadad3d79..30459f0c43 100644 --- a/ext/standard/tests/class_object/forward_static_call_001.phpt +++ b/ext/standard/tests/class_object/forward_static_call_001.phpt @@ -5,41 +5,41 @@ forward_static_call() called from outside of a method. class A { - const NAME = 'A'; - public static function test() { - echo static::NAME, "\n"; - } + const NAME = 'A'; + public static function test() { + echo static::NAME, "\n"; + } } class B extends A { - const NAME = 'B'; + const NAME = 'B'; - public static function test() { - echo self::NAME, "\n"; - forward_static_call(array('parent', 'test')); - } + public static function test() { + echo self::NAME, "\n"; + forward_static_call(array('parent', 'test')); + } - public static function test2() { - echo self::NAME, "\n"; - forward_static_call(array('self', 'test')); - } + public static function test2() { + echo self::NAME, "\n"; + forward_static_call(array('self', 'test')); + } - public static function test3() { - echo self::NAME, "\n"; - forward_static_call(array('A', 'test')); - } + public static function test3() { + echo self::NAME, "\n"; + forward_static_call(array('A', 'test')); + } } class C extends B { - const NAME = 'C'; + const NAME = 'C'; - public static function test() - { - echo self::NAME, "\n"; - forward_static_call(array('A', 'test')); - } + public static function test() + { + echo self::NAME, "\n"; + forward_static_call(array('A', 'test')); + } } A::test(); diff --git a/ext/standard/tests/class_object/forward_static_call_002.phpt b/ext/standard/tests/class_object/forward_static_call_002.phpt index 64406feb3e..7bc0092321 100644 --- a/ext/standard/tests/class_object/forward_static_call_002.phpt +++ b/ext/standard/tests/class_object/forward_static_call_002.phpt @@ -5,13 +5,13 @@ forward_static_call() from outside of a class method. class A { - public static function test() { - echo "A\n"; - } + public static function test() { + echo "A\n"; + } } function test() { - forward_static_call(array('A', 'test')); + forward_static_call(array('A', 'test')); } test(); diff --git a/ext/standard/tests/class_object/forward_static_call_003.phpt b/ext/standard/tests/class_object/forward_static_call_003.phpt index 8a846fe3da..c2c0035f6b 100644 --- a/ext/standard/tests/class_object/forward_static_call_003.phpt +++ b/ext/standard/tests/class_object/forward_static_call_003.phpt @@ -5,30 +5,30 @@ forward_static_call() calling outside of the inheritance chain. class A { - const NAME = 'A'; - public static function test() { - echo static::NAME, "\n"; - } + const NAME = 'A'; + public static function test() { + echo static::NAME, "\n"; + } } class B extends A { - const NAME = 'B'; + const NAME = 'B'; - public static function test() { - echo self::NAME, "\n"; - forward_static_call(array('parent', 'test')); - } + public static function test() { + echo self::NAME, "\n"; + forward_static_call(array('parent', 'test')); + } } class C { - const NAME = 'C'; + const NAME = 'C'; - public static function test() { - echo self::NAME, "\n"; - forward_static_call(array('B', 'test')); - } + public static function test() { + echo self::NAME, "\n"; + forward_static_call(array('B', 'test')); + } } A::test(); diff --git a/ext/standard/tests/class_object/get_class_methods_basic_001.phpt b/ext/standard/tests/class_object/get_class_methods_basic_001.phpt index 843e9f1a53..4c091da565 100644 --- a/ext/standard/tests/class_object/get_class_methods_basic_001.phpt +++ b/ext/standard/tests/class_object/get_class_methods_basic_001.phpt @@ -15,9 +15,9 @@ Test get_class_methods() function : basic functionality echo "*** Testing get_class_methods() : basic functionality ***\n"; class C { - function f() {} - function g() {} - function h() {} + function f() {} + function g() {} + function h() {} } echo "Argument is class name:\n"; diff --git a/ext/standard/tests/class_object/get_class_methods_basic_002.phpt b/ext/standard/tests/class_object/get_class_methods_basic_002.phpt index 8a11eba589..59d8606d8d 100644 --- a/ext/standard/tests/class_object/get_class_methods_basic_002.phpt +++ b/ext/standard/tests/class_object/get_class_methods_basic_002.phpt @@ -13,48 +13,48 @@ Test get_class_methods() function : basic functionality */ class C { - private function privC() {} - protected function protC() {} - public function pubC() {} + private function privC() {} + protected function protC() {} + public function pubC() {} - public static function testFromC() { - echo "Accessing C from C:\n"; - var_dump(get_class_methods("C")); - echo "Accessing D from C:\n"; - var_dump(get_class_methods("D")); - echo "Accessing X from C:\n"; - var_dump(get_class_methods("X")); - } + public static function testFromC() { + echo "Accessing C from C:\n"; + var_dump(get_class_methods("C")); + echo "Accessing D from C:\n"; + var_dump(get_class_methods("D")); + echo "Accessing X from C:\n"; + var_dump(get_class_methods("X")); + } } class D extends C { - private function privD() {} - protected function protD() {} - public function pubD() {} + private function privD() {} + protected function protD() {} + public function pubD() {} - public static function testFromD() { - echo "Accessing C from D:\n"; - var_dump(get_class_methods("C")); - echo "Accessing D from D:\n"; - var_dump(get_class_methods("D")); - echo "Accessing X from D:\n"; - var_dump(get_class_methods("X")); - } + public static function testFromD() { + echo "Accessing C from D:\n"; + var_dump(get_class_methods("C")); + echo "Accessing D from D:\n"; + var_dump(get_class_methods("D")); + echo "Accessing X from D:\n"; + var_dump(get_class_methods("X")); + } } class X { - private function privX() {} - protected function protX() {} - public function pubX() {} + private function privX() {} + protected function protX() {} + public function pubX() {} - public static function testFromX() { - echo "Accessing C from X:\n"; - var_dump(get_class_methods("C")); - echo "Accessing D from X:\n"; - var_dump(get_class_methods("D")); - echo "Accessing X from X:\n"; - var_dump(get_class_methods("X")); - } + public static function testFromX() { + echo "Accessing C from X:\n"; + var_dump(get_class_methods("C")); + echo "Accessing D from X:\n"; + var_dump(get_class_methods("D")); + echo "Accessing X from X:\n"; + var_dump(get_class_methods("X")); + } } echo "Accessing D from global scope:\n"; diff --git a/ext/standard/tests/class_object/get_class_methods_basic_003.phpt b/ext/standard/tests/class_object/get_class_methods_basic_003.phpt index c7662f8605..e15d962b16 100644 --- a/ext/standard/tests/class_object/get_class_methods_basic_003.phpt +++ b/ext/standard/tests/class_object/get_class_methods_basic_003.phpt @@ -13,23 +13,23 @@ Test get_class_methods() function : basic functionality */ interface I { - public function pubI(); + public function pubI(); } class C implements I { - public function pubI() {} + public function pubI() {} - private function privC() {} - protected function protC() {} - public function pubC() {} + private function privC() {} + protected function protC() {} + public function pubC() {} - public static function testFromC() { - echo "Accessing I from C:\n"; - var_dump(get_class_methods("I")); - echo "Accessing C from C:\n"; - var_dump(get_class_methods("C")); - } + public static function testFromC() { + echo "Accessing I from C:\n"; + var_dump(get_class_methods("I")); + echo "Accessing C from C:\n"; + var_dump(get_class_methods("C")); + } } diff --git a/ext/standard/tests/class_object/get_class_methods_variation_001.phpt b/ext/standard/tests/class_object/get_class_methods_variation_001.phpt index 2e2e1657af..e44a3d1fd9 100644 --- a/ext/standard/tests/class_object/get_class_methods_variation_001.phpt +++ b/ext/standard/tests/class_object/get_class_methods_variation_001.phpt @@ -10,7 +10,7 @@ Test get_class_methods() function : usage variations - unexpected types function test_error_handler($err_no, $err_msg, $filename, $linenum) { - echo "Error: $err_no - $err_msg\n"; + echo "Error: $err_no - $err_msg\n"; } set_error_handler('test_error_handler'); diff --git a/ext/standard/tests/class_object/get_class_methods_variation_002.phpt b/ext/standard/tests/class_object/get_class_methods_variation_002.phpt index 23416234f9..449df8845c 100644 --- a/ext/standard/tests/class_object/get_class_methods_variation_002.phpt +++ b/ext/standard/tests/class_object/get_class_methods_variation_002.phpt @@ -11,7 +11,7 @@ Test get_class_methods() function : usage variations - case sensitivity echo "*** Testing get_class_methods() : usage variations ***\n"; class caseSensitivityTest { - function MyMeThOd() {} + function MyMeThOd() {} } var_dump( get_class_methods('CasesensitivitytesT') ); diff --git a/ext/standard/tests/class_object/get_declared_classes_basic_001.phpt b/ext/standard/tests/class_object/get_declared_classes_basic_001.phpt index 78d27fa3a5..519f8beae0 100644 --- a/ext/standard/tests/class_object/get_declared_classes_basic_001.phpt +++ b/ext/standard/tests/class_object/get_declared_classes_basic_001.phpt @@ -16,9 +16,9 @@ echo "\n-- Testing get_declared_classes() function with Zero arguments --\n"; var_dump(get_declared_classes()); foreach (get_declared_classes() as $class) { - if (!class_exists($class)) { - echo "Error: $class is not a valid class.\n"; - } + if (!class_exists($class)) { + echo "Error: $class is not a valid class.\n"; + } } echo "\n-- Ensure userspace classes are listed --\n"; diff --git a/ext/standard/tests/class_object/get_declared_interfaces_basic_001.phpt b/ext/standard/tests/class_object/get_declared_interfaces_basic_001.phpt index 749ee69ab7..d328a02a03 100644 --- a/ext/standard/tests/class_object/get_declared_interfaces_basic_001.phpt +++ b/ext/standard/tests/class_object/get_declared_interfaces_basic_001.phpt @@ -16,9 +16,9 @@ echo "\n-- Testing get_declared_interfaces() function with Zero arguments --\n"; var_dump(get_declared_interfaces()); foreach (get_declared_interfaces() as $interface) { - if (!interface_exists($interface)) { - echo "Error: $interface is not a valid interface.\n"; - } + if (!interface_exists($interface)) { + echo "Error: $interface is not a valid interface.\n"; + } } echo "\n-- Ensure userspace classes are not listed --\n"; diff --git a/ext/standard/tests/class_object/get_declared_traits_basic_001.phpt b/ext/standard/tests/class_object/get_declared_traits_basic_001.phpt index 8ce2d2df56..2ca0ce00ca 100644 --- a/ext/standard/tests/class_object/get_declared_traits_basic_001.phpt +++ b/ext/standard/tests/class_object/get_declared_traits_basic_001.phpt @@ -18,9 +18,9 @@ echo "\n-- Testing get_declared_traits() function with Zero arguments --\n"; var_dump(get_declared_traits()); foreach (get_declared_traits() as $trait) { - if (!trait_exists($trait)) { - echo "Error: $trait is not a valid trait.\n"; - } + if (!trait_exists($trait)) { + echo "Error: $trait is not a valid trait.\n"; + } } echo "\n-- Ensure trait is listed --\n"; diff --git a/ext/standard/tests/class_object/get_object_vars_basic_001.phpt b/ext/standard/tests/class_object/get_object_vars_basic_001.phpt index 253ebd2be4..1133202cbf 100644 --- a/ext/standard/tests/class_object/get_object_vars_basic_001.phpt +++ b/ext/standard/tests/class_object/get_object_vars_basic_001.phpt @@ -9,40 +9,40 @@ get_object_vars(): visibility from static methods (target object passed as arg) */ Class A { - private $hiddenPriv = 'A::hiddenPriv'; + private $hiddenPriv = 'A::hiddenPriv'; - public static function test($b) { - echo __METHOD__ . "\n"; - var_dump(get_object_vars($b)); - } + public static function test($b) { + echo __METHOD__ . "\n"; + var_dump(get_object_vars($b)); + } } Class B extends A { - private $hiddenPriv = 'B::hiddenPriv'; - private $priv = 'B::priv'; - protected $prot = 'B::prot'; - public $pub = 'B::pub'; + private $hiddenPriv = 'B::hiddenPriv'; + private $priv = 'B::priv'; + protected $prot = 'B::prot'; + public $pub = 'B::pub'; - public static function test($b) { - echo __METHOD__ . "\n"; - var_dump(get_object_vars($b)); - } + public static function test($b) { + echo __METHOD__ . "\n"; + var_dump(get_object_vars($b)); + } } Class C extends B { - private $hiddenPriv = 'C::hiddenPriv'; + private $hiddenPriv = 'C::hiddenPriv'; - public static function test($b) { - echo __METHOD__ . "\n"; - var_dump(get_object_vars($b)); - } + public static function test($b) { + echo __METHOD__ . "\n"; + var_dump(get_object_vars($b)); + } } Class X { - public static function test($b) { - echo __METHOD__ . "\n"; - var_dump(get_object_vars($b)); - } + public static function test($b) { + echo __METHOD__ . "\n"; + var_dump(get_object_vars($b)); + } } diff --git a/ext/standard/tests/class_object/get_object_vars_basic_002.phpt b/ext/standard/tests/class_object/get_object_vars_basic_002.phpt index 41a1758baa..ff0664ea46 100644 --- a/ext/standard/tests/class_object/get_object_vars_basic_002.phpt +++ b/ext/standard/tests/class_object/get_object_vars_basic_002.phpt @@ -9,24 +9,24 @@ get_object_vars(): visibility from non static methods (target object passed as a */ Class A { - private $hiddenPriv = 'A::hiddenPriv'; + private $hiddenPriv = 'A::hiddenPriv'; - public function testA($b) { - echo __METHOD__ . "\n"; - var_dump(get_object_vars($b)); - } + public function testA($b) { + echo __METHOD__ . "\n"; + var_dump(get_object_vars($b)); + } } Class B extends A { - private $hiddenPriv = 'B::hiddenPriv'; - private $priv = 'B::priv'; - protected $prot = 'B::prot'; - public $pub = 'B::pub'; - - public function testB($b) { - echo __METHOD__ . "\n"; - var_dump(get_object_vars($b)); - } + private $hiddenPriv = 'B::hiddenPriv'; + private $priv = 'B::priv'; + protected $prot = 'B::prot'; + public $pub = 'B::pub'; + + public function testB($b) { + echo __METHOD__ . "\n"; + var_dump(get_object_vars($b)); + } } diff --git a/ext/standard/tests/class_object/get_object_vars_variation_001.phpt b/ext/standard/tests/class_object/get_object_vars_variation_001.phpt index 2a310227a5..0cc7d492c8 100644 --- a/ext/standard/tests/class_object/get_object_vars_variation_001.phpt +++ b/ext/standard/tests/class_object/get_object_vars_variation_001.phpt @@ -9,7 +9,7 @@ get_object_vars() - ensure statics are not shown */ Class A { - public static $var = 'hello'; + public static $var = 'hello'; } $a = new A; diff --git a/ext/standard/tests/class_object/get_parent_class_variation_002.phpt b/ext/standard/tests/class_object/get_parent_class_variation_002.phpt index 2aaa93fa8a..d564ad3cd0 100644 --- a/ext/standard/tests/class_object/get_parent_class_variation_002.phpt +++ b/ext/standard/tests/class_object/get_parent_class_variation_002.phpt @@ -9,11 +9,11 @@ Test get_parent_class() function : usage variations - unexpected argument type. */ spl_autoload_register(function ($className) { - echo "In autoload($className)\n"; + echo "In autoload($className)\n"; }); function test_error_handler($err_no, $err_msg, $filename, $linenum) { - echo "Error: $err_no - $err_msg\n"; + echo "Error: $err_no - $err_msg\n"; } set_error_handler('test_error_handler'); diff --git a/ext/standard/tests/class_object/is_a.phpt b/ext/standard/tests/class_object/is_a.phpt index 92d289ba18..efb03b3434 100644 --- a/ext/standard/tests/class_object/is_a.phpt +++ b/ext/standard/tests/class_object/is_a.phpt @@ -4,51 +4,51 @@ is_a and is_subclass_of behaviour (with and without autoload) <?php interface if_a { - function f_a(); + function f_a(); } interface if_b extends if_a { - function f_b(); + 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"; - } + 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() {} + function f_a() {} } class derived_b extends base implements if_a, if_b { - function f_a() {} - function f_b() {} + function f_a() {} + function f_b() {} } class derived_c extends derived_a implements if_b { - function f_b() {} + function f_b() {} } class derived_d extends derived_c { diff --git a/ext/standard/tests/class_object/is_subclass_of_variation_001.phpt b/ext/standard/tests/class_object/is_subclass_of_variation_001.phpt index 961ae96287..37743f393e 100644 --- a/ext/standard/tests/class_object/is_subclass_of_variation_001.phpt +++ b/ext/standard/tests/class_object/is_subclass_of_variation_001.phpt @@ -9,11 +9,11 @@ Test is_subclass_of() function : usage variations - unexpected type for arg 1 */ // Note: basic use cases in Zend/tests/is_a.phpt spl_autoload_register(function ($className) { - echo "In autoload($className)\n"; + echo "In autoload($className)\n"; }); function test_error_handler($err_no, $err_msg, $filename, $linenum) { - echo "Error: $err_no - $err_msg\n"; + echo "Error: $err_no - $err_msg\n"; } set_error_handler('test_error_handler'); diff --git a/ext/standard/tests/class_object/is_subclass_of_variation_004.phpt b/ext/standard/tests/class_object/is_subclass_of_variation_004.phpt index dba37cc3f4..c9409dcac8 100644 --- a/ext/standard/tests/class_object/is_subclass_of_variation_004.phpt +++ b/ext/standard/tests/class_object/is_subclass_of_variation_004.phpt @@ -9,11 +9,11 @@ Test is_subclass_of() function : usage variations - unexpected type for arg 1 w */ // Note: basic use cases in Zend/tests/is_a.phpt spl_autoload_register(function ($className) { - echo "In autoload($className)\n"; + echo "In autoload($className)\n"; }); function test_error_handler($err_no, $err_msg, $filename, $linenum) { - echo "Error: $err_no - $err_msg\n"; + echo "Error: $err_no - $err_msg\n"; } set_error_handler('test_error_handler'); diff --git a/ext/standard/tests/class_object/method_exists_basic_001.phpt b/ext/standard/tests/class_object/method_exists_basic_001.phpt index c0b656b3f9..5d1e2c89df 100644 --- a/ext/standard/tests/class_object/method_exists_basic_001.phpt +++ b/ext/standard/tests/class_object/method_exists_basic_001.phpt @@ -9,30 +9,30 @@ method_exists() on userspace classes; static & non-static methods with various v */ Class B { - public function inherit_pub() {} - protected function inherit_prot() {} - private function inherit_priv() {} - static public function inherit_static_pub() {} - static protected function inherit_static_prot() {} - static private function inherit_static_priv() {} + public function inherit_pub() {} + protected function inherit_prot() {} + private function inherit_priv() {} + static public function inherit_static_pub() {} + static protected function inherit_static_prot() {} + static private function inherit_static_priv() {} } Class C extends B { - public function pub() {} - protected function prot() {} - private function priv() {} - static public function static_pub() {} - static protected function static_prot() {} - static private function static_priv() {} + public function pub() {} + protected function prot() {} + private function priv() {} + static public function static_pub() {} + static protected function static_prot() {} + static private function static_priv() {} } $methods = array( - 'inherit_pub', 'inherit_prot', 'inherit_priv', - 'inherit_static_pub', 'inherit_static_prot', 'inherit_static_priv', - 'pub', 'prot', 'priv', - 'static_pub', 'static_prot', 'static_priv', - 'non_existent'); + 'inherit_pub', 'inherit_prot', 'inherit_priv', + 'inherit_static_pub', 'inherit_static_prot', 'inherit_static_priv', + 'pub', 'prot', 'priv', + 'static_pub', 'static_prot', 'static_priv', + 'non_existent'); echo "\n ---(Using string class name)---\n"; foreach ($methods as $method) { diff --git a/ext/standard/tests/class_object/method_exists_basic_003.phpt b/ext/standard/tests/class_object/method_exists_basic_003.phpt index e92b7a9135..42225a8ebd 100644 --- a/ext/standard/tests/class_object/method_exists_basic_003.phpt +++ b/ext/standard/tests/class_object/method_exists_basic_003.phpt @@ -9,7 +9,7 @@ method_exists() on non-existent class, with __autoload(). */ spl_autoload_register(function ($name) { - echo "In autoload($name)\n"; + echo "In autoload($name)\n"; }); var_dump(method_exists('UndefC', 'func')); diff --git a/ext/standard/tests/class_object/method_exists_variation_001.phpt b/ext/standard/tests/class_object/method_exists_variation_001.phpt index b975f81958..0f2293cf7b 100644 --- a/ext/standard/tests/class_object/method_exists_variation_001.phpt +++ b/ext/standard/tests/class_object/method_exists_variation_001.phpt @@ -9,11 +9,11 @@ Test method_exists() function : usage variations - unexpected type for arg 1 */ spl_autoload_register(function ($className) { - echo "In autoload($className)\n"; + echo "In autoload($className)\n"; }); function test_error_handler($err_no, $err_msg, $filename, $linenum) { - echo "Error: $err_no - $err_msg\n"; + echo "Error: $err_no - $err_msg\n"; } set_error_handler('test_error_handler'); diff --git a/ext/standard/tests/class_object/method_exists_variation_003.phpt b/ext/standard/tests/class_object/method_exists_variation_003.phpt index d5835b0b87..72b63f1e33 100644 --- a/ext/standard/tests/class_object/method_exists_variation_003.phpt +++ b/ext/standard/tests/class_object/method_exists_variation_003.phpt @@ -11,7 +11,7 @@ Test method_exists() function : variation - Case sensitivity echo "*** Testing method_exists() : variation ***\n"; Class caseSensitivityTest { - public function myMethod() {} + public function myMethod() {} } var_dump(method_exists(new casesensitivitytest, 'myMetHOD')); diff --git a/ext/standard/tests/class_object/trait_exists_basic_001.phpt b/ext/standard/tests/class_object/trait_exists_basic_001.phpt index 708c6c91e4..55b92da0d2 100644 --- a/ext/standard/tests/class_object/trait_exists_basic_001.phpt +++ b/ext/standard/tests/class_object/trait_exists_basic_001.phpt @@ -11,7 +11,7 @@ Test trait_exists() function : basic functionality echo "*** Testing trait_exists() : basic functionality ***\n"; spl_autoload_register(function ($traitName) { - echo "In autoload($traitName)\n"; + echo "In autoload($traitName)\n"; }); trait MyTrait {} diff --git a/ext/standard/tests/dir/bug72625.phpt b/ext/standard/tests/dir/bug72625.phpt index e3594414ad..2ea6da9699 100644 --- a/ext/standard/tests/dir/bug72625.phpt +++ b/ext/standard/tests/dir/bug72625.phpt @@ -11,7 +11,7 @@ if (substr(PHP_OS, 0, 3) != 'WIN') { $base = sys_get_temp_dir() . "/" . md5(uniqid()); while (strlen($base) < 260) { - $base = "$base/" . md5(uniqid()); + $base = "$base/" . md5(uniqid()); } $f0 = "$base/_test/documents/projects/myproject/vendor/name/library/classpath"; @@ -22,21 +22,21 @@ mkdir($f0, 0777, true); var_dump( - $f0, - file_exists($f0), - realpath($f0), - dirname($f0), - - $f1, - file_exists($f1), - realpath($f1), - dirname($f1) + $f0, + file_exists($f0), + realpath($f0), + dirname($f0), + + $f1, + file_exists($f1), + realpath($f1), + dirname($f1) ); $tmp = $f0; while ($tmp > $base) { - rmdir($tmp); - $tmp = dirname($tmp); + rmdir($tmp); + $tmp = dirname($tmp); } ?> diff --git a/ext/standard/tests/dir/bug73877.phpt b/ext/standard/tests/dir/bug73877.phpt index 633a4eef81..ceb272ea65 100644 --- a/ext/standard/tests/dir/bug73877.phpt +++ b/ext/standard/tests/dir/bug73877.phpt @@ -21,10 +21,10 @@ mkdir($dir1); `mklink /J $junk0 $dir0`; var_dump( - readlink($dir0), - readlink($dir1), - readlink($junk0), - strlen(readlink($dir0)) === strlen(readlink($junk0)) + readlink($dir0), + readlink($dir1), + readlink($junk0), + strlen(readlink($dir0)) === strlen(readlink($junk0)) ); ?> diff --git a/ext/standard/tests/dir/closedir_basic-win32-mb.phpt b/ext/standard/tests/dir/closedir_basic-win32-mb.phpt index dad5b2b657..7db6b7740a 100644 --- a/ext/standard/tests/dir/closedir_basic-win32-mb.phpt +++ b/ext/standard/tests/dir/closedir_basic-win32-mb.phpt @@ -34,7 +34,7 @@ echo "\n-- Call closedir() with \$dir_handle argument supplied: --\n"; $dh2 = opendir($dir_path); if ((int)$dh1 === (int)$dh2) { - echo "\nNo new resource created\n"; + echo "\nNo new resource created\n"; } var_dump(closedir($dh2)); echo "-- Check Directory Handle: --\n"; diff --git a/ext/standard/tests/dir/closedir_basic.phpt b/ext/standard/tests/dir/closedir_basic.phpt index 41b51f2080..5ec72cd8a5 100644 --- a/ext/standard/tests/dir/closedir_basic.phpt +++ b/ext/standard/tests/dir/closedir_basic.phpt @@ -28,7 +28,7 @@ echo "\n-- Call closedir() with \$dir_handle argument supplied: --\n"; $dh2 = opendir($dir_path); if ((int)$dh1 === (int)$dh2) { - echo "\nNo new resource created\n"; + echo "\nNo new resource created\n"; } var_dump(closedir($dh2)); echo "-- Check Directory Handle: --\n"; diff --git a/ext/standard/tests/dir/closedir_variation3.phpt b/ext/standard/tests/dir/closedir_variation3.phpt index 65418ca636..1d9c644a3e 100644 --- a/ext/standard/tests/dir/closedir_variation3.phpt +++ b/ext/standard/tests/dir/closedir_variation3.phpt @@ -27,7 +27,7 @@ echo "\n-- Check file pointer: --\n"; var_dump($fp); if(is_resource($fp)) { - fclose($fp); + fclose($fp); } ?> --EXPECTF-- diff --git a/ext/standard/tests/dir/dir_bug73971.phpt b/ext/standard/tests/dir/dir_bug73971.phpt index e32516ea15..1fd3eb6691 100644 --- a/ext/standard/tests/dir/dir_bug73971.phpt +++ b/ext/standard/tests/dir/dir_bug73971.phpt @@ -26,7 +26,7 @@ $d->close(); echo "\ntest DirectoryIterator\n"; $dir = new DirectoryIterator($base); foreach ($dir as $finfo) { - var_dump($finfo->getFilename()); + var_dump($finfo->getFilename()); } ?> diff --git a/ext/standard/tests/dir/opendir_variation3-win32-mb.phpt b/ext/standard/tests/dir/opendir_variation3-win32-mb.phpt index 7185cff737..82f2a330d0 100644 --- a/ext/standard/tests/dir/opendir_variation3-win32-mb.phpt +++ b/ext/standard/tests/dir/opendir_variation3-win32-mb.phpt @@ -29,9 +29,9 @@ echo "\n-- Open directory second time: --\n"; var_dump($dh2 = opendir($path)); if ($dh1 !== $dh2) { - echo "\nNew resource created\n"; + echo "\nNew resource created\n"; } else { - echo "\nNo new resource created\n"; + echo "\nNo new resource created\n"; } closedir($dh1); diff --git a/ext/standard/tests/dir/opendir_variation3.phpt b/ext/standard/tests/dir/opendir_variation3.phpt index 83a265ab81..2169684fba 100644 --- a/ext/standard/tests/dir/opendir_variation3.phpt +++ b/ext/standard/tests/dir/opendir_variation3.phpt @@ -23,9 +23,9 @@ echo "\n-- Open directory second time: --\n"; var_dump($dh2 = opendir($path)); if ($dh1 !== $dh2) { - echo "\nNew resource created\n"; + echo "\nNew resource created\n"; } else { - echo "\nNo new resource created\n"; + echo "\nNo new resource created\n"; } closedir($dh1); diff --git a/ext/standard/tests/dir/opendir_variation4-win32-mb.phpt b/ext/standard/tests/dir/opendir_variation4-win32-mb.phpt index 319e178a2e..00d09985de 100644 --- a/ext/standard/tests/dir/opendir_variation4-win32-mb.phpt +++ b/ext/standard/tests/dir/opendir_variation4-win32-mb.phpt @@ -70,10 +70,10 @@ clean_dh($dh); * and to ensure directory is not in use at CLEAN section so can me removed */ function clean_dh($dh){ - if (is_resource($dh)) { - closedir($dh); - } - unset($dh); + if (is_resource($dh)) { + closedir($dh); + } + unset($dh); } ?> --CLEAN-- diff --git a/ext/standard/tests/dir/opendir_variation4.phpt b/ext/standard/tests/dir/opendir_variation4.phpt index 6434c9ef52..c206ac4d1e 100644 --- a/ext/standard/tests/dir/opendir_variation4.phpt +++ b/ext/standard/tests/dir/opendir_variation4.phpt @@ -64,10 +64,10 @@ clean_dh($dh); * and to ensure directory is not in use at CLEAN section so can me removed */ function clean_dh($dh){ - if (is_resource($dh)) { - closedir($dh); - } - unset($dh); + if (is_resource($dh)) { + closedir($dh); + } + unset($dh); } ?> --CLEAN-- diff --git a/ext/standard/tests/dir/opendir_variation5.phpt b/ext/standard/tests/dir/opendir_variation5.phpt index f8023288d1..15e6e16c8f 100644 --- a/ext/standard/tests/dir/opendir_variation5.phpt +++ b/ext/standard/tests/dir/opendir_variation5.phpt @@ -57,10 +57,10 @@ $dir_handle2 = opendir($child_dir_path); // try to open, expected failure var_dump( $dir_handle2 ); // dump it if (is_resource($dir_handle1)) { - closedir($dir_handle1); + closedir($dir_handle1); } if (is_resource($dir_handle2)) { - closedir($dir_handle2); + closedir($dir_handle2); } ?> --CLEAN-- diff --git a/ext/standard/tests/dir/opendir_variation7.phpt b/ext/standard/tests/dir/opendir_variation7.phpt index fff52b88d9..aa45f443f0 100644 --- a/ext/standard/tests/dir/opendir_variation7.phpt +++ b/ext/standard/tests/dir/opendir_variation7.phpt @@ -48,23 +48,23 @@ $permission_values = array( $iterator = 1; foreach ($permission_values as $perm) { - echo "\n-- Iteration $iterator --\n"; - // try to remove the dir if exists & create - if (is_dir($dir_path)){ - chmod ($dir_path, 0777); // change dir permission to allow all operation - rmdir ($dir_path); - } - mkdir($dir_path); - - // change the dir permission to test dir on it - var_dump( chmod($dir_path, $perm) ); - - var_dump($dh = opendir($dir_path)); - - if (is_resource($dh)) { - closedir($dh); - } - $iterator++; + echo "\n-- Iteration $iterator --\n"; + // try to remove the dir if exists & create + if (is_dir($dir_path)){ + chmod ($dir_path, 0777); // change dir permission to allow all operation + rmdir ($dir_path); + } + mkdir($dir_path); + + // change the dir permission to test dir on it + var_dump( chmod($dir_path, $perm) ); + + var_dump($dh = opendir($dir_path)); + + if (is_resource($dh)) { + closedir($dh); + } + $iterator++; } ?> --CLEAN-- diff --git a/ext/standard/tests/dir/readdir_basic-win32-mb.phpt b/ext/standard/tests/dir/readdir_basic-win32-mb.phpt index 18ee74e6b3..7b371ec3ac 100644 --- a/ext/standard/tests/dir/readdir_basic-win32-mb.phpt +++ b/ext/standard/tests/dir/readdir_basic-win32-mb.phpt @@ -31,22 +31,22 @@ echo "\n-- Call readdir() with \$path argument --\n"; var_dump($dh = opendir($path)); $a = array(); while( FALSE !== ($file = readdir($dh)) ) { - $a[] = $file; + $a[] = $file; } sort($a); foreach($a as $file) { - var_dump($file); + var_dump($file); } echo "\n-- Call readdir() without \$path argument --\n"; var_dump($dh = opendir($path)); $a = array(); while( FALSE !== ( $file = readdir() ) ) { - $a[] = $file; + $a[] = $file; } sort($a); foreach($a as $file) { - var_dump($file); + var_dump($file); } delete_files($path, 3); diff --git a/ext/standard/tests/dir/readdir_basic.phpt b/ext/standard/tests/dir/readdir_basic.phpt index 9a45ee4002..16437eb5a6 100644 --- a/ext/standard/tests/dir/readdir_basic.phpt +++ b/ext/standard/tests/dir/readdir_basic.phpt @@ -25,22 +25,22 @@ echo "\n-- Call readdir() with \$path argument --\n"; var_dump($dh = opendir($path)); $a = array(); while( FALSE !== ($file = readdir($dh)) ) { - $a[] = $file; + $a[] = $file; } sort($a); foreach($a as $file) { - var_dump($file); + var_dump($file); } echo "\n-- Call readdir() without \$path argument --\n"; var_dump($dh = opendir($path)); $a = array(); while( FALSE !== ( $file = readdir() ) ) { - $a[] = $file; + $a[] = $file; } sort($a); foreach($a as $file) { - var_dump($file); + var_dump($file); } delete_files($path, 3); diff --git a/ext/standard/tests/dir/readdir_variation2-win32-mb.phpt b/ext/standard/tests/dir/readdir_variation2-win32-mb.phpt index 01ae34fb88..4e0a8d7158 100644 --- a/ext/standard/tests/dir/readdir_variation2-win32-mb.phpt +++ b/ext/standard/tests/dir/readdir_variation2-win32-mb.phpt @@ -25,18 +25,18 @@ $dir_handle = opendir($path); echo "\n-- Pass an empty directory to readdir() --\n"; function mysort($a,$b) { - return strlen($a) > strlen($b) ? 1 : -1; + return strlen($a) > strlen($b) ? 1 : -1; } $entries = array(); while(FALSE !== ($file = readdir($dir_handle))){ - $entries[] = $file; + $entries[] = $file; } closedir($dir_handle); usort($entries, "mysort"); foreach($entries as $entry) { - var_dump($entry); + var_dump($entry); } ?> --CLEAN-- diff --git a/ext/standard/tests/dir/readdir_variation2.phpt b/ext/standard/tests/dir/readdir_variation2.phpt index 3fb35a778e..979c4f4057 100644 --- a/ext/standard/tests/dir/readdir_variation2.phpt +++ b/ext/standard/tests/dir/readdir_variation2.phpt @@ -19,18 +19,18 @@ $dir_handle = opendir($path); echo "\n-- Pass an empty directory to readdir() --\n"; function mysort($a,$b) { - return strlen($a) > strlen($b) ? 1 : -1; + return strlen($a) > strlen($b) ? 1 : -1; } $entries = array(); while(FALSE !== ($file = readdir($dir_handle))){ - $entries[] = $file; + $entries[] = $file; } closedir($dir_handle); usort($entries, "mysort"); foreach($entries as $entry) { - var_dump($entry); + var_dump($entry); } ?> --CLEAN-- diff --git a/ext/standard/tests/dir/readdir_variation3-win32-mb.phpt b/ext/standard/tests/dir/readdir_variation3-win32-mb.phpt index b3f831e067..594838fe11 100644 --- a/ext/standard/tests/dir/readdir_variation3-win32-mb.phpt +++ b/ext/standard/tests/dir/readdir_variation3-win32-mb.phpt @@ -35,9 +35,9 @@ create_files($path_sub, 2); $dir_handle = opendir($path_top); while(FALSE !== ($file = readdir($dir_handle))) { - // different OS order files differently so will - // store file names into an array so can use sorted in expected output - $contents[] = $file; + // different OS order files differently so will + // store file names into an array so can use sorted in expected output + $contents[] = $file; } // more important to check that all contents are present than order they are returned in diff --git a/ext/standard/tests/dir/readdir_variation3.phpt b/ext/standard/tests/dir/readdir_variation3.phpt index 6adac51215..6cc6f9e0a4 100644 --- a/ext/standard/tests/dir/readdir_variation3.phpt +++ b/ext/standard/tests/dir/readdir_variation3.phpt @@ -29,9 +29,9 @@ create_files($path_sub, 2); $dir_handle = opendir($path_top); while(FALSE !== ($file = readdir($dir_handle))) { - // different OS order files differently so will - // store file names into an array so can use sorted in expected output - $contents[] = $file; + // different OS order files differently so will + // store file names into an array so can use sorted in expected output + $contents[] = $file; } // more important to check that all contents are present than order they are returned in diff --git a/ext/standard/tests/dir/readdir_variation4-win32-mb.phpt b/ext/standard/tests/dir/readdir_variation4-win32-mb.phpt index 8e9e3b610e..c2bf8b1616 100644 --- a/ext/standard/tests/dir/readdir_variation4-win32-mb.phpt +++ b/ext/standard/tests/dir/readdir_variation4-win32-mb.phpt @@ -55,24 +55,24 @@ $inputs = array( $iterator = 1; foreach($inputs as $key => $input) { - echo "\n-- Iteration $iterator --\n"; - $handle = "fp{$iterator}"; - var_dump( $$handle = @fopen($dir_path . "ç§ã¯ã‚¬ãƒ©ã‚¹ã‚’食ã¹ã‚‰ã‚Œã¾ã™$input.tmp", 'w') ); - var_dump( fwrite($$handle, $key)); - fclose($$handle); - $iterator++; + echo "\n-- Iteration $iterator --\n"; + $handle = "fp{$iterator}"; + var_dump( $$handle = @fopen($dir_path . "ç§ã¯ã‚¬ãƒ©ã‚¹ã‚’食ã¹ã‚‰ã‚Œã¾ã™$input.tmp", 'w') ); + var_dump( fwrite($$handle, $key)); + fclose($$handle); + $iterator++; }; echo "\n-- Call to readdir() --\n"; $dir_handle = opendir($dir_path); while(FALSE !== ($file = readdir($dir_handle))){ - // different OS order files differently so will - // store file names into an array so can use sorted in expected output - $contents[] = $file; + // different OS order files differently so will + // store file names into an array so can use sorted in expected output + $contents[] = $file; - // remove files while going through directory - @unlink($dir_path . $file); + // remove files while going through directory + @unlink($dir_path . $file); } // more important to check that all contents are present than order they are returned in diff --git a/ext/standard/tests/dir/readdir_variation4.phpt b/ext/standard/tests/dir/readdir_variation4.phpt index 8bfe176946..37e5b80ecb 100644 --- a/ext/standard/tests/dir/readdir_variation4.phpt +++ b/ext/standard/tests/dir/readdir_variation4.phpt @@ -49,24 +49,24 @@ $inputs = array( $iterator = 1; foreach($inputs as $key => $input) { - echo "\n-- Iteration $iterator --\n"; - $handle = "fp{$iterator}"; - var_dump( $$handle = fopen(@"$dir_path$input.tmp", 'w') ); - var_dump( fwrite($$handle, $key)); - fclose($$handle); - $iterator++; + echo "\n-- Iteration $iterator --\n"; + $handle = "fp{$iterator}"; + var_dump( $$handle = fopen(@"$dir_path$input.tmp", 'w') ); + var_dump( fwrite($$handle, $key)); + fclose($$handle); + $iterator++; }; echo "\n-- Call to readdir() --\n"; $dir_handle = opendir($dir_path); while(FALSE !== ($file = readdir($dir_handle))){ - // different OS order files differently so will - // store file names into an array so can use sorted in expected output - $contents[] = $file; + // different OS order files differently so will + // store file names into an array so can use sorted in expected output + $contents[] = $file; - // remove files while going through directory - @unlink($dir_path . $file); + // remove files while going through directory + @unlink($dir_path . $file); } // more important to check that all contents are present than order they are returned in diff --git a/ext/standard/tests/dir/readdir_variation5.phpt b/ext/standard/tests/dir/readdir_variation5.phpt index e9d88dc835..d1cdc1bd58 100644 --- a/ext/standard/tests/dir/readdir_variation5.phpt +++ b/ext/standard/tests/dir/readdir_variation5.phpt @@ -46,23 +46,23 @@ $permission_values = array( // Open directory with different permission values, read and close, expected: none of them to succeed. $iterator = 1; foreach($permission_values as $perm) { - echo "\n-- Iteration $iterator --\n"; + echo "\n-- Iteration $iterator --\n"; - if (is_dir($dir_path)) { - chmod ($dir_path, 0777); // change dir permission to allow all operation - rmdir ($dir_path); - } - mkdir($dir_path); + if (is_dir($dir_path)) { + chmod ($dir_path, 0777); // change dir permission to allow all operation + rmdir ($dir_path); + } + mkdir($dir_path); - // change the dir permission to test dir on it - var_dump( chmod($dir_path, $perm) ); - var_dump($dh = opendir($dir_path)); + // change the dir permission to test dir on it + var_dump( chmod($dir_path, $perm) ); + var_dump($dh = opendir($dir_path)); - echo "-- Calling readdir() --\n"; - var_dump(readdir($dh)); + echo "-- Calling readdir() --\n"; + var_dump(readdir($dh)); - closedir($dh); - $iterator++; + closedir($dh); + $iterator++; } ?> --CLEAN-- diff --git a/ext/standard/tests/dir/readdir_variation6-win32-mb.phpt b/ext/standard/tests/dir/readdir_variation6-win32-mb.phpt index 3646316247..806fdec87e 100644 --- a/ext/standard/tests/dir/readdir_variation6-win32-mb.phpt +++ b/ext/standard/tests/dir/readdir_variation6-win32-mb.phpt @@ -39,21 +39,21 @@ opendir($dir_path); echo "\n-- Reading Directory Contents with Previous Handle --\n"; $a = array(); while (FALSE !== ($file = readdir($dir_handle1))) { - $a[] = $file; + $a[] = $file; } sort($a); foreach ($a as $file) { - var_dump($file); + var_dump($file); } echo "\n-- Reading Directory Contents with Current Handle (no arguments supplied) --\n"; $a = array(); while (FALSE !== ($file = readdir())) { - $a[] = $file; + $a[] = $file; } sort($a); foreach ($a as $file) { - var_dump($file); + var_dump($file); } // delete temporary files diff --git a/ext/standard/tests/dir/readdir_variation6.phpt b/ext/standard/tests/dir/readdir_variation6.phpt index 19bb906f14..532a20fd21 100644 --- a/ext/standard/tests/dir/readdir_variation6.phpt +++ b/ext/standard/tests/dir/readdir_variation6.phpt @@ -33,21 +33,21 @@ opendir($dir_path); echo "\n-- Reading Directory Contents with Previous Handle --\n"; $a = array(); while (FALSE !== ($file = readdir($dir_handle1))) { - $a[] = $file; + $a[] = $file; } sort($a); foreach ($a as $file) { - var_dump($file); + var_dump($file); } echo "\n-- Reading Directory Contents with Current Handle (no arguments supplied) --\n"; $a = array(); while (FALSE !== ($file = readdir())) { - $a[] = $file; + $a[] = $file; } sort($a); foreach ($a as $file) { - var_dump($file); + var_dump($file); } // delete temporary files diff --git a/ext/standard/tests/dir/rewinddir_basic-win32-mb.phpt b/ext/standard/tests/dir/rewinddir_basic-win32-mb.phpt index c16e993f83..fc5539666d 100644 --- a/ext/standard/tests/dir/rewinddir_basic-win32-mb.phpt +++ b/ext/standard/tests/dir/rewinddir_basic-win32-mb.phpt @@ -36,7 +36,7 @@ var_dump($dh2 = opendir($dir_path2)); $data = array(); echo "\n-- Read and rewind first directory (argument supplied) --\n"; while(FALSE !== $file1 = readdir($dh1)) { - $data[] = $file1; + $data[] = $file1; } $first = $data[0]; sort($data); @@ -48,7 +48,7 @@ var_dump(readdir($dh1) == $first); $data = array(); echo "\n-- Read and rewind second directory (no argument supplied) --\n"; while(FALSE !== $file2 = readdir()) { - $data[] = $file2; + $data[] = $file2; } $first = $data[0]; sort($data); diff --git a/ext/standard/tests/dir/rewinddir_basic.phpt b/ext/standard/tests/dir/rewinddir_basic.phpt index 1750121b3e..714d75266c 100644 --- a/ext/standard/tests/dir/rewinddir_basic.phpt +++ b/ext/standard/tests/dir/rewinddir_basic.phpt @@ -30,7 +30,7 @@ var_dump($dh2 = opendir($dir_path2)); $data = array(); echo "\n-- Read and rewind first directory (argument supplied) --\n"; while(FALSE !== $file1 = readdir($dh1)) { - $data[] = $file1; + $data[] = $file1; } $first = $data[0]; sort($data); @@ -42,7 +42,7 @@ var_dump(readdir($dh1) == $first); $data = array(); echo "\n-- Read and rewind second directory (no argument supplied) --\n"; while(FALSE !== $file2 = readdir()) { - $data[] = $file2; + $data[] = $file2; } $first = $data[0]; sort($data); diff --git a/ext/standard/tests/dir/rewinddir_variation3.phpt b/ext/standard/tests/dir/rewinddir_variation3.phpt index 2bd69e45fc..07508eac3f 100644 --- a/ext/standard/tests/dir/rewinddir_variation3.phpt +++ b/ext/standard/tests/dir/rewinddir_variation3.phpt @@ -28,9 +28,9 @@ $result2 = fread($fp, 5); echo "\n-- Check if rewinddir() has repositioned the file pointer --\n"; if ($result1 === $result2) { - echo "rewinddir() works on file pointers\n"; + echo "rewinddir() works on file pointers\n"; } else { - echo "rewinddir() does not work on file pointers\n"; + echo "rewinddir() does not work on file pointers\n"; } ?> --EXPECTF-- diff --git a/ext/standard/tests/dir/scandir_variation7.phpt b/ext/standard/tests/dir/scandir_variation7.phpt index a0fede44ad..eb4c7e9d21 100644 --- a/ext/standard/tests/dir/scandir_variation7.phpt +++ b/ext/standard/tests/dir/scandir_variation7.phpt @@ -44,20 +44,20 @@ $permission_values = array( $iterator = 1; foreach ($permission_values as $perm) { - echo "\n-- Iteration $iterator --\n"; + echo "\n-- Iteration $iterator --\n"; - // Remove the directory if already exists - if (is_dir($dir_path)){ - chmod ($dir_path, 0777); // change dir permission to allow all operation - rmdir ($dir_path); - } - mkdir($dir_path); + // Remove the directory if already exists + if (is_dir($dir_path)){ + chmod ($dir_path, 0777); // change dir permission to allow all operation + rmdir ($dir_path); + } + mkdir($dir_path); - // change the dir permission to test dir on it - var_dump( chmod($dir_path, $perm) ); + // change the dir permission to test dir on it + var_dump( chmod($dir_path, $perm) ); - var_dump(scandir($dir_path)); - $iterator++; + var_dump(scandir($dir_path)); + $iterator++; } ?> --CLEAN-- diff --git a/ext/standard/tests/dir/scandir_variation8-win32-mb.phpt b/ext/standard/tests/dir/scandir_variation8-win32-mb.phpt index ffeda65be7..e353dc3725 100644 --- a/ext/standard/tests/dir/scandir_variation8-win32-mb.phpt +++ b/ext/standard/tests/dir/scandir_variation8-win32-mb.phpt @@ -55,11 +55,11 @@ $inputs = array( $iterator = 1; foreach($inputs as $key => $input) { - echo "\n-- Iteration $iterator --\n"; - $handle = "fp{$iterator}"; - var_dump( $$handle = @fopen($dir_path . "/ç§ã¯ã‚¬ãƒ©ã‚¹ã‚’食ã¹ã‚‰ã‚Œã¾ã™$input.tmp", 'w') ); - fclose($$handle); - $iterator++; + echo "\n-- Iteration $iterator --\n"; + $handle = "fp{$iterator}"; + var_dump( $$handle = @fopen($dir_path . "/ç§ã¯ã‚¬ãƒ©ã‚¹ã‚’食ã¹ã‚‰ã‚Œã¾ã™$input.tmp", 'w') ); + fclose($$handle); + $iterator++; }; echo "\n-- Call to scandir() --\n"; @@ -67,8 +67,8 @@ var_dump($content = scandir($dir_path)); // remove all files in directory so can remove directory in CLEAN section foreach ($content as $file_name) { - // suppress errors as won't be able to remove "." and ".." entries - @unlink($dir_path . $file_name); + // suppress errors as won't be able to remove "." and ".." entries + @unlink($dir_path . $file_name); } ?> --CLEAN-- diff --git a/ext/standard/tests/dir/scandir_variation8.phpt b/ext/standard/tests/dir/scandir_variation8.phpt index 7734c1531f..1eec187f70 100644 --- a/ext/standard/tests/dir/scandir_variation8.phpt +++ b/ext/standard/tests/dir/scandir_variation8.phpt @@ -49,11 +49,11 @@ $inputs = array( $iterator = 1; foreach($inputs as $key => $input) { - echo "\n-- Iteration $iterator --\n"; - $handle = "fp{$iterator}"; - var_dump( $$handle = fopen(@"$dir_path$input.tmp", 'w') ); - fclose($$handle); - $iterator++; + echo "\n-- Iteration $iterator --\n"; + $handle = "fp{$iterator}"; + var_dump( $$handle = fopen(@"$dir_path$input.tmp", 'w') ); + fclose($$handle); + $iterator++; }; echo "\n-- Call to scandir() --\n"; @@ -61,8 +61,8 @@ var_dump($content = scandir($dir_path)); // remove all files in directory so can remove directory in CLEAN section foreach ($content as $file_name) { - // suppress errors as won't be able to remove "." and ".." entries - @unlink($dir_path . $file_name); + // suppress errors as won't be able to remove "." and ".." entries + @unlink($dir_path . $file_name); } ?> --CLEAN-- diff --git a/ext/standard/tests/dir/scandir_variation9-win32-mb.phpt b/ext/standard/tests/dir/scandir_variation9-win32-mb.phpt index 16b26fbb78..c609975dda 100644 --- a/ext/standard/tests/dir/scandir_variation9-win32-mb.phpt +++ b/ext/standard/tests/dir/scandir_variation9-win32-mb.phpt @@ -32,7 +32,7 @@ mkdir($dir); $ints = array (PHP_INT_MAX, -PHP_INT_MAX, 0); foreach($ints as $sorting_order) { - var_dump( scandir($dir, $sorting_order) ); + var_dump( scandir($dir, $sorting_order) ); } delete_files($dir, 2, "ç§ã¯ã‚¬ãƒ©ã‚¹ã‚’食ã¹ã‚‰ã‚Œã¾ã™file"); diff --git a/ext/standard/tests/dir/scandir_variation9.phpt b/ext/standard/tests/dir/scandir_variation9.phpt index 6bfbe28ea0..7e623c0e6f 100644 --- a/ext/standard/tests/dir/scandir_variation9.phpt +++ b/ext/standard/tests/dir/scandir_variation9.phpt @@ -26,7 +26,7 @@ mkdir($dir); $ints = array (PHP_INT_MAX, -PHP_INT_MAX, 0); foreach($ints as $sorting_order) { - var_dump( scandir($dir, $sorting_order) ); + var_dump( scandir($dir, $sorting_order) ); } delete_files($dir, 2); diff --git a/ext/standard/tests/directory/bug74589_utf8.phpt b/ext/standard/tests/directory/bug74589_utf8.phpt index 5bf047fbe2..7a13b57f04 100644 --- a/ext/standard/tests/directory/bug74589_utf8.phpt +++ b/ext/standard/tests/directory/bug74589_utf8.phpt @@ -23,9 +23,9 @@ mkdir($dir); file_put_contents($test_file, "<?php - var_dump(__DIR__); - var_dump(__FILE__); - var_dump(__DIR__ === __DIR__);"); + var_dump(__DIR__); + var_dump(__FILE__); + var_dump(__DIR__ === __DIR__);"); $php = getenv('TEST_PHP_EXECUTABLE'); diff --git a/ext/standard/tests/file/001.phpt b/ext/standard/tests/file/001.phpt index d5ab2e5a0b..e2fa6cce59 100644 --- a/ext/standard/tests/file/001.phpt +++ b/ext/standard/tests/file/001.phpt @@ -50,14 +50,14 @@ $s = stat ('test.file'); $ls = lstat ('test.file'); for ($i = 0; $i <= 12; $i++) { if ($ls[$i] != $s[$i]) { - echo "test.file lstat and stat differ at element $i\n"; + echo "test.file lstat and stat differ at element $i\n"; } } $s = stat ('test.link'); $ls = lstat ('test.link'); for ($i = 0; $i <= 11; $i++) { if ($ls[$i] != $s[$i]) { - if ($i != 6 && $i != 10 && $i != 11) echo "test.link lstat and stat differ at element $i\n"; + if ($i != 6 && $i != 10 && $i != 11) echo "test.link lstat and stat differ at element $i\n"; } } echo "test.file is " . filetype('test.file') . "\n"; diff --git a/ext/standard/tests/file/003.phpt b/ext/standard/tests/file/003.phpt index 8eeaa939eb..59e03f0cef 100644 --- a/ext/standard/tests/file/003.phpt +++ b/ext/standard/tests/file/003.phpt @@ -4,27 +4,27 @@ is_*() and file_exists() return values are boolean. <?php $funcs = array( - 'is_writable', - 'is_readable', - 'is_executable', - 'is_file', - 'file_exists', + 'is_writable', + 'is_readable', + 'is_executable', + 'is_file', + 'file_exists', ); $filename=""; foreach ($funcs as $test) { - $bb = $test($filename); - echo gettype($bb)."\n"; - clearstatcache(); + $bb = $test($filename); + echo gettype($bb)."\n"; + clearstatcache(); } $filename="run-tests.php"; foreach ($funcs as $test) { - $bb = $test($filename); - echo gettype($bb)."\n"; - clearstatcache(); + $bb = $test($filename); + echo gettype($bb)."\n"; + clearstatcache(); } ?> diff --git a/ext/standard/tests/file/004.phpt b/ext/standard/tests/file/004.phpt index 522b8320e4..742457c7aa 100644 --- a/ext/standard/tests/file/004.phpt +++ b/ext/standard/tests/file/004.phpt @@ -2,56 +2,56 @@ file_put_contents() test --FILE-- <?php - chdir(__DIR__); - for ($i = 1; $i < 6; $i++) { - @unlink("./TEST{$i}"); - } + chdir(__DIR__); + for ($i = 1; $i < 6; $i++) { + @unlink("./TEST{$i}"); + } - echo "String Test: "; - echo file_put_contents("TEST1", file_get_contents(__FILE__)) !== FALSE ? 'OK' : 'FAIL'; - echo "\n"; + echo "String Test: "; + echo file_put_contents("TEST1", file_get_contents(__FILE__)) !== FALSE ? 'OK' : 'FAIL'; + echo "\n"; - $old_int = $int = rand(); - $ret = file_put_contents("TEST2", $int); - echo "Integer Test: "; - if ($int === $old_int && $ret !== FALSE && md5($int) == md5_file("TEST2")) { - echo 'OK'; - } else { - echo 'FAIL'; - } - echo "\n"; + $old_int = $int = rand(); + $ret = file_put_contents("TEST2", $int); + echo "Integer Test: "; + if ($int === $old_int && $ret !== FALSE && md5($int) == md5_file("TEST2")) { + echo 'OK'; + } else { + echo 'FAIL'; + } + echo "\n"; - $old_int = $int = time() / 1000; - $ret = file_put_contents("TEST3", $int); - echo "Float Test: "; - if ($int === $old_int && $ret !== FALSE && md5($int) == md5_file("TEST3")) { - echo 'OK'; - } else { - echo 'FAIL'; - } - echo "\n"; + $old_int = $int = time() / 1000; + $ret = file_put_contents("TEST3", $int); + echo "Float Test: "; + if ($int === $old_int && $ret !== FALSE && md5($int) == md5_file("TEST3")) { + echo 'OK'; + } else { + echo 'FAIL'; + } + echo "\n"; - $ret = file_put_contents("TEST4", __FILE__); - echo "Bool Test: "; - if ($ret !== FALSE && md5(__FILE__) == md5_file("TEST4")) { - echo 'OK'; - } else { - echo 'FAIL'; - } - echo "\n"; + $ret = file_put_contents("TEST4", __FILE__); + echo "Bool Test: "; + if ($ret !== FALSE && md5(__FILE__) == md5_file("TEST4")) { + echo 'OK'; + } else { + echo 'FAIL'; + } + echo "\n"; - $ret = @file_put_contents("TEST5", $_SERVER); - echo "Array Test: "; - if ($ret !== FALSE && @md5(implode('', $_SERVER)) == md5_file("TEST5")) { - echo 'OK'; - } else { - echo 'FAIL'; - } - echo "\n"; + $ret = @file_put_contents("TEST5", $_SERVER); + echo "Array Test: "; + if ($ret !== FALSE && @md5(implode('', $_SERVER)) == md5_file("TEST5")) { + echo 'OK'; + } else { + echo 'FAIL'; + } + echo "\n"; - for ($i = 1; $i < 6; $i++) { - @unlink("./TEST{$i}"); - } + for ($i = 1; $i < 6; $i++) { + @unlink("./TEST{$i}"); + } ?> --EXPECT-- String Test: OK diff --git a/ext/standard/tests/file/basename_basic-win32.phpt b/ext/standard/tests/file/basename_basic-win32.phpt index ceccf9eef7..79de350eae 100644 --- a/ext/standard/tests/file/basename_basic-win32.phpt +++ b/ext/standard/tests/file/basename_basic-win32.phpt @@ -60,7 +60,7 @@ $file_paths = array ( ); foreach ($file_paths as $file_path) { - var_dump(basename($file_path)); + var_dump(basename($file_path)); } ?> diff --git a/ext/standard/tests/file/basename_basic.phpt b/ext/standard/tests/file/basename_basic.phpt index 6354b2acd7..55bd868c55 100644 --- a/ext/standard/tests/file/basename_basic.phpt +++ b/ext/standard/tests/file/basename_basic.phpt @@ -60,7 +60,7 @@ $file_paths = array ( ); foreach ($file_paths as $file_path) { - var_dump(basename($file_path)); + var_dump(basename($file_path)); } ?> diff --git a/ext/standard/tests/file/basename_variation1-win32.phpt b/ext/standard/tests/file/basename_variation1-win32.phpt index eb2a4ff497..b68765ca68 100644 --- a/ext/standard/tests/file/basename_variation1-win32.phpt +++ b/ext/standard/tests/file/basename_variation1-win32.phpt @@ -12,25 +12,25 @@ if (substr(PHP_OS, 0, 3) != 'WIN') { $prefixes = array ( // drive letters - "A:/", + "A:/", "Z:/", "A:\\", // other prefixes "http://", "blah://", - "blah:\\", + "blah:\\", "hostname:", - // home directory ~ - "~/", - "~\\", + // home directory ~ + "~/", + "~\\", ); $paths = array ( - "foo", - "foo/", + "foo", + "foo/", "foo\\", "foo.bar", "foo.bar/", @@ -43,11 +43,11 @@ $paths = array ( ); foreach ($prefixes as $prefix) { - foreach ($paths as $path) { - $input = $prefix . $path; - echo "basename for path $input is:\n"; - var_dump(basename($input)); - } + foreach ($paths as $path) { + $input = $prefix . $path; + echo "basename for path $input is:\n"; + var_dump(basename($input)); + } } echo "\ndone\n"; diff --git a/ext/standard/tests/file/basename_variation1.phpt b/ext/standard/tests/file/basename_variation1.phpt index ea7cdfe8b7..2b2ac3110e 100644 --- a/ext/standard/tests/file/basename_variation1.phpt +++ b/ext/standard/tests/file/basename_variation1.phpt @@ -12,25 +12,25 @@ if (substr(PHP_OS, 0, 3) == 'WIN') { $prefixes = array ( // drive letters - "A:/", + "A:/", "Z:/", "A:\\", // other prefixes "http://", "blah://", - "blah:\\", + "blah:\\", "hostname:", - // home directory ~ - "~/", - "~\\", + // home directory ~ + "~/", + "~\\", ); $paths = array ( - "foo", - "foo/", + "foo", + "foo/", "foo\\", "foo.bar", "foo.bar/", @@ -43,11 +43,11 @@ $paths = array ( ); foreach ($prefixes as $prefix) { - foreach ($paths as $path) { - $input = $prefix . $path; - echo "basename for path $input is:\n"; - var_dump(basename($input)); - } + foreach ($paths as $path) { + $input = $prefix . $path; + echo "basename for path $input is:\n"; + var_dump(basename($input)); + } } echo "\ndone\n"; diff --git a/ext/standard/tests/file/basename_variation2-win32.phpt b/ext/standard/tests/file/basename_variation2-win32.phpt index 43d6de5060..870fc617dd 100644 --- a/ext/standard/tests/file/basename_variation2-win32.phpt +++ b/ext/standard/tests/file/basename_variation2-win32.phpt @@ -11,8 +11,8 @@ if (substr(PHP_OS, 0, 3) != 'WIN') { $paths = array ( - "foo", - "foo/", + "foo", + "foo/", "foo\\", "foo.bar", "foo.bar/", @@ -26,8 +26,8 @@ $paths = array ( $suffixes = array ( - ".bar", - ".b", + ".bar", + ".b", ".", " ", "foo", @@ -39,10 +39,10 @@ $suffixes = array ( ); foreach ($paths as $path) { - foreach ($suffixes as $suffix) { - echo "basename for path $path, supplying suffix $suffix is:\n"; - var_dump(basename($path, $suffix)); - } + foreach ($suffixes as $suffix) { + echo "basename for path $path, supplying suffix $suffix is:\n"; + var_dump(basename($path, $suffix)); + } } echo "\ndone\n"; diff --git a/ext/standard/tests/file/basename_variation2.phpt b/ext/standard/tests/file/basename_variation2.phpt index 195b98a6d3..a428d84e06 100644 --- a/ext/standard/tests/file/basename_variation2.phpt +++ b/ext/standard/tests/file/basename_variation2.phpt @@ -11,8 +11,8 @@ if (substr(PHP_OS, 0, 3) == 'WIN') { $paths = array ( - "foo", - "foo/", + "foo", + "foo/", "foo\\", "foo.bar", "foo.bar/", @@ -26,8 +26,8 @@ $paths = array ( $suffixes = array ( - ".bar", - ".b", + ".bar", + ".b", ".", " ", "foo", @@ -39,10 +39,10 @@ $suffixes = array ( ); foreach ($paths as $path) { - foreach ($suffixes as $suffix) { - echo "basename for path $path, supplying suffix $suffix is:\n"; - var_dump(basename($path, $suffix)); - } + foreach ($suffixes as $suffix) { + echo "basename for path $path, supplying suffix $suffix is:\n"; + var_dump(basename($path, $suffix)); + } } echo "\ndone\n"; diff --git a/ext/standard/tests/file/bug12556.phpt b/ext/standard/tests/file/bug12556.phpt index 30299899a1..83b39ad782 100644 --- a/ext/standard/tests/file/bug12556.phpt +++ b/ext/standard/tests/file/bug12556.phpt @@ -4,8 +4,8 @@ Bug #12556 (fgetcsv() ignores lengths when quotes not closed) <?php $fp = fopen(__DIR__."/test.csv", "r"); while($line = fgetcsv($fp, 24)) { - $line = str_replace("\x0d\x0a", "\x0a", $line); - var_dump($line); + $line = str_replace("\x0d\x0a", "\x0a", $line); + var_dump($line); } fclose($fp); ?> diff --git a/ext/standard/tests/file/bug22382.phpt b/ext/standard/tests/file/bug22382.phpt index 7768a13b3e..c8dd01efd0 100644 --- a/ext/standard/tests/file/bug22382.phpt +++ b/ext/standard/tests/file/bug22382.phpt @@ -4,7 +4,7 @@ Bug #22382 (fgetcsv() does not handle escaped quotes correctly) <?php $fp = fopen(__DIR__."/test2.csv", "r"); while(($line = fgetcsv($fp, 1024))) { - var_dump($line); + var_dump($line); } fclose($fp); ?> diff --git a/ext/standard/tests/file/bug22414.phpt b/ext/standard/tests/file/bug22414.phpt index c6e993ac9f..5507856815 100644 --- a/ext/standard/tests/file/bug22414.phpt +++ b/ext/standard/tests/file/bug22414.phpt @@ -5,33 +5,33 @@ output_handler= --FILE-- <?php - $php = getenv('TEST_PHP_EXECUTABLE'); - $tmpfile = tempnam(__DIR__, 'phpt'); - $args = ' -n '; + $php = getenv('TEST_PHP_EXECUTABLE'); + $tmpfile = tempnam(__DIR__, 'phpt'); + $args = ' -n '; - /* Regular Data Test */ - passthru($php . $args . ' -r " echo \"HELLO\"; "'); + /* Regular Data Test */ + passthru($php . $args . ' -r " echo \"HELLO\"; "'); - echo "\n"; + echo "\n"; - /* Binary Data Test */ + /* Binary Data Test */ - if (substr(PHP_OS, 0, 3) != 'WIN') { - $cmd = $php . $args . ' -r \"readfile(@getenv(\'\\\'\'TEST_PHP_EXECUTABLE\'\\\'\')); \"'; - $cmd = $php . $args . ' -r \' passthru("'.$cmd.'"); \' > '.$tmpfile ; - } else { - $cmd = $php . $args . ' -r \"readfile(@getenv(\\\\\\"TEST_PHP_EXECUTABLE\\\\\\")); \"'; - $cmd = $php . $args . ' -r " passthru(\''.$cmd.'\');" > '.$tmpfile ; - } - exec($cmd); + if (substr(PHP_OS, 0, 3) != 'WIN') { + $cmd = $php . $args . ' -r \"readfile(@getenv(\'\\\'\'TEST_PHP_EXECUTABLE\'\\\'\')); \"'; + $cmd = $php . $args . ' -r \' passthru("'.$cmd.'"); \' > '.$tmpfile ; + } else { + $cmd = $php . $args . ' -r \"readfile(@getenv(\\\\\\"TEST_PHP_EXECUTABLE\\\\\\")); \"'; + $cmd = $php . $args . ' -r " passthru(\''.$cmd.'\');" > '.$tmpfile ; + } + exec($cmd); - if (md5_file($php) == md5_file($tmpfile)) { - echo "Works\n"; - } else { - echo "Does not work\n"; - } + if (md5_file($php) == md5_file($tmpfile)) { + echo "Works\n"; + } else { + echo "Does not work\n"; + } - @unlink($tmpfile); + @unlink($tmpfile); ?> --EXPECT-- HELLO diff --git a/ext/standard/tests/file/bug24313.phpt b/ext/standard/tests/file/bug24313.phpt index e5bceee856..0893889a02 100644 --- a/ext/standard/tests/file/bug24313.phpt +++ b/ext/standard/tests/file/bug24313.phpt @@ -10,7 +10,7 @@ if (substr(PHP_OS, 0, 3) == 'WIN') { open_basedir=/dev --FILE-- <?php - var_dump(file_exists("/dev/bogus_file_no_such_thing")); + var_dump(file_exists("/dev/bogus_file_no_such_thing")); ?> --EXPECT-- bool(false) diff --git a/ext/standard/tests/file/bug24482.phpt b/ext/standard/tests/file/bug24482.phpt index 9fe4d2d9ee..ba3dd73318 100644 --- a/ext/standard/tests/file/bug24482.phpt +++ b/ext/standard/tests/file/bug24482.phpt @@ -18,24 +18,24 @@ $globdirs = glob("*", GLOB_ONLYDIR); $dirs = array(); $dh = opendir("."); while (is_string($file = readdir($dh))) { - if ($file[0] === ".") continue; - if (!is_dir($file)) continue; - $dirs[] = $file; + if ($file[0] === ".") continue; + if (!is_dir($file)) continue; + $dirs[] = $file; } closedir($dh); if (count($dirs) != count($globdirs)) { - echo "Directory count mismatch\n"; + echo "Directory count mismatch\n"; - echo "glob found:\n"; - sort($globdirs); - var_dump($globdirs); + echo "glob found:\n"; + sort($globdirs); + var_dump($globdirs); - echo "opendir/readdir/isdir found:\n"; - sort($dirs); - var_dump($dirs); + echo "opendir/readdir/isdir found:\n"; + sort($dirs); + var_dump($dirs); } else { - echo "OK\n"; + echo "OK\n"; } ?> --EXPECT-- diff --git a/ext/standard/tests/file/bug26615.phpt b/ext/standard/tests/file/bug26615.phpt index 3689fdfe16..8a5df91ec1 100644 --- a/ext/standard/tests/file/bug26615.phpt +++ b/ext/standard/tests/file/bug26615.phpt @@ -7,9 +7,9 @@ variables_order=E $out = array(); $status = -1; if (substr(PHP_OS, 0, 3) != 'WIN') { - exec($_ENV['TEST_PHP_EXECUTABLE'].' -n -r \'for($i=1;$i<=5000;$i++) print "$i\n";\' | tr \'\n\' \' \'', $out, $status); + exec($_ENV['TEST_PHP_EXECUTABLE'].' -n -r \'for($i=1;$i<=5000;$i++) print "$i\n";\' | tr \'\n\' \' \'', $out, $status); } else { - exec($_ENV['TEST_PHP_EXECUTABLE'].' -n -r "for($i=1;$i<=5000;$i++) echo $i,\' \';"', $out, $status); + exec($_ENV['TEST_PHP_EXECUTABLE'].' -n -r "for($i=1;$i<=5000;$i++) echo $i,\' \';"', $out, $status); } print_r($out); ?> diff --git a/ext/standard/tests/file/bug26938.phpt b/ext/standard/tests/file/bug26938.phpt index d1ad6b6526..13732c03f6 100644 --- a/ext/standard/tests/file/bug26938.phpt +++ b/ext/standard/tests/file/bug26938.phpt @@ -6,19 +6,19 @@ $out = array(); $status = -1; $php = getenv('TEST_PHP_EXECUTABLE'); if (substr(PHP_OS, 0, 3) != 'WIN') { - exec($php . ' -n -r \'' - . '$lengths = array(10,20000,10000,5,10000,3);' - . 'foreach($lengths as $length) {' - . ' for($i=0;$i<$length;$i++) print chr(65+$i % 27);' - . ' print "\n";' - . '}\'', $out, $status); + exec($php . ' -n -r \'' + . '$lengths = array(10,20000,10000,5,10000,3);' + . 'foreach($lengths as $length) {' + . ' for($i=0;$i<$length;$i++) print chr(65+$i % 27);' + . ' print "\n";' + . '}\'', $out, $status); } else { - exec($php . ' -n -r "' - . '$lengths = array(10,20000,10000,5,10000,3);' - . 'foreach($lengths as $length) {' - . ' for($i=0;$i<$length;$i++) print chr(65+$i % 27);' - . ' print \\"\\n\\";' - . '}"', $out, $status); + exec($php . ' -n -r "' + . '$lengths = array(10,20000,10000,5,10000,3);' + . 'foreach($lengths as $length) {' + . ' for($i=0;$i<$length;$i++) print chr(65+$i % 27);' + . ' print \\"\\n\\";' + . '}"', $out, $status); } for ($i=0;$i<6;$i++) print "md5(line $i)= " . md5($out[$i]) . " (length " . diff --git a/ext/standard/tests/file/bug27619.phpt b/ext/standard/tests/file/bug27619.phpt index 095a18c199..6f377b52a9 100644 --- a/ext/standard/tests/file/bug27619.phpt +++ b/ext/standard/tests/file/bug27619.phpt @@ -2,17 +2,17 @@ Bug #27619 (filters not applied to pre-buffered data) --FILE-- <?php - $fp = tmpfile(); - fwrite($fp, "this is a lowercase string.\n"); - rewind($fp); + $fp = tmpfile(); + fwrite($fp, "this is a lowercase string.\n"); + rewind($fp); - /* Echo out the first four bytes 'this' without applying filter - Remainder will get sucked into the read buffer though. */ - echo fread($fp, 4); + /* Echo out the first four bytes 'this' without applying filter + Remainder will get sucked into the read buffer though. */ + echo fread($fp, 4); - stream_filter_append($fp, "string.toupper"); + stream_filter_append($fp, "string.toupper"); - fpassthru($fp); + fpassthru($fp); ?> --EXPECT-- this IS A LOWERCASE STRING. diff --git a/ext/standard/tests/file/bug37158.phpt b/ext/standard/tests/file/bug37158.phpt index 3200a62cf9..9afeaeeb8c 100644 --- a/ext/standard/tests/file/bug37158.phpt +++ b/ext/standard/tests/file/bug37158.phpt @@ -17,7 +17,7 @@ $file = __DIR__ . '/footest.txt'; $x = str_repeat(1, 8192); $fp = fopen($file, 'w'); for ($i = 0; $i < 5; $i++) { - fwrite($fp, $x); + fwrite($fp, $x); } fclose($fp); diff --git a/ext/standard/tests/file/bug37864.phpt b/ext/standard/tests/file/bug37864.phpt index f8743bd5ec..1da8f16183 100644 --- a/ext/standard/tests/file/bug37864.phpt +++ b/ext/standard/tests/file/bug37864.phpt @@ -2,10 +2,10 @@ Bug #37864 (file_get_contents() leaks on empty file) --FILE-- <?php - $tmpfname = tempnam(sys_get_temp_dir(), "emptyfile"); - var_dump(file_get_contents($tmpfname)); - echo "done.\n"; - unlink($tmpfname); + $tmpfname = tempnam(sys_get_temp_dir(), "emptyfile"); + var_dump(file_get_contents($tmpfname)); + echo "done.\n"; + unlink($tmpfname); ?> --EXPECT-- string(0) "" diff --git a/ext/standard/tests/file/bug38450.phpt b/ext/standard/tests/file/bug38450.phpt index eae86cf9a0..a82be7848a 100644 --- a/ext/standard/tests/file/bug38450.phpt +++ b/ext/standard/tests/file/bug38450.phpt @@ -4,85 +4,85 @@ Bug #38450 (constructor is not called for classes used in userspace stream wrapp <?php class VariableStream { - var $position; - var $varname; - - function __construct($var=null) { - var_dump("constructor!"); - } - - function stream_open($path, $mode, $options, &$opened_path) - { - $url = parse_url($path); - $this->varname = $url["host"]; - $this->position = 0; - - return true; - } - - function stream_read($count) - { - $ret = substr($GLOBALS[$this->varname], $this->position, $count); - $this->position += strlen($ret); - return $ret; - } - - function stream_write($data) - { - $left = substr($GLOBALS[$this->varname], 0, $this->position); - $right = substr($GLOBALS[$this->varname], $this->position + strlen($data)); - $GLOBALS[$this->varname] = $left . $data . $right; - $this->position += strlen($data); - return strlen($data); - } - - function stream_tell() - { - return $this->position; - } - - function stream_eof() - { - return $this->position >= strlen($GLOBALS[$this->varname]); - } - function stream_seek($offset, $whence) - { - switch ($whence) { - case SEEK_SET: - if ($offset < strlen($GLOBALS[$this->varname]) && $offset >= 0) { - $this->position = $offset; - return true; - } else { - return false; - } - break; - - case SEEK_CUR: - if ($offset >= 0) { - $this->position += $offset; - return true; - } else { - return false; - } - break; - - case SEEK_END: - if (strlen($GLOBALS[$this->varname]) + $offset >= 0) { - $this->position = strlen($GLOBALS[$this->varname]) + $offset; - return true; - } else { - return false; - } - break; - - default: - return false; - } - } + var $position; + var $varname; + + function __construct($var=null) { + var_dump("constructor!"); + } + + function stream_open($path, $mode, $options, &$opened_path) + { + $url = parse_url($path); + $this->varname = $url["host"]; + $this->position = 0; + + return true; + } + + function stream_read($count) + { + $ret = substr($GLOBALS[$this->varname], $this->position, $count); + $this->position += strlen($ret); + return $ret; + } + + function stream_write($data) + { + $left = substr($GLOBALS[$this->varname], 0, $this->position); + $right = substr($GLOBALS[$this->varname], $this->position + strlen($data)); + $GLOBALS[$this->varname] = $left . $data . $right; + $this->position += strlen($data); + return strlen($data); + } + + function stream_tell() + { + return $this->position; + } + + function stream_eof() + { + return $this->position >= strlen($GLOBALS[$this->varname]); + } + function stream_seek($offset, $whence) + { + switch ($whence) { + case SEEK_SET: + if ($offset < strlen($GLOBALS[$this->varname]) && $offset >= 0) { + $this->position = $offset; + return true; + } else { + return false; + } + break; + + case SEEK_CUR: + if ($offset >= 0) { + $this->position += $offset; + return true; + } else { + return false; + } + break; + + case SEEK_END: + if (strlen($GLOBALS[$this->varname]) + $offset >= 0) { + $this->position = strlen($GLOBALS[$this->varname]) + $offset; + return true; + } else { + return false; + } + break; + + default: + return false; + } + } } stream_wrapper_register("var", "VariableStream") - or die("Failed to register protocol"); + or die("Failed to register protocol"); $myvar = ""; @@ -94,7 +94,7 @@ fwrite($fp, "line3\n"); rewind($fp); while (!feof($fp)) { - echo fgets($fp); + echo fgets($fp); } fclose($fp); var_dump($myvar); diff --git a/ext/standard/tests/file/bug38450_1.phpt b/ext/standard/tests/file/bug38450_1.phpt index 9cc383171b..6eea9e2000 100644 --- a/ext/standard/tests/file/bug38450_1.phpt +++ b/ext/standard/tests/file/bug38450_1.phpt @@ -4,85 +4,85 @@ Bug #38450 (constructor is not called for classes used in userspace stream wrapp <?php class VariableStream { - var $position; - var $varname; - - function __construct($var = null) { - var_dump("constructor!"); - } - - function stream_open($path, $mode, $options, &$opened_path) - { - $url = parse_url($path); - $this->varname = $url["host"]; - $this->position = 0; - - return true; - } - - function stream_read($count) - { - $ret = substr($GLOBALS[$this->varname], $this->position, $count); - $this->position += strlen($ret); - return $ret; - } - - function stream_write($data) - { - $left = substr($GLOBALS[$this->varname], 0, $this->position); - $right = substr($GLOBALS[$this->varname], $this->position + strlen($data)); - $GLOBALS[$this->varname] = $left . $data . $right; - $this->position += strlen($data); - return strlen($data); - } - - function stream_tell() - { - return $this->position; - } - - function stream_eof() - { - return $this->position >= strlen($GLOBALS[$this->varname]); - } - function stream_seek($offset, $whence) - { - switch ($whence) { - case SEEK_SET: - if ($offset < strlen($GLOBALS[$this->varname]) && $offset >= 0) { - $this->position = $offset; - return true; - } else { - return false; - } - break; - - case SEEK_CUR: - if ($offset >= 0) { - $this->position += $offset; - return true; - } else { - return false; - } - break; - - case SEEK_END: - if (strlen($GLOBALS[$this->varname]) + $offset >= 0) { - $this->position = strlen($GLOBALS[$this->varname]) + $offset; - return true; - } else { - return false; - } - break; - - default: - return false; - } - } + var $position; + var $varname; + + function __construct($var = null) { + var_dump("constructor!"); + } + + function stream_open($path, $mode, $options, &$opened_path) + { + $url = parse_url($path); + $this->varname = $url["host"]; + $this->position = 0; + + return true; + } + + function stream_read($count) + { + $ret = substr($GLOBALS[$this->varname], $this->position, $count); + $this->position += strlen($ret); + return $ret; + } + + function stream_write($data) + { + $left = substr($GLOBALS[$this->varname], 0, $this->position); + $right = substr($GLOBALS[$this->varname], $this->position + strlen($data)); + $GLOBALS[$this->varname] = $left . $data . $right; + $this->position += strlen($data); + return strlen($data); + } + + function stream_tell() + { + return $this->position; + } + + function stream_eof() + { + return $this->position >= strlen($GLOBALS[$this->varname]); + } + function stream_seek($offset, $whence) + { + switch ($whence) { + case SEEK_SET: + if ($offset < strlen($GLOBALS[$this->varname]) && $offset >= 0) { + $this->position = $offset; + return true; + } else { + return false; + } + break; + + case SEEK_CUR: + if ($offset >= 0) { + $this->position += $offset; + return true; + } else { + return false; + } + break; + + case SEEK_END: + if (strlen($GLOBALS[$this->varname]) + $offset >= 0) { + $this->position = strlen($GLOBALS[$this->varname]) + $offset; + return true; + } else { + return false; + } + break; + + default: + return false; + } + } } stream_wrapper_register("var", "VariableStream") - or die("Failed to register protocol"); + or die("Failed to register protocol"); $myvar = ""; @@ -94,7 +94,7 @@ fwrite($fp, "line3\n"); rewind($fp); while (!feof($fp)) { - echo fgets($fp); + echo fgets($fp); } fclose($fp); var_dump($myvar); diff --git a/ext/standard/tests/file/bug38450_2.phpt b/ext/standard/tests/file/bug38450_2.phpt index 33a13da0db..cf4cb91928 100644 --- a/ext/standard/tests/file/bug38450_2.phpt +++ b/ext/standard/tests/file/bug38450_2.phpt @@ -4,85 +4,85 @@ Bug #38450 (constructor is not called for classes used in userspace stream wrapp <?php class VariableStream { - var $position; - var $varname; - - function __construct($var = null) { - throw new Exception("constructor"); - } - - function stream_open($path, $mode, $options, &$opened_path) - { - $url = parse_url($path); - $this->varname = $url["host"]; - $this->position = 0; - - return true; - } - - function stream_read($count) - { - $ret = substr($GLOBALS[$this->varname], $this->position, $count); - $this->position += strlen($ret); - return $ret; - } - - function stream_write($data) - { - $left = substr($GLOBALS[$this->varname], 0, $this->position); - $right = substr($GLOBALS[$this->varname], $this->position + strlen($data)); - $GLOBALS[$this->varname] = $left . $data . $right; - $this->position += strlen($data); - return strlen($data); - } - - function stream_tell() - { - return $this->position; - } - - function stream_eof() - { - return $this->position >= strlen($GLOBALS[$this->varname]); - } - function stream_seek($offset, $whence) - { - switch ($whence) { - case SEEK_SET: - if ($offset < strlen($GLOBALS[$this->varname]) && $offset >= 0) { - $this->position = $offset; - return true; - } else { - return false; - } - break; - - case SEEK_CUR: - if ($offset >= 0) { - $this->position += $offset; - return true; - } else { - return false; - } - break; - - case SEEK_END: - if (strlen($GLOBALS[$this->varname]) + $offset >= 0) { - $this->position = strlen($GLOBALS[$this->varname]) + $offset; - return true; - } else { - return false; - } - break; - - default: - return false; - } - } + var $position; + var $varname; + + function __construct($var = null) { + throw new Exception("constructor"); + } + + function stream_open($path, $mode, $options, &$opened_path) + { + $url = parse_url($path); + $this->varname = $url["host"]; + $this->position = 0; + + return true; + } + + function stream_read($count) + { + $ret = substr($GLOBALS[$this->varname], $this->position, $count); + $this->position += strlen($ret); + return $ret; + } + + function stream_write($data) + { + $left = substr($GLOBALS[$this->varname], 0, $this->position); + $right = substr($GLOBALS[$this->varname], $this->position + strlen($data)); + $GLOBALS[$this->varname] = $left . $data . $right; + $this->position += strlen($data); + return strlen($data); + } + + function stream_tell() + { + return $this->position; + } + + function stream_eof() + { + return $this->position >= strlen($GLOBALS[$this->varname]); + } + function stream_seek($offset, $whence) + { + switch ($whence) { + case SEEK_SET: + if ($offset < strlen($GLOBALS[$this->varname]) && $offset >= 0) { + $this->position = $offset; + return true; + } else { + return false; + } + break; + + case SEEK_CUR: + if ($offset >= 0) { + $this->position += $offset; + return true; + } else { + return false; + } + break; + + case SEEK_END: + if (strlen($GLOBALS[$this->varname]) + $offset >= 0) { + $this->position = strlen($GLOBALS[$this->varname]) + $offset; + return true; + } else { + return false; + } + break; + + default: + return false; + } + } } stream_wrapper_register("var", "VariableStream") - or die("Failed to register protocol"); + or die("Failed to register protocol"); $myvar = ""; @@ -94,7 +94,7 @@ fwrite($fp, "line3\n"); rewind($fp); while (!feof($fp)) { - echo fgets($fp); + echo fgets($fp); } fclose($fp); var_dump($myvar); diff --git a/ext/standard/tests/file/bug38450_3.phpt b/ext/standard/tests/file/bug38450_3.phpt index 8a5c696587..cbd03e908e 100644 --- a/ext/standard/tests/file/bug38450_3.phpt +++ b/ext/standard/tests/file/bug38450_3.phpt @@ -4,85 +4,85 @@ Bug #38450 (constructor is not called for classes used in userspace stream wrapp <?php class VariableStream { - var $position; - var $varname; - - function __construct(array $var) { - var_dump("constructor!"); - } - - function stream_open($path, $mode, $options, &$opened_path) - { - $url = parse_url($path); - $this->varname = $url["host"]; - $this->position = 0; - - return true; - } - - function stream_read($count) - { - $ret = substr($GLOBALS[$this->varname], $this->position, $count); - $this->position += strlen($ret); - return $ret; - } - - function stream_write($data) - { - $left = substr($GLOBALS[$this->varname], 0, $this->position); - $right = substr($GLOBALS[$this->varname], $this->position + strlen($data)); - $GLOBALS[$this->varname] = $left . $data . $right; - $this->position += strlen($data); - return strlen($data); - } - - function stream_tell() - { - return $this->position; - } - - function stream_eof() - { - return $this->position >= strlen($GLOBALS[$this->varname]); - } - function stream_seek($offset, $whence) - { - switch ($whence) { - case SEEK_SET: - if ($offset < strlen($GLOBALS[$this->varname]) && $offset >= 0) { - $this->position = $offset; - return true; - } else { - return false; - } - break; - - case SEEK_CUR: - if ($offset >= 0) { - $this->position += $offset; - return true; - } else { - return false; - } - break; - - case SEEK_END: - if (strlen($GLOBALS[$this->varname]) + $offset >= 0) { - $this->position = strlen($GLOBALS[$this->varname]) + $offset; - return true; - } else { - return false; - } - break; - - default: - return false; - } - } + var $position; + var $varname; + + function __construct(array $var) { + var_dump("constructor!"); + } + + function stream_open($path, $mode, $options, &$opened_path) + { + $url = parse_url($path); + $this->varname = $url["host"]; + $this->position = 0; + + return true; + } + + function stream_read($count) + { + $ret = substr($GLOBALS[$this->varname], $this->position, $count); + $this->position += strlen($ret); + return $ret; + } + + function stream_write($data) + { + $left = substr($GLOBALS[$this->varname], 0, $this->position); + $right = substr($GLOBALS[$this->varname], $this->position + strlen($data)); + $GLOBALS[$this->varname] = $left . $data . $right; + $this->position += strlen($data); + return strlen($data); + } + + function stream_tell() + { + return $this->position; + } + + function stream_eof() + { + return $this->position >= strlen($GLOBALS[$this->varname]); + } + function stream_seek($offset, $whence) + { + switch ($whence) { + case SEEK_SET: + if ($offset < strlen($GLOBALS[$this->varname]) && $offset >= 0) { + $this->position = $offset; + return true; + } else { + return false; + } + break; + + case SEEK_CUR: + if ($offset >= 0) { + $this->position += $offset; + return true; + } else { + return false; + } + break; + + case SEEK_END: + if (strlen($GLOBALS[$this->varname]) + $offset >= 0) { + $this->position = strlen($GLOBALS[$this->varname]) + $offset; + return true; + } else { + return false; + } + break; + + default: + return false; + } + } } stream_wrapper_register("var", "VariableStream") - or die("Failed to register protocol"); + or die("Failed to register protocol"); $myvar = ""; @@ -94,7 +94,7 @@ fwrite($fp, "line3\n"); rewind($fp); while (!feof($fp)) { - echo fgets($fp); + echo fgets($fp); } fclose($fp); var_dump($myvar); diff --git a/ext/standard/tests/file/bug39538.phpt b/ext/standard/tests/file/bug39538.phpt index cdff507b48..5f40192ec9 100644 --- a/ext/standard/tests/file/bug39538.phpt +++ b/ext/standard/tests/file/bug39538.phpt @@ -7,8 +7,8 @@ $content = array("\"\nthis is an test\", \"next data\", \"p\narsed\"","\"\r\nthi $file = __DIR__ . "/bug39538.csv"; @unlink($file); foreach ($content as $v) { - file_put_contents($file, $v); - print_r (fgetcsv(fopen($file, "r"), filesize($file))); + file_put_contents($file, $v); + print_r (fgetcsv(fopen($file, "r"), filesize($file))); } @unlink($file); ?> diff --git a/ext/standard/tests/file/bug39551.phpt b/ext/standard/tests/file/bug39551.phpt index 2877c4951f..c3d011351e 100644 --- a/ext/standard/tests/file/bug39551.phpt +++ b/ext/standard/tests/file/bug39551.phpt @@ -6,12 +6,12 @@ Bug #39551 (Segfault with stream_bucket_new in user filter) $bucket = stream_bucket_new(fopen('php://temp', 'w+'), ''); class bucketFilter { - public function filter($in, $out, &$consumed, $closing ){ + public function filter($in, $out, &$consumed, $closing ){ - $bucket = stream_bucket_new(fopen('php://temp', 'w+'), ''); - stream_bucket_append($out, $bucket); - return PSFS_PASS_ON; - } + $bucket = stream_bucket_new(fopen('php://temp', 'w+'), ''); + stream_bucket_append($out, $bucket); + return PSFS_PASS_ON; + } } stream_filter_register('bucketfault', 'bucketFilter'); diff --git a/ext/standard/tests/file/bug39673.phpt b/ext/standard/tests/file/bug39673.phpt index 70a47e3fc1..64c66cc141 100644 --- a/ext/standard/tests/file/bug39673.phpt +++ b/ext/standard/tests/file/bug39673.phpt @@ -9,20 +9,20 @@ $filename = __DIR__.'/bug39673.txt'; file_put_contents($filename, $str); $offsets = array( - -1, - 0, - 3456*4, - 3456*4 - 1, - 3456*4 + 1, - 2000, - 5000, - 100000, + -1, + 0, + 3456*4, + 3456*4 - 1, + 3456*4 + 1, + 2000, + 5000, + 100000, ); foreach ($offsets as $offset) { - $r = file_get_contents($filename, false, null, $offset); - if ($r !== false) var_dump(strlen($r)); + $r = file_get_contents($filename, false, null, $offset); + if ($r !== false) var_dump(strlen($r)); } @unlink($filename); diff --git a/ext/standard/tests/file/bug41655_2.phpt b/ext/standard/tests/file/bug41655_2.phpt index 20c29844c1..61fdec1054 100644 --- a/ext/standard/tests/file/bug41655_2.phpt +++ b/ext/standard/tests/file/bug41655_2.phpt @@ -4,9 +4,9 @@ Bug #41655 (open_basedir bypass via glob()) 2/2 open_basedir=/ --FILE-- <?php - $dir = __DIR__; - $a=glob($dir . "/test*csv"); - print_r($a); + $dir = __DIR__; + $a=glob($dir . "/test*csv"); + print_r($a); ?> --EXPECTF-- Array diff --git a/ext/standard/tests/file/bug41815.phpt b/ext/standard/tests/file/bug41815.phpt index 58f287cedf..d77d73055b 100644 --- a/ext/standard/tests/file/bug41815.phpt +++ b/ext/standard/tests/file/bug41815.phpt @@ -12,7 +12,7 @@ fread($reader, 1); fwrite($writer, "foo"); if (strlen(fread($reader, 10)) > 0) { - echo "OK\n"; + echo "OK\n"; } fclose($writer); diff --git a/ext/standard/tests/file/bug43008.phpt b/ext/standard/tests/file/bug43008.phpt index 0d9d6ed986..60bea35429 100644 --- a/ext/standard/tests/file/bug43008.phpt +++ b/ext/standard/tests/file/bug43008.phpt @@ -9,12 +9,12 @@ allow_url_fopen=1 --FILE-- <?php $url = "" - . "php://filter/read=" - . urlencode("convert.iconv.ISO-8859-15/UTF-8") - . '|' . urlencode("string.rot13") - . '|' . urlencode("string.rot13") - . '|' . urlencode("convert.iconv.UTF-8/ISO-8859-15") - . "/resource=data://text/plain,foob%E2r"; + . "php://filter/read=" + . urlencode("convert.iconv.ISO-8859-15/UTF-8") + . '|' . urlencode("string.rot13") + . '|' . urlencode("string.rot13") + . '|' . urlencode("convert.iconv.UTF-8/ISO-8859-15") + . "/resource=data://text/plain,foob%E2r"; var_dump(urlencode(file_get_contents($url))); ?> --EXPECTF-- diff --git a/ext/standard/tests/file/bug43137.phpt b/ext/standard/tests/file/bug43137.phpt index 8125445bb0..f0f17895b7 100644 --- a/ext/standard/tests/file/bug43137.phpt +++ b/ext/standard/tests/file/bug43137.phpt @@ -2,16 +2,16 @@ Bug #43137 (rmdir() and rename() do not clear statcache) --FILE-- <?php - $toname = "TO_" . md5(microtime()); - $dirname = "FROM_" . md5(microtime()); + $toname = "TO_" . md5(microtime()); + $dirname = "FROM_" . md5(microtime()); - mkdir($dirname); - var_dump(is_dir($dirname)); // Expected: true - rename($dirname, $toname); - var_dump(is_dir($dirname)); // Expected: false - var_dump(is_dir($toname)); // Expected: true - rmdir($toname); - var_dump(is_dir($toname)); // Expected: false + mkdir($dirname); + var_dump(is_dir($dirname)); // Expected: true + rename($dirname, $toname); + var_dump(is_dir($dirname)); // Expected: false + var_dump(is_dir($toname)); // Expected: true + rmdir($toname); + var_dump(is_dir($toname)); // Expected: false ?> --EXPECT-- bool(true) diff --git a/ext/standard/tests/file/bug43522.phpt b/ext/standard/tests/file/bug43522.phpt index 10e44fc352..185f2c3697 100644 --- a/ext/standard/tests/file/bug43522.phpt +++ b/ext/standard/tests/file/bug43522.phpt @@ -9,10 +9,10 @@ DoTest($fp, 'ZZZ'); // test multi-char delimiter DoTest($fp, "Z"); // test single-char delimiter function DoTest($fp, $delim) { - echo "Delimiter: " . $delim . "\n"; - rewind($fp); - echo "\t" . stream_get_line($fp, 10, $delim) . "\n"; - echo "\t" . stream_get_line($fp, 10, $delim) . "\n"; + echo "Delimiter: " . $delim . "\n"; + rewind($fp); + echo "\t" . stream_get_line($fp, 10, $delim) . "\n"; + echo "\t" . stream_get_line($fp, 10, $delim) . "\n"; } ?> diff --git a/ext/standard/tests/file/bug44034.phpt b/ext/standard/tests/file/bug44034.phpt index 887b9eb08e..2b7e1168c8 100644 --- a/ext/standard/tests/file/bug44034.phpt +++ b/ext/standard/tests/file/bug44034.phpt @@ -11,8 +11,8 @@ $urls[] = "data://text/plain,\r\nfoo\r\nbar\r\n"; $urls[] = "data://text/plain,foo\r\nbar"; foreach($urls as $url) { - echo strtr($url, array("\r" => "\\r", "\n" => "\\n")) . "\n"; - var_dump(file($url, FILE_IGNORE_NEW_LINES)); + echo strtr($url, array("\r" => "\\r", "\n" => "\\n")) . "\n"; + var_dump(file($url, FILE_IGNORE_NEW_LINES)); } ?> --EXPECT-- diff --git a/ext/standard/tests/file/bug44805.phpt b/ext/standard/tests/file/bug44805.phpt index ac4e334f53..0b81be6a06 100644 --- a/ext/standard/tests/file/bug44805.phpt +++ b/ext/standard/tests/file/bug44805.phpt @@ -14,10 +14,10 @@ rename($file1, $file2); echo "reading file 2: "; readfile($file2); if (file_exists($file1)) { - unlink($file1); + unlink($file1); } if (file_exists($file2)) { - unlink($file2); + unlink($file2); } ?> --EXPECT-- diff --git a/ext/standard/tests/file/bug55124.phpt b/ext/standard/tests/file/bug55124.phpt index 7938196dbc..a894ff32e0 100644 --- a/ext/standard/tests/file/bug55124.phpt +++ b/ext/standard/tests/file/bug55124.phpt @@ -6,10 +6,10 @@ $old_dir_path = getcwd(); chdir(__DIR__); mkdir('a/./b', 0755, true); if (is_dir('a/b')) { - rmdir('a/b'); + rmdir('a/b'); } if (is_dir('./a')) { - rmdir('a'); + rmdir('a'); } chdir($old_dir_path); echo "OK"; diff --git a/ext/standard/tests/file/bug60120.phpt b/ext/standard/tests/file/bug60120.phpt index 77ebf086bd..9d964e34cb 100644 --- a/ext/standard/tests/file/bug60120.phpt +++ b/ext/standard/tests/file/bug60120.phpt @@ -14,7 +14,7 @@ error_reporting(E_ALL); $php = getenv('TEST_PHP_EXECUTABLE'); if (!$php) { - die("No php executable defined\n"); + die("No php executable defined\n"); } $cmd = 'php -r "fwrite(STDOUT, $in = file_get_contents(\'php://stdin\')); fwrite(STDERR, $in);"'; $descriptors = array(array('pipe', 'r'), array('pipe', 'w'), array('pipe', 'w')); diff --git a/ext/standard/tests/file/bug63512.phpt b/ext/standard/tests/file/bug63512.phpt index 9277359256..a22ba9f0cf 100644 --- a/ext/standard/tests/file/bug63512.phpt +++ b/ext/standard/tests/file/bug63512.phpt @@ -4,13 +4,13 @@ Fixed bug #63512 (parse_ini_file() with INI_SCANNER_RAW removes quotes from valu <?php $array = parse_ini_string(' - int = 123 - constant = INSTALL_ROOT - quotedString = "string" - a = INSTALL_ROOT "waa" - b = "INSTALL_ROOT" - c = "waa" INSTALL_ROOT - d = INSTALL_ROOT "INSTALL_ROOT"', false, INI_SCANNER_RAW); + int = 123 + constant = INSTALL_ROOT + quotedString = "string" + a = INSTALL_ROOT "waa" + b = "INSTALL_ROOT" + c = "waa" INSTALL_ROOT + d = INSTALL_ROOT "INSTALL_ROOT"', false, INI_SCANNER_RAW); var_dump($array); --EXPECT-- diff --git a/ext/standard/tests/file/bug65701.phpt b/ext/standard/tests/file/bug65701.phpt index c4a356b41b..f70446a17e 100644 --- a/ext/standard/tests/file/bug65701.phpt +++ b/ext/standard/tests/file/bug65701.phpt @@ -7,7 +7,7 @@ Boro Sitnikovski <buritomath@yahoo.com> $file_path = __DIR__ . "/bug65701/"; if (!is_dir($file_path)) { - mkdir($file_path); + mkdir($file_path); } $src = $file_path . '/srcbug65701_file.txt'; diff --git a/ext/standard/tests/file/bug71287.phpt b/ext/standard/tests/file/bug71287.phpt index b7987829b0..f88414f2c2 100644 --- a/ext/standard/tests/file/bug71287.phpt +++ b/ext/standard/tests/file/bug71287.phpt @@ -3,13 +3,13 @@ Bug #71287 (Error message contains hexadecimal instead of decimal number) --FILE-- <?php class Stream { - public function stream_open($path, $mode, $options, $opened_path) { - return true; - } + public function stream_open($path, $mode, $options, $opened_path) { + return true; + } - public function stream_write($data) { - return strlen($data) - 2; - } + public function stream_write($data) { + return strlen($data) - 2; + } } stream_wrapper_register('test', Stream::class); diff --git a/ext/standard/tests/file/bug72035.phpt b/ext/standard/tests/file/bug72035.phpt index 1fd5b5c148..6ed7fe470f 100644 --- a/ext/standard/tests/file/bug72035.phpt +++ b/ext/standard/tests/file/bug72035.phpt @@ -23,9 +23,9 @@ $cmd = "$cgi -n -C $fl"; $desc = array(0 => array("pipe", "r")); $proc = proc_open($cmd, $desc, $pipes, getcwd(), array()); if (is_resource($proc)) { - echo stream_get_contents($pipes[0]); + echo stream_get_contents($pipes[0]); - proc_close($proc); + proc_close($proc); } unlink($fl); diff --git a/ext/standard/tests/file/chmod_basic-win32-mb.phpt b/ext/standard/tests/file/chmod_basic-win32-mb.phpt index 3970504ddb..a3c0b62410 100644 --- a/ext/standard/tests/file/chmod_basic-win32-mb.phpt +++ b/ext/standard/tests/file/chmod_basic-win32-mb.phpt @@ -17,10 +17,10 @@ $fd = fopen($filename, "w+"); fclose($fd); for ($perms_to_set = 0777; $perms_to_set >= 0; $perms_to_set--) { - chmod($filename, $perms_to_set); - $set_perms = (fileperms($filename) & PERMISSIONS_MASK); - clearstatcache(); - printf("Setting mode %o gives mode %o\n", $perms_to_set, $set_perms); + chmod($filename, $perms_to_set); + $set_perms = (fileperms($filename) & PERMISSIONS_MASK); + clearstatcache(); + printf("Setting mode %o gives mode %o\n", $perms_to_set, $set_perms); } var_dump(chmod($filename, 0777)); diff --git a/ext/standard/tests/file/chmod_basic-win32.phpt b/ext/standard/tests/file/chmod_basic-win32.phpt index 31d44c80aa..072f98d644 100644 --- a/ext/standard/tests/file/chmod_basic-win32.phpt +++ b/ext/standard/tests/file/chmod_basic-win32.phpt @@ -17,10 +17,10 @@ $fd = fopen($filename, "w+"); fclose($fd); for ($perms_to_set = 0777; $perms_to_set >= 0; $perms_to_set--) { - chmod($filename, $perms_to_set); - $set_perms = (fileperms($filename) & PERMISSIONS_MASK); - clearstatcache(); - printf("Setting mode %o gives mode %o\n", $perms_to_set, $set_perms); + chmod($filename, $perms_to_set); + $set_perms = (fileperms($filename) & PERMISSIONS_MASK); + clearstatcache(); + printf("Setting mode %o gives mode %o\n", $perms_to_set, $set_perms); } var_dump(chmod($filename, 0777)); diff --git a/ext/standard/tests/file/chmod_basic.phpt b/ext/standard/tests/file/chmod_basic.phpt index fc983074fd..635ea8de79 100644 --- a/ext/standard/tests/file/chmod_basic.phpt +++ b/ext/standard/tests/file/chmod_basic.phpt @@ -17,12 +17,12 @@ $fd = fopen($filename, "w+"); fclose($fd); for ($perms_to_set = 07777; $perms_to_set >= 0; $perms_to_set--) { - chmod($filename, $perms_to_set); - $set_perms = (fileperms($filename) & MODE_MASK); - clearstatcache(); - if ($set_perms != $perms_to_set) { - printf("Error: %o does not match %o\n", $set_perms, $perms_to_set); - } + chmod($filename, $perms_to_set); + $set_perms = (fileperms($filename) & MODE_MASK); + clearstatcache(); + if ($set_perms != $perms_to_set) { + printf("Error: %o does not match %o\n", $set_perms, $perms_to_set); + } } var_dump(chmod($filename, 0777)); diff --git a/ext/standard/tests/file/chmod_variation1.phpt b/ext/standard/tests/file/chmod_variation1.phpt index 935d30ce55..f89c70fa5d 100644 --- a/ext/standard/tests/file/chmod_variation1.phpt +++ b/ext/standard/tests/file/chmod_variation1.phpt @@ -15,12 +15,12 @@ $dirname = __DIR__ . "/" . basename(__FILE__, ".php") . "testdir"; mkdir($dirname); for ($perms_to_set = 0777; $perms_to_set >= 0; $perms_to_set--) { - chmod($dirname, $perms_to_set); - $set_perms = (fileperms($dirname) & PERMISSIONS_MASK); - clearstatcache(); - if ($set_perms != $perms_to_set) { - printf("Error: %o does not match %o\n", $set_perms, $perms_to_set); - } + chmod($dirname, $perms_to_set); + $set_perms = (fileperms($dirname) & PERMISSIONS_MASK); + clearstatcache(); + if ($set_perms != $perms_to_set) { + printf("Error: %o does not match %o\n", $set_perms, $perms_to_set); + } } var_dump(chmod($dirname, 0777)); diff --git a/ext/standard/tests/file/dirname_basic-win32.phpt b/ext/standard/tests/file/dirname_basic-win32.phpt index f596f9a359..1ae436d1e1 100644 --- a/ext/standard/tests/file/dirname_basic-win32.phpt +++ b/ext/standard/tests/file/dirname_basic-win32.phpt @@ -20,40 +20,40 @@ echo "*** Testing dirname() : basic functionality ***\n"; // Initialise all required variables $paths = array( - '', - ' ', - 'c:', - 'c:\\', - 'c:/', - 'afile', - 'c:\test\afile', - 'c:\\test\\afile', - 'c://test//afile', - 'c:\test\afile\\', - '/usr/lib/locale/en_US', - '//usr/lib//locale/en_US', - '\\', - '\\\\', - '/', - '//', - '///', - '/usr/lib/locale/en_US/', - 'c:\windows/system32\drivers/etc\hosts', - '/usr\lib/locale\en_US', - ' c:\test\adir\afile.txt', - 'c:\test\adir\afile.txt ', - ' c:\test\adir\afile.txt ', - ' /usr/lib/locale/en_US', - '/usr/lib/locale/en_US ', - ' /usr/lib/locale/en_US ', - ' c:', - ' c:\test\adir\afile.txt', - '/usr', - '/usr/', - ); + '', + ' ', + 'c:', + 'c:\\', + 'c:/', + 'afile', + 'c:\test\afile', + 'c:\\test\\afile', + 'c://test//afile', + 'c:\test\afile\\', + '/usr/lib/locale/en_US', + '//usr/lib//locale/en_US', + '\\', + '\\\\', + '/', + '//', + '///', + '/usr/lib/locale/en_US/', + 'c:\windows/system32\drivers/etc\hosts', + '/usr\lib/locale\en_US', + ' c:\test\adir\afile.txt', + 'c:\test\adir\afile.txt ', + ' c:\test\adir\afile.txt ', + ' /usr/lib/locale/en_US', + '/usr/lib/locale/en_US ', + ' /usr/lib/locale/en_US ', + ' c:', + ' c:\test\adir\afile.txt', + '/usr', + '/usr/', + ); foreach ($paths as $path) { - var_dump( dirname($path) ); + var_dump( dirname($path) ); } ?> diff --git a/ext/standard/tests/file/dirname_basic.phpt b/ext/standard/tests/file/dirname_basic.phpt index 774192830a..75355a7135 100644 --- a/ext/standard/tests/file/dirname_basic.phpt +++ b/ext/standard/tests/file/dirname_basic.phpt @@ -20,40 +20,40 @@ echo "*** Testing dirname() : basic functionality ***\n"; // Initialise all required variables $paths = array( - '', - ' ', - 'c:', - 'c:\\', - 'c:/', - 'afile', - 'c:\test\afile', - 'c:\\test\\afile', - 'c://test//afile', - 'c:\test\afile\\', - '/usr/lib/locale/en_US', - '//usr/lib//locale/en_US', - '\\', - '\\\\', - '/', - '//', - '///', - '/usr/lib/locale/en_US/', - 'c:\windows/system32\drivers/etc\hosts', - '/usr\lib/locale\en_US', - ' c:\test\adir\afile.txt', - 'c:\test\adir\afile.txt ', - ' c:\test\adir\afile.txt ', - ' /usr/lib/locale/en_US', - '/usr/lib/locale/en_US ', - ' /usr/lib/locale/en_US ', - ' c:', - ' c:\test\adir\afile.txt', - '/usr', - '/usr/' - ); + '', + ' ', + 'c:', + 'c:\\', + 'c:/', + 'afile', + 'c:\test\afile', + 'c:\\test\\afile', + 'c://test//afile', + 'c:\test\afile\\', + '/usr/lib/locale/en_US', + '//usr/lib//locale/en_US', + '\\', + '\\\\', + '/', + '//', + '///', + '/usr/lib/locale/en_US/', + 'c:\windows/system32\drivers/etc\hosts', + '/usr\lib/locale\en_US', + ' c:\test\adir\afile.txt', + 'c:\test\adir\afile.txt ', + ' c:\test\adir\afile.txt ', + ' /usr/lib/locale/en_US', + '/usr/lib/locale/en_US ', + ' /usr/lib/locale/en_US ', + ' c:', + ' c:\test\adir\afile.txt', + '/usr', + '/usr/' + ); foreach ($paths as $path) { - var_dump( dirname($path) ); + var_dump( dirname($path) ); } ?> diff --git a/ext/standard/tests/file/dirname_no_path_normalization-win32.phpt b/ext/standard/tests/file/dirname_no_path_normalization-win32.phpt index 6098ca2694..cde1e92e24 100644 --- a/ext/standard/tests/file/dirname_no_path_normalization-win32.phpt +++ b/ext/standard/tests/file/dirname_no_path_normalization-win32.phpt @@ -10,15 +10,15 @@ if(substr(PHP_OS, 0, 3) != "WIN") $s = '/php_sanity/sanity.php?'; while (dirname($s) == "/php_sanity" && strlen($s) < 10000) { - $s .= str_repeat('X', 250); + $s .= str_repeat('X', 250); } if (strlen($s) >= 10000) { - echo "OK\n"; + echo "OK\n"; } else { - print "ERROR: " . PHP_EOL; - var_dump(dirname($s)); - var_dump(strlen($s)); + print "ERROR: " . PHP_EOL; + var_dump(dirname($s)); + var_dump(strlen($s)); } ?> --EXPECT-- diff --git a/ext/standard/tests/file/fflush_basic.phpt b/ext/standard/tests/file/fflush_basic.phpt index 2c9314394b..854a23db45 100644 --- a/ext/standard/tests/file/fflush_basic.phpt +++ b/ext/standard/tests/file/fflush_basic.phpt @@ -22,7 +22,7 @@ if($file_handle == false) exit("Error:failed to open file $filename"); if(substr(PHP_OS, 0, 3) == "WIN") { - $data = str_replace("\r",'', $data); + $data = str_replace("\r",'', $data); } // writing data to the file diff --git a/ext/standard/tests/file/fgetcsv.phpt b/ext/standard/tests/file/fgetcsv.phpt index 7a6d7d59db..17ac19ca60 100644 --- a/ext/standard/tests/file/fgetcsv.phpt +++ b/ext/standard/tests/file/fgetcsv.phpt @@ -2,39 +2,39 @@ various fgetcsv() functionality tests --FILE-- <?php - $list = array( - 'aaa,bbb', - 'aaa,"bbb"', - '"aaa","bbb"', - 'aaa,bbb', - '"aaa",bbb', - '"aaa", "bbb"', - ',', - 'aaa,', - ',"aaa"', - '"",""', - '"\\"","aaa"', - '"""""",', - '""""",aaa', - '"\\""",aaa', - 'aaa,"\\"bbb,ccc', - 'aaa,bbb ', - 'aaa,"bbb "', - 'aaa"aaa","bbb"bbb', - 'aaa"aaa""",bbb', - 'aaa"\\"a","bbb"' - ); + $list = array( + 'aaa,bbb', + 'aaa,"bbb"', + '"aaa","bbb"', + 'aaa,bbb', + '"aaa",bbb', + '"aaa", "bbb"', + ',', + 'aaa,', + ',"aaa"', + '"",""', + '"\\"","aaa"', + '"""""",', + '""""",aaa', + '"\\""",aaa', + 'aaa,"\\"bbb,ccc', + 'aaa,bbb ', + 'aaa,"bbb "', + 'aaa"aaa","bbb"bbb', + 'aaa"aaa""",bbb', + 'aaa"\\"a","bbb"' + ); - $file = __DIR__ . '/fgetcsv.csv'; - @unlink($file); - foreach ($list as $v) { - $fp = fopen($file, "w"); - fwrite($fp, $v . "\n"); - fclose($fp); + $file = __DIR__ . '/fgetcsv.csv'; + @unlink($file); + foreach ($list as $v) { + $fp = fopen($file, "w"); + fwrite($fp, $v . "\n"); + fclose($fp); - var_dump(fgetcsv(fopen($file, "r"), 1024)); - } - @unlink($file); + var_dump(fgetcsv(fopen($file, "r"), 1024)); + } + @unlink($file); ?> --EXPECT-- array(2) { diff --git a/ext/standard/tests/file/fgets_socket_variation1.phpt b/ext/standard/tests/file/fgets_socket_variation1.phpt index 429ad67d69..ac1086ef56 100644 --- a/ext/standard/tests/file/fgets_socket_variation1.phpt +++ b/ext/standard/tests/file/fgets_socket_variation1.phpt @@ -18,7 +18,7 @@ for ($i=0; $i<100; $i++) { $client = fsockopen("tcp://127.0.0.1:$port"); if (!$client) { - die("Unable to create socket"); + die("Unable to create socket"); } /* Accept that connection */ @@ -38,7 +38,7 @@ echo "\n\nClose the server side socket and read the remaining data from the clie fclose($socket); fclose($server); while(!feof($client)) { - fread($client, 1); + fread($client, 1); } echo "done\n"; diff --git a/ext/standard/tests/file/fgets_socket_variation2.phpt b/ext/standard/tests/file/fgets_socket_variation2.phpt index da1f0b47ad..88fbbd45b9 100644 --- a/ext/standard/tests/file/fgets_socket_variation2.phpt +++ b/ext/standard/tests/file/fgets_socket_variation2.phpt @@ -12,7 +12,7 @@ $fd = fopen($filename, "w+"); // populate the file with lines of data define("LINE_OF_DATA", "12345678\n"); for ($i = 0; $i < 1000; $i++) { - fwrite($fd, LINE_OF_DATA); + fwrite($fd, LINE_OF_DATA); } fclose($fd); @@ -29,7 +29,7 @@ for ($i=0; $i<100; $i++) { $client = fsockopen("tcp://127.0.0.1:$port"); if (!$client) { - die("Unable to create socket"); + die("Unable to create socket"); } /* Accept that connection */ @@ -44,16 +44,16 @@ fclose($socket); echo "\nRead lines from the client\n"; while ($line = fgets($client,256)) { - if (strcmp($line, LINE_OF_DATA) != 0) { - echo "Error - $line does not match " . LINE_OF_DATA; - break; - } + if (strcmp($line, LINE_OF_DATA) != 0) { + echo "Error - $line does not match " . LINE_OF_DATA; + break; + } } echo "\nClose the server side socket and read the remaining data from the client\n"; fclose($server); while(!feof($client)) { - fread($client, 1); + fread($client, 1); } echo "done\n"; diff --git a/ext/standard/tests/file/file.inc b/ext/standard/tests/file/file.inc index aaa151ac0d..08825f4502 100644 --- a/ext/standard/tests/file/file.inc +++ b/ext/standard/tests/file/file.inc @@ -309,7 +309,7 @@ function create_files( $file_path, /* Function: function create_links( $file_path, - $filename, + $filename, $link_count = 1, $link_type = "soft", $link_size = 1024, diff --git a/ext/standard/tests/file/file_get_contents_basic001.phpt b/ext/standard/tests/file/file_get_contents_basic001.phpt index 86569d7917..d54bf2bcb4 100644 --- a/ext/standard/tests/file/file_get_contents_basic001.phpt +++ b/ext/standard/tests/file/file_get_contents_basic001.phpt @@ -4,13 +4,13 @@ file_get_contents() test using basic syntax "Blanche V.N." <valerie_nare@yahoo.fr> --FILE-- <?php - $file_content = "Bienvenue au CodeFest a Montreal"; - $temp_filename = __DIR__."/fichier_a_lire.txt"; - $handle = fopen($temp_filename,"w"); - fwrite($handle,$file_content); - fclose($handle); - $var = file_get_contents($temp_filename); - echo $var; + $file_content = "Bienvenue au CodeFest a Montreal"; + $temp_filename = __DIR__."/fichier_a_lire.txt"; + $handle = fopen($temp_filename,"w"); + fwrite($handle,$file_content); + fclose($handle); + $var = file_get_contents($temp_filename); + echo $var; ?> --CLEAN-- <?php diff --git a/ext/standard/tests/file/file_get_contents_error001.phpt b/ext/standard/tests/file/file_get_contents_error001.phpt index 45c376b913..0bbce038e6 100644 --- a/ext/standard/tests/file/file_get_contents_error001.phpt +++ b/ext/standard/tests/file/file_get_contents_error001.phpt @@ -11,7 +11,7 @@ display_errors=false ?> --FILE-- <?php - var_dump(file_get_contents("php://stdin",null,null,8000,1)); + var_dump(file_get_contents("php://stdin",null,null,8000,1)); ?> --EXPECT-- bool(false) diff --git a/ext/standard/tests/file/file_put_contents_variation2.phpt b/ext/standard/tests/file/file_put_contents_variation2.phpt index 279291f2cf..098ed37589 100644 --- a/ext/standard/tests/file/file_put_contents_variation2.phpt +++ b/ext/standard/tests/file/file_put_contents_variation2.phpt @@ -14,10 +14,10 @@ echo "*** Testing file_put_contents() : usage variation ***\n"; // Define error handler function test_error_handler($err_no, $err_msg, $filename, $linenum) { - if (error_reporting() & $err_no) { - // report non-silenced errors - echo "Error: $err_no - $err_msg\n"; - } + if (error_reporting() & $err_no) { + // report non-silenced errors + echo "Error: $err_no - $err_msg\n"; + } } set_error_handler('test_error_handler'); @@ -34,9 +34,9 @@ unset ($unset_var); // define some classes class classWithToString { - public function __toString() { - return "Class A object"; - } + public function __toString() { + return "Class A object"; + } } class classWithoutToString diff --git a/ext/standard/tests/file/file_variation6.phpt b/ext/standard/tests/file/file_variation6.phpt index b8078d2bd1..e5d8b6d51a 100644 --- a/ext/standard/tests/file/file_variation6.phpt +++ b/ext/standard/tests/file/file_variation6.phpt @@ -10,7 +10,7 @@ fclose($fd); for ($flags = 0; $flags <= 32; $flags++) { try { - var_dump(file($filepath, $flags)); + var_dump(file($filepath, $flags)); } catch (\ValueError $e) { echo $e->getMessage() . \PHP_EOL; } diff --git a/ext/standard/tests/file/file_variation9.phpt b/ext/standard/tests/file/file_variation9.phpt index 13860878d9..39f58aa788 100644 --- a/ext/standard/tests/file/file_variation9.phpt +++ b/ext/standard/tests/file/file_variation9.phpt @@ -27,7 +27,7 @@ foreach ($contents as $content) { fwrite($h, $content); fclose($h); var_dump(file($testfile)); - unlink($testfile); + unlink($testfile); } echo "\n*** Done ***\n"; diff --git a/ext/standard/tests/file/fopen_include_path.inc b/ext/standard/tests/file/fopen_include_path.inc index e33dae4915..160f9aee5f 100644 --- a/ext/standard/tests/file/fopen_include_path.inc +++ b/ext/standard/tests/file/fopen_include_path.inc @@ -11,82 +11,82 @@ $newdirs = array($dir1, $dir2, $dir3); $reldirs = array("dir1", "dir2", "dir3"); function generate_next_rel_path() { - global $reldirs; - //create the include directory structure - $pathSep = ":"; - $newIncludePath = ""; - if(substr(PHP_OS, 0, 3) == 'WIN' ) { - $pathSep = ";"; - } - foreach($reldirs as $newdir) { - $newIncludePath .= $newdir.$pathSep; - } - return "dir4".$pathSep . $newIncludePath; + global $reldirs; + //create the include directory structure + $pathSep = ":"; + $newIncludePath = ""; + if(substr(PHP_OS, 0, 3) == 'WIN' ) { + $pathSep = ";"; + } + foreach($reldirs as $newdir) { + $newIncludePath .= $newdir.$pathSep; + } + return "dir4".$pathSep . $newIncludePath; } function generate_next_path() { - global $newdirs, $dir4; - //create the include directory structure - $pathSep = ":"; - $newIncludePath = ""; - if(substr(PHP_OS, 0, 3) == 'WIN' ) { - $pathSep = ";"; - } - foreach($newdirs as $newdir) { - $newIncludePath .= $newdir.$pathSep; - } - return $dir4.$pathSep . $newIncludePath; + global $newdirs, $dir4; + //create the include directory structure + $pathSep = ":"; + $newIncludePath = ""; + if(substr(PHP_OS, 0, 3) == 'WIN' ) { + $pathSep = ";"; + } + foreach($newdirs as $newdir) { + $newIncludePath .= $newdir.$pathSep; + } + return $dir4.$pathSep . $newIncludePath; } function create_include_path() { - global $newdirs; - //create the include directory structure - $pathSep = ":"; - $newIncludePath = ""; - if(substr(PHP_OS, 0, 3) == 'WIN' ) { - $pathSep = ";"; - } - foreach($newdirs as $newdir) { - mkdir($newdir); - $newIncludePath .= $newdir.$pathSep; - } - return $newIncludePath; + global $newdirs; + //create the include directory structure + $pathSep = ":"; + $newIncludePath = ""; + if(substr(PHP_OS, 0, 3) == 'WIN' ) { + $pathSep = ";"; + } + foreach($newdirs as $newdir) { + mkdir($newdir); + $newIncludePath .= $newdir.$pathSep; + } + return $newIncludePath; } function relative_include_path() { - global $reldirs; - //create the include directory structure - $pathSep = ":"; - $newIncludePath = ""; - if(substr(PHP_OS, 0, 3) == 'WIN' ) { - $pathSep = ";"; - } - foreach($reldirs as $newdir) { - mkdir($newdir); - $newIncludePath .= $newdir.$pathSep; - } - return $newIncludePath; + global $reldirs; + //create the include directory structure + $pathSep = ":"; + $newIncludePath = ""; + if(substr(PHP_OS, 0, 3) == 'WIN' ) { + $pathSep = ";"; + } + foreach($reldirs as $newdir) { + mkdir($newdir); + $newIncludePath .= $newdir.$pathSep; + } + return $newIncludePath; } function teardown_include_path() { - global $newdirs; - // remove the directory structure - foreach($newdirs as $newdir) { - rmdir($newdir); - } + global $newdirs; + // remove the directory structure + foreach($newdirs as $newdir) { + rmdir($newdir); + } } function teardown_relative_path() { - global $reldirs; - // remove the directory structure - foreach($reldirs as $newdir) { - rmdir($newdir); - } + global $reldirs; + // remove the directory structure + foreach($reldirs as $newdir) { + rmdir($newdir); + } } ?> diff --git a/ext/standard/tests/file/fopen_unlink.phpt b/ext/standard/tests/file/fopen_unlink.phpt index c87a8bb055..8e66ae0608 100644 --- a/ext/standard/tests/file/fopen_unlink.phpt +++ b/ext/standard/tests/file/fopen_unlink.phpt @@ -4,17 +4,17 @@ Test fopen() function : check fopen()ed descriptor is usable after the fs object <?php var_dump( - $p = __DIR__ . DIRECTORY_SEPARATOR . 'tututu', - $f = fopen($p, 'w+'), - unlink($p), - file_exists($p), - fwrite($f, 'hello'), - fseek($f, 0), - fread($f, 16), - fwrite($f, 'world'), - fseek($f, 0), - fread($f, 16), - fclose($f) + $p = __DIR__ . DIRECTORY_SEPARATOR . 'tututu', + $f = fopen($p, 'w+'), + unlink($p), + file_exists($p), + fwrite($f, 'hello'), + fseek($f, 0), + fread($f, 16), + fwrite($f, 'world'), + fseek($f, 0), + fread($f, 16), + fclose($f) ); ?> diff --git a/ext/standard/tests/file/fopen_variation12.phpt b/ext/standard/tests/file/fopen_variation12.phpt index 8786337e23..1ac67df048 100644 --- a/ext/standard/tests/file/fopen_variation12.phpt +++ b/ext/standard/tests/file/fopen_variation12.phpt @@ -15,33 +15,33 @@ testme(); function testme() { - $tmpfile = basename(__FILE__, ".php") . ".tmp"; - $h = fopen($tmpfile, "w", true); - fwrite($h, "This is the test file"); - fclose($h); + $tmpfile = basename(__FILE__, ".php") . ".tmp"; + $h = fopen($tmpfile, "w", true); + fwrite($h, "This is the test file"); + fclose($h); - $h = @fopen($tmpfile, "r"); - if ($h === false) { - echo "Not created in working dir\n"; - } - else { - echo "created in working dir\n"; - fclose($h); - unlink($tmpfile); - } + $h = @fopen($tmpfile, "r"); + if ($h === false) { + echo "Not created in working dir\n"; + } + else { + echo "created in working dir\n"; + fclose($h); + unlink($tmpfile); + } - $scriptDirFile = __DIR__.'/'.$tmpfile; - $h = @fopen($scriptDirFile, "r"); - if ($h === false) { - echo "Not created in script dir\n"; - } - else { - echo "created in script dir\n"; - fclose($h); - unlink($scriptDirFile); - } + $scriptDirFile = __DIR__.'/'.$tmpfile; + $h = @fopen($scriptDirFile, "r"); + if ($h === false) { + echo "Not created in script dir\n"; + } + else { + echo "created in script dir\n"; + fclose($h); + unlink($scriptDirFile); + } } ?> --EXPECT-- diff --git a/ext/standard/tests/file/fopen_variation13.phpt b/ext/standard/tests/file/fopen_variation13.phpt index 0609f42d3b..0c446485a3 100644 --- a/ext/standard/tests/file/fopen_variation13.phpt +++ b/ext/standard/tests/file/fopen_variation13.phpt @@ -25,23 +25,23 @@ teardown_include_path(); function runtest() { $tempDir = 'fopen_variation13.dir.tmp'; - $tmpfile = 'fopen_variation13.tmp'; - $absFile = getcwd().'/'.$tempDir.'/'.$tmpfile; - - mkdir($tempDir); - $h = fopen($absFile, "w", true); - fwrite($h, "This is the test file"); - fclose($h); - - - $h = fopen($absFile, "r"); - if ($h === false) { - echo "Not created absolute location\n"; - } - else { - echo "Created in correct location\n"; - fclose($h); - } + $tmpfile = 'fopen_variation13.tmp'; + $absFile = getcwd().'/'.$tempDir.'/'.$tmpfile; + + mkdir($tempDir); + $h = fopen($absFile, "w", true); + fwrite($h, "This is the test file"); + fclose($h); + + + $h = fopen($absFile, "r"); + if ($h === false) { + echo "Not created absolute location\n"; + } + else { + echo "Created in correct location\n"; + fclose($h); + } unlink($absFile); rmdir($tempDir); diff --git a/ext/standard/tests/file/fopen_variation14-win32.phpt b/ext/standard/tests/file/fopen_variation14-win32.phpt index 470a2efd1e..f989e8c420 100644 --- a/ext/standard/tests/file/fopen_variation14-win32.phpt +++ b/ext/standard/tests/file/fopen_variation14-win32.phpt @@ -78,21 +78,21 @@ function runtest($fileURIs) { // create the file to test write $h = fopen($fileURI, 'w'); if ($h !== false) { - fwrite($h, $writeData); - fclose($h); - - $h = fopen($absFile, 'r'); - if ($h !== false) { - if (fread($h, 4096) != $writeData) { - echo "contents not correct\n"; - } - else { - echo "test passed\n"; - } - fclose($h); - } - unlink($absFile); - } + fwrite($h, $writeData); + fclose($h); + + $h = fopen($absFile, 'r'); + if ($h !== false) { + if (fread($h, 4096) != $writeData) { + echo "contents not correct\n"; + } + else { + echo "test passed\n"; + } + fclose($h); + } + unlink($absFile); + } } } diff --git a/ext/standard/tests/file/fopen_variation14.phpt b/ext/standard/tests/file/fopen_variation14.phpt index df9f115d14..fc98194d34 100644 --- a/ext/standard/tests/file/fopen_variation14.phpt +++ b/ext/standard/tests/file/fopen_variation14.phpt @@ -70,21 +70,21 @@ function runtest($fileURIs) { // create the file to test write $h = fopen($fileURI, 'w'); if ($h !== false) { - fwrite($h, $writeData); - fclose($h); - - $h = fopen($absFile, 'r'); - if ($h !== false) { - if (fread($h, 4096) != $writeData) { - echo "contents not correct\n"; - } - else { - echo "test passed\n"; - } - fclose($h); - } - unlink($absFile); - } + fwrite($h, $writeData); + fclose($h); + + $h = fopen($absFile, 'r'); + if ($h !== false) { + if (fread($h, 4096) != $writeData) { + echo "contents not correct\n"; + } + else { + echo "test passed\n"; + } + fclose($h); + } + unlink($absFile); + } } } diff --git a/ext/standard/tests/file/fopen_variation15-win32.phpt b/ext/standard/tests/file/fopen_variation15-win32.phpt index 9daac25c00..f263b1b393 100644 --- a/ext/standard/tests/file/fopen_variation15-win32.phpt +++ b/ext/standard/tests/file/fopen_variation15-win32.phpt @@ -82,21 +82,21 @@ function runtest($fileURIs) { // create the file to test write $h = fopen($fileURI, 'w', true); if ($h !== false) { - fwrite($h, $writeData); - fclose($h); - - $h = fopen($absFile, 'r'); - if ($h !== false) { - if (fread($h, 4096) != $writeData) { - echo "contents not correct\n"; - } - else { - echo "test passed\n"; - } - fclose($h); - } - unlink($absFile); - } + fwrite($h, $writeData); + fclose($h); + + $h = fopen($absFile, 'r'); + if ($h !== false) { + if (fread($h, 4096) != $writeData) { + echo "contents not correct\n"; + } + else { + echo "test passed\n"; + } + fclose($h); + } + unlink($absFile); + } } } diff --git a/ext/standard/tests/file/fopen_variation15.phpt b/ext/standard/tests/file/fopen_variation15.phpt index 36b1455250..a86b7d9642 100644 --- a/ext/standard/tests/file/fopen_variation15.phpt +++ b/ext/standard/tests/file/fopen_variation15.phpt @@ -74,21 +74,21 @@ function runtest($fileURIs) { // create the file to test write $h = fopen($fileURI, 'w', true); if ($h !== false) { - fwrite($h, $writeData); - fclose($h); - - $h = fopen($absFile, 'r'); - if ($h !== false) { - if (fread($h, 4096) != $writeData) { - echo "contents not correct\n"; - } - else { - echo "test passed\n"; - } - fclose($h); - } - unlink($absFile); - } + fwrite($h, $writeData); + fclose($h); + + $h = fopen($absFile, 'r'); + if ($h !== false) { + if (fread($h, 4096) != $writeData) { + echo "contents not correct\n"; + } + else { + echo "test passed\n"; + } + fclose($h); + } + unlink($absFile); + } } } diff --git a/ext/standard/tests/file/fopen_variation16.phpt b/ext/standard/tests/file/fopen_variation16.phpt index 6fe240bec9..fa2fc02682 100644 --- a/ext/standard/tests/file/fopen_variation16.phpt +++ b/ext/standard/tests/file/fopen_variation16.phpt @@ -36,31 +36,31 @@ function runtest() { mkdir($dir1.'/'.$extraDir); mkdir($extraDir); - $tmpfile = $extraDir.'/fopen_variation16.tmp'; + $tmpfile = $extraDir.'/fopen_variation16.tmp'; - $h = fopen($tmpfile, "w+", true); - fwrite($h, "This is the test file"); - fclose($h); + $h = fopen($tmpfile, "w+", true); + fwrite($h, "This is the test file"); + fclose($h); - $h = @fopen($dir1.'/'.$tmpfile, "r"); - if ($h === false) { - echo "Not created in dir1\n"; - } - else { - echo "created in dir1\n"; - fclose($h); - } + $h = @fopen($dir1.'/'.$tmpfile, "r"); + if ($h === false) { + echo "Not created in dir1\n"; + } + else { + echo "created in dir1\n"; + fclose($h); + } - $h = fopen($tmpfile, "r", true); - if ($h === false) { - echo "could not find file for reading\n"; - } - else { - echo "found file - not in dir1\n"; - fclose($h); - } + $h = fopen($tmpfile, "r", true); + if ($h === false) { + echo "could not find file for reading\n"; + } + else { + echo "found file - not in dir1\n"; + fclose($h); + } - unlink($tmpfile); + unlink($tmpfile); rmdir($dir1.'/'.$extraDir); rmdir($extraDir); } diff --git a/ext/standard/tests/file/fopen_variation17.phpt b/ext/standard/tests/file/fopen_variation17.phpt index 851493eb08..9565cf614c 100644 --- a/ext/standard/tests/file/fopen_variation17.phpt +++ b/ext/standard/tests/file/fopen_variation17.phpt @@ -36,30 +36,30 @@ function runtest() { mkdir($dir1.'/'.$extraDir); mkdir($extraDir); - $tmpfile = $extraDir . '/' . basename(__FILE__, ".php") . ".tmp"; - $h = fopen($tmpfile, "w+", true); - fwrite($h, "This is the test file"); - fclose($h); + $tmpfile = $extraDir . '/' . basename(__FILE__, ".php") . ".tmp"; + $h = fopen($tmpfile, "w+", true); + fwrite($h, "This is the test file"); + fclose($h); - $h = @fopen($dir1.'/'.$tmpfile, "r"); - if ($h === false) { - echo "Not created in dir1\n"; - } - else { - echo "created in dir1\n"; - fclose($h); - } + $h = @fopen($dir1.'/'.$tmpfile, "r"); + if ($h === false) { + echo "Not created in dir1\n"; + } + else { + echo "created in dir1\n"; + fclose($h); + } - $h = fopen($tmpfile, "r", true); - if ($h === false) { - echo "could not find file for reading\n"; - } - else { - echo "found file for reading\n"; - fclose($h); - } + $h = fopen($tmpfile, "r", true); + if ($h === false) { + echo "could not find file for reading\n"; + } + else { + echo "found file for reading\n"; + fclose($h); + } - unlink($tmpfile); + unlink($tmpfile); rmdir($dir1.'/'.$extraDir); rmdir($extraDir); } diff --git a/ext/standard/tests/file/fopen_variation7.phpt b/ext/standard/tests/file/fopen_variation7.phpt index c4800ae9b2..2a1e0268bc 100644 --- a/ext/standard/tests/file/fopen_variation7.phpt +++ b/ext/standard/tests/file/fopen_variation7.phpt @@ -29,31 +29,31 @@ rmdir($thisTestDir); function runtest() { global $dir1; - $tmpfile = basename(__FILE__, ".php") . ".tmp"; - $h = fopen($tmpfile, "w", true); - fwrite($h, "This is the test file"); - fclose($h); - - - $h = @fopen($tmpfile, "r"); - if ($h === false) { - echo "Not created in working dir\n"; - } - else { - echo "created in working dir\n"; - fclose($h); - unlink($tmpfile); - } - - $h = @fopen($dir1.'/'.$tmpfile, "r"); - if ($h === false) { - echo "Not created in dir1\n"; - } - else { - echo "created in dir1\n"; - fclose($h); - unlink($dir1.'/'.$tmpfile); - } + $tmpfile = basename(__FILE__, ".php") . ".tmp"; + $h = fopen($tmpfile, "w", true); + fwrite($h, "This is the test file"); + fclose($h); + + + $h = @fopen($tmpfile, "r"); + if ($h === false) { + echo "Not created in working dir\n"; + } + else { + echo "created in working dir\n"; + fclose($h); + unlink($tmpfile); + } + + $h = @fopen($dir1.'/'.$tmpfile, "r"); + if ($h === false) { + echo "Not created in dir1\n"; + } + else { + echo "created in dir1\n"; + fclose($h); + unlink($dir1.'/'.$tmpfile); + } } ?> --EXPECT-- diff --git a/ext/standard/tests/file/fopen_variation9.phpt b/ext/standard/tests/file/fopen_variation9.phpt index 0f1c2bafb8..850bf138d6 100644 --- a/ext/standard/tests/file/fopen_variation9.phpt +++ b/ext/standard/tests/file/fopen_variation9.phpt @@ -29,31 +29,31 @@ chdir(".."); rmdir($thisTestDir); function runtest() { - $tmpfile = basename(__FILE__, ".php") . ".tmp"; - $h = fopen($tmpfile, "w", true); - fwrite($h, "This is the test file"); - fclose($h); - - - $h = @fopen($tmpfile, "r"); - if ($h === false) { - echo "Not created in working dir\n"; - } - else { - echo "created in working dir\n"; - fclose($h); - unlink($tmpfile); - } - - $h = @fopen('dir1/'.$tmpfile, "r"); - if ($h === false) { - echo "Not created in dir1\n"; - } - else { - echo "created in dir1\n"; - fclose($h); - unlink('dir1/'.$tmpfile); - } + $tmpfile = basename(__FILE__, ".php") . ".tmp"; + $h = fopen($tmpfile, "w", true); + fwrite($h, "This is the test file"); + fclose($h); + + + $h = @fopen($tmpfile, "r"); + if ($h === false) { + echo "Not created in working dir\n"; + } + else { + echo "created in working dir\n"; + fclose($h); + unlink($tmpfile); + } + + $h = @fopen('dir1/'.$tmpfile, "r"); + if ($h === false) { + echo "Not created in dir1\n"; + } + else { + echo "created in dir1\n"; + fclose($h); + unlink('dir1/'.$tmpfile); + } } ?> --EXPECT-- diff --git a/ext/standard/tests/file/fopencookie.phpt b/ext/standard/tests/file/fopencookie.phpt index 20fd181cbd..03c9a84cd4 100644 --- a/ext/standard/tests/file/fopencookie.phpt +++ b/ext/standard/tests/file/fopencookie.phpt @@ -17,68 +17,68 @@ fopencookie detected and working (or cast mechanism works) */ class userstream { - public $position = 0; - public $data = "If you can read this, it worked"; + public $position = 0; + public $data = "If you can read this, it worked"; - function stream_open($path, $mode, $options, &$opened_path) - { - return true; - } + function stream_open($path, $mode, $options, &$opened_path) + { + return true; + } - function stream_read($count) - { - $ret = substr($this->data, $this->position, $count); - $this->position += strlen($ret); - return $ret; - } + function stream_read($count) + { + $ret = substr($this->data, $this->position, $count); + $this->position += strlen($ret); + return $ret; + } - function stream_tell() - { - return $this->position; - } + function stream_tell() + { + return $this->position; + } - function stream_eof() - { - return $this->position >= strlen($this->data); - } + function stream_eof() + { + return $this->position >= strlen($this->data); + } - function stream_seek($offset, $whence) - { - switch($whence) { - case SEEK_SET: - if ($offset < strlen($this->data) && $offset >= 0) { - $this->position = $offset; - return true; - } else { - return false; - } - break; - case SEEK_CUR: - if ($offset >= 0) { - $this->position += $offset; - return true; - } else { - return false; - } - break; - case SEEK_END: - if (strlen($this->data) + $offset >= 0) { - $this->position = strlen($this->data) + $offset; - return true; - } else { - return false; - } - break; - default: - return false; - } - } - function stream_stat() { - return array('size' => strlen($this->data)); - } - function stream_set_option($option, $arg1, $arg2) { - return false; - } + function stream_seek($offset, $whence) + { + switch($whence) { + case SEEK_SET: + if ($offset < strlen($this->data) && $offset >= 0) { + $this->position = $offset; + return true; + } else { + return false; + } + break; + case SEEK_CUR: + if ($offset >= 0) { + $this->position += $offset; + return true; + } else { + return false; + } + break; + case SEEK_END: + if (strlen($this->data) + $offset >= 0) { + $this->position = strlen($this->data) + $offset; + return true; + } else { + return false; + } + break; + default: + return false; + } + } + function stream_stat() { + return array('size' => strlen($this->data)); + } + function stream_set_option($option, $arg1, $arg2) { + return false; + } } stream_wrapper_register("cookietest", "userstream"); diff --git a/ext/standard/tests/file/fpassthru_basic.phpt b/ext/standard/tests/file/fpassthru_basic.phpt index f453a484f9..3304de406d 100644 --- a/ext/standard/tests/file/fpassthru_basic.phpt +++ b/ext/standard/tests/file/fpassthru_basic.phpt @@ -14,7 +14,7 @@ $write_handle = fopen($file_name, "w"); $string = "Hello, world\n, abcdefg\tadsdsfdf\n8u2394723947\t$%$%#$%#$%#^#%^ Hello, world\n, abcdefg\tadsdsfdf\n8u2394723947\t$%$%#$%#$%#^#%^\n"; if(substr(PHP_OS, 0, 3) == "WIN") { - $string = str_replace("\r",'', $string); + $string = str_replace("\r",'', $string); } fwrite($write_handle, $string); fclose($write_handle); diff --git a/ext/standard/tests/file/fputcsv.phpt b/ext/standard/tests/file/fputcsv.phpt index f7286254f2..b303554e9c 100644 --- a/ext/standard/tests/file/fputcsv.phpt +++ b/ext/standard/tests/file/fputcsv.phpt @@ -31,14 +31,14 @@ $file = __DIR__ . '/fputcsv.csv'; $fp = fopen($file, "w"); foreach ($list as $v) { - fputcsv($fp, explode(',', $v)); + fputcsv($fp, explode(',', $v)); } fclose($fp); $res = file($file); foreach($res as &$val) { - $val = substr($val, 0, -1); + $val = substr($val, 0, -1); } echo '$list = ';var_export($res);echo ";\n"; @@ -46,7 +46,7 @@ $fp = fopen($file, "r"); $res = array(); while($l=fgetcsv($fp)) { - $res[] = join(',',$l); + $res[] = join(',',$l); } fclose($fp); diff --git a/ext/standard/tests/file/fputcsv_variation15.phpt b/ext/standard/tests/file/fputcsv_variation15.phpt index 1715d09e28..150fdd69d5 100644 --- a/ext/standard/tests/file/fputcsv_variation15.phpt +++ b/ext/standard/tests/file/fputcsv_variation15.phpt @@ -33,14 +33,14 @@ $file = __DIR__ . '/fputcsv_variation15.csv'; $fp = fopen($file, "w"); foreach ($list as $v) { - fputcsv($fp, explode(',', $v), ',', '"', '/'); + fputcsv($fp, explode(',', $v), ',', '"', '/'); } fclose($fp); $res = file($file); foreach($res as &$val) { - $val = substr($val, 0, -1); + $val = substr($val, 0, -1); } echo '$list = ';var_export($res);echo ";\n"; @@ -48,7 +48,7 @@ $fp = fopen($file, "r"); $res = array(); while($l=fgetcsv($fp, 0, ',', '"', '/')) { - $res[] = join(',',$l); + $res[] = join(',',$l); } fclose($fp); diff --git a/ext/standard/tests/file/fscanf_variation19.phpt b/ext/standard/tests/file/fscanf_variation19.phpt index bfb5d40223..31cc83297b 100644 --- a/ext/standard/tests/file/fscanf_variation19.phpt +++ b/ext/standard/tests/file/fscanf_variation19.phpt @@ -31,8 +31,8 @@ $bool_types = array ( $string_formats = array( "%s", "%hs", "%ls", "%Ls", " %s", "%s ", "% s", - "\t%s", "\n%s", "%4s", - "%30s", "%[a-zA-Z0-9]", "%*s"); + "\t%s", "\n%s", "%4s", + "%30s", "%[a-zA-Z0-9]", "%*s"); $counter = 1; diff --git a/ext/standard/tests/file/fscanf_variation20.phpt b/ext/standard/tests/file/fscanf_variation20.phpt index 10f3a2142d..34dac83bf1 100644 --- a/ext/standard/tests/file/fscanf_variation20.phpt +++ b/ext/standard/tests/file/fscanf_variation20.phpt @@ -43,10 +43,10 @@ $valid_ints = array( ); // various char formats $char_formats = array( "%c", - "%hc", "%lc", "%Lc", - " %c", "%c ", "% c", - "\t%c", "\n%c", "%4c", - "%30c", "%[a-bA-B@#$&]", "%*c"); + "%hc", "%lc", "%Lc", + " %c", "%c ", "% c", + "\t%c", "\n%c", "%4c", + "%30c", "%[a-bA-B@#$&]", "%*c"); $counter = 1; diff --git a/ext/standard/tests/file/fscanf_variation21.phpt b/ext/standard/tests/file/fscanf_variation21.phpt index 39958c8de8..e0c8074ead 100644 --- a/ext/standard/tests/file/fscanf_variation21.phpt +++ b/ext/standard/tests/file/fscanf_variation21.phpt @@ -42,9 +42,9 @@ $float_values = array ( $char_formats = array( "%c", "%hc", "%lc", "%Lc", - " %c", "%c ", "% c", - "\t%c", "\n%c", "%4c", - "%30c", "%[a-zA-Z@#$&0-9]", "%*c"); + " %c", "%c ", "% c", + "\t%c", "\n%c", "%4c", + "%30c", "%[a-zA-Z@#$&0-9]", "%*c"); $counter = 1; diff --git a/ext/standard/tests/file/fscanf_variation22.phpt b/ext/standard/tests/file/fscanf_variation22.phpt index b5656ce907..2fb450750d 100644 --- a/ext/standard/tests/file/fscanf_variation22.phpt +++ b/ext/standard/tests/file/fscanf_variation22.phpt @@ -32,10 +32,10 @@ $resource_types = array ( ); $char_formats = array( "%c", - "%hc", "%lc", "%Lc", - " %c", "%c ", "% c", - "\t%c", "\n%c", "%4c", - "%30c", "%[a-zA-Z@#$&0-9]", "%*c"); + "%hc", "%lc", "%Lc", + " %c", "%c ", "% c", + "\t%c", "\n%c", "%4c", + "%30c", "%[a-zA-Z@#$&0-9]", "%*c"); $counter = 1; diff --git a/ext/standard/tests/file/fscanf_variation23.phpt b/ext/standard/tests/file/fscanf_variation23.phpt index 61d62fc05c..e8b9c0dae2 100644 --- a/ext/standard/tests/file/fscanf_variation23.phpt +++ b/ext/standard/tests/file/fscanf_variation23.phpt @@ -37,10 +37,10 @@ $array_types = array ( ); $char_formats = array( "%c", - "%hc", "%lc", "%Lc", - " %c", "%c ", "% c", - "\t%c", "\n%c", "%4c", - "%30c", "%[a-zA-Z@#$&0-9]", "%*c"); + "%hc", "%lc", "%Lc", + " %c", "%c ", "% c", + "\t%c", "\n%c", "%4c", + "%30c", "%[a-zA-Z@#$&0-9]", "%*c"); $counter = 1; diff --git a/ext/standard/tests/file/fscanf_variation24.phpt b/ext/standard/tests/file/fscanf_variation24.phpt index 1177e2e2d0..576919c886 100644 --- a/ext/standard/tests/file/fscanf_variation24.phpt +++ b/ext/standard/tests/file/fscanf_variation24.phpt @@ -43,10 +43,10 @@ $strings = array ( ); $char_formats = array( "%c", - "%hc", "%lc", "%Lc", - " %c", "%c ", "% c", - "\t%c", "\n%c", "%4c", - "%30c", "%[a-zA-Z@#$&0-9]", "%*c"); + "%hc", "%lc", "%Lc", + " %c", "%c ", "% c", + "\t%c", "\n%c", "%4c", + "%30c", "%[a-zA-Z@#$&0-9]", "%*c"); $counter = 1; diff --git a/ext/standard/tests/file/fscanf_variation25.phpt b/ext/standard/tests/file/fscanf_variation25.phpt index ba37a07a3e..0fea04e438 100644 --- a/ext/standard/tests/file/fscanf_variation25.phpt +++ b/ext/standard/tests/file/fscanf_variation25.phpt @@ -29,10 +29,10 @@ $bool_types = array ( ); $char_formats = array( "%c", - "%hc", "%lc", "%Lc", - " %c", "%c ", "% c", - "\t%c", "\n%c", "%4c", - "%30c", "%[a-zA-Z@#$&0-9]", "%*c"); + "%hc", "%lc", "%Lc", + " %c", "%c ", "% c", + "\t%c", "\n%c", "%4c", + "%30c", "%[a-zA-Z@#$&0-9]", "%*c"); $counter = 1; diff --git a/ext/standard/tests/file/fscanf_variation26.phpt b/ext/standard/tests/file/fscanf_variation26.phpt index bd499d37c5..5b1c5b0428 100644 --- a/ext/standard/tests/file/fscanf_variation26.phpt +++ b/ext/standard/tests/file/fscanf_variation26.phpt @@ -24,10 +24,10 @@ if($file_handle == false) $char_types = array( 'a', "a", 67, -67, 99 ); $char_formats = array( "%c", - "%hc", "%lc", "%Lc", - " %c", "%c ", "% c", - "\t%c", "\n%c", "%4c", - "%30c", "%[a-zA-Z@#$&0-9]", "%*c"); + "%hc", "%lc", "%Lc", + " %c", "%c ", "% c", + "\t%c", "\n%c", "%4c", + "%30c", "%[a-zA-Z@#$&0-9]", "%*c"); $counter = 1; diff --git a/ext/standard/tests/file/fscanf_variation29.phpt b/ext/standard/tests/file/fscanf_variation29.phpt index 1d25e81ceb..1621958fa4 100644 --- a/ext/standard/tests/file/fscanf_variation29.phpt +++ b/ext/standard/tests/file/fscanf_variation29.phpt @@ -32,11 +32,11 @@ $resource_types = array ( ); $octal_formats = array( "%o", - "%ho", "%lo", "%Lo", - " %o", "%o ", "% o", - "\t%o", "\n%o", "%4o", - "%30o", "%[0-7]", "%*o" - ); + "%ho", "%lo", "%Lo", + " %o", "%o ", "% o", + "\t%o", "\n%o", "%4o", + "%30o", "%[0-7]", "%*o" + ); $counter = 1; diff --git a/ext/standard/tests/file/fscanf_variation30.phpt b/ext/standard/tests/file/fscanf_variation30.phpt index 5b7dd02147..3af42e34bc 100644 --- a/ext/standard/tests/file/fscanf_variation30.phpt +++ b/ext/standard/tests/file/fscanf_variation30.phpt @@ -37,11 +37,11 @@ $array_types = array ( ); $octal_formats = array ( "%o", - "%ho", "%lo", "%Lo", - " %o", "%o ", "% o", - "\t%o", "\n%o", "%4o", - "%30o", "%[0-7]", "%*o" - ); + "%ho", "%lo", "%Lo", + " %o", "%o ", "% o", + "\t%o", "\n%o", "%4o", + "%30o", "%[0-7]", "%*o" + ); $counter = 1; diff --git a/ext/standard/tests/file/fscanf_variation32.phpt b/ext/standard/tests/file/fscanf_variation32.phpt index ef0c2b7036..556f60363e 100644 --- a/ext/standard/tests/file/fscanf_variation32.phpt +++ b/ext/standard/tests/file/fscanf_variation32.phpt @@ -29,11 +29,11 @@ $bool_types = array ( ); $octal_formats = array( "%o", - "%ho", "%lo", "%Lo", - " %o", "%o ", "% o", - "\t%o", "\n%o", "%4o", - "%30o", "%[0-7]", "%*o" - ); + "%ho", "%lo", "%Lo", + " %o", "%o ", "% o", + "\t%o", "\n%o", "%4o", + "%30o", "%[0-7]", "%*o" + ); $counter = 1; diff --git a/ext/standard/tests/file/fscanf_variation33.phpt b/ext/standard/tests/file/fscanf_variation33.phpt index 357544d1c4..2753a890b5 100644 --- a/ext/standard/tests/file/fscanf_variation33.phpt +++ b/ext/standard/tests/file/fscanf_variation33.phpt @@ -49,11 +49,11 @@ $valid_ints = array( ); // various hexa formats $hexa_formats = array( "%x", - "%xx", "%lx", "%Lx", - " %x", "%x ", "% x", - "\t%x", "\n%x", "%4x", - "%30x", "%[0-9A-Fa-f]", "%*x" - ); + "%xx", "%lx", "%Lx", + " %x", "%x ", "% x", + "\t%x", "\n%x", "%4x", + "%30x", "%[0-9A-Fa-f]", "%*x" + ); $counter = 1; diff --git a/ext/standard/tests/file/fscanf_variation34.phpt b/ext/standard/tests/file/fscanf_variation34.phpt index 949ee5fb56..ca0ca65e95 100644 --- a/ext/standard/tests/file/fscanf_variation34.phpt +++ b/ext/standard/tests/file/fscanf_variation34.phpt @@ -47,10 +47,10 @@ $float_values = array ( ); $hexa_formats = array( "%x", - "%hx", "%lx", "%Lx", - " %x", "%x ", "% x", - "\t%x", "\n%x", "%4x", - "%30x", "%[0-9A-Za-z]", "%*x"); + "%hx", "%lx", "%Lx", + " %x", "%x ", "% x", + "\t%x", "\n%x", "%4x", + "%30x", "%[0-9A-Za-z]", "%*x"); $counter = 1; diff --git a/ext/standard/tests/file/fstat_variation8.phpt b/ext/standard/tests/file/fstat_variation8.phpt index 4376d6e563..95036f5013 100644 --- a/ext/standard/tests/file/fstat_variation8.phpt +++ b/ext/standard/tests/file/fstat_variation8.phpt @@ -15,10 +15,10 @@ foreach($stat_result as $key =>$value) { // windows, dev and rdev will not match this is expected } else { - if ($fstat_result[$key] != $value) { - echo "FAIL: stat differs at '$key'. $fstat_result[$key] -- $value\n"; - $failed = true; - } + if ($fstat_result[$key] != $value) { + echo "FAIL: stat differs at '$key'. $fstat_result[$key] -- $value\n"; + $failed = true; + } } } if ($failed !== true) { diff --git a/ext/standard/tests/file/ftruncate_bug76422.phpt b/ext/standard/tests/file/ftruncate_bug76422.phpt index d291ec2efc..84134acfd0 100644 --- a/ext/standard/tests/file/ftruncate_bug76422.phpt +++ b/ext/standard/tests/file/ftruncate_bug76422.phpt @@ -33,7 +33,7 @@ $ftruncate_result = ftruncate($file_handle, $truncate_offset); if (false === $ftruncate_result) { // NOTE: unlink() is deliberately repeated - If this test runs out of disk space attempting to reserve space for this temporary file, - // then the --CLEAN-- script can't be run (if we don't delete the file), + // then the--CLEAN-- script can't be run (if we don't delete the file), // because there wouldn't be any free disk space to save a new php file. fclose($file_handle); unlink($fn); diff --git a/ext/standard/tests/file/include_streams.phpt b/ext/standard/tests/file/include_streams.phpt index 0b9446ff9e..90629d3ffc 100644 --- a/ext/standard/tests/file/include_streams.phpt +++ b/ext/standard/tests/file/include_streams.phpt @@ -10,99 +10,99 @@ EOD; class mystream { - public $path; - public $mode; - public $options; - - public $position; - public $varname; - - function url_stat($path, $flags) { - return array(); - } - - function stream_stat() { - return array(); - } - - function stream_open($path, $mode, $options, &$opened_path) - { - $this->path = $path; - $this->mode = $mode; - $this->options = $options; - - $split = parse_url($path); - if ($split["host"] !== "GLOBALS" || - empty($split["path"]) || - empty($GLOBALS[substr($split["path"],1)])) { - return false; - } - $this->varname = substr($split["path"],1); - - if (strchr($mode, 'a')) - $this->position = strlen($GLOBALS[$this->varname]); - else - $this->position = 0; - - return true; - } - - function stream_read($count) - { - $ret = substr($GLOBALS[$this->varname], $this->position, $count); - $this->position += strlen($ret); - return $ret; - } - - function stream_tell() - { - return $this->position; - } - - function stream_eof() - { - return $this->position >= strlen($GLOBALS[$this->varname]); - } - - function stream_seek($offset, $whence) - { - switch($whence) { - case SEEK_SET: - if ($offset < strlen($GLOBALS[$this->varname]) && $offset >= 0) { - $this->position = $offset; - return true; - } else { - return false; - } - break; - case SEEK_CUR: - if ($offset >= 0) { - $this->position += $offset; - return true; - } else { - return false; - } - break; - case SEEK_END: - if (strlen($GLOBALS[$this->varname]) + $offset >= 0) { - $this->position = strlen($GLOBALS[$this->varname]) + $offset; - return true; - } else { - return false; - } - break; - default: - return false; - } - } - - function stream_set_option($option, $arg1, $arg2) { - return false; - } + public $path; + public $mode; + public $options; + + public $position; + public $varname; + + function url_stat($path, $flags) { + return array(); + } + + function stream_stat() { + return array(); + } + + function stream_open($path, $mode, $options, &$opened_path) + { + $this->path = $path; + $this->mode = $mode; + $this->options = $options; + + $split = parse_url($path); + if ($split["host"] !== "GLOBALS" || + empty($split["path"]) || + empty($GLOBALS[substr($split["path"],1)])) { + return false; + } + $this->varname = substr($split["path"],1); + + if (strchr($mode, 'a')) + $this->position = strlen($GLOBALS[$this->varname]); + else + $this->position = 0; + + return true; + } + + function stream_read($count) + { + $ret = substr($GLOBALS[$this->varname], $this->position, $count); + $this->position += strlen($ret); + return $ret; + } + + function stream_tell() + { + return $this->position; + } + + function stream_eof() + { + return $this->position >= strlen($GLOBALS[$this->varname]); + } + + function stream_seek($offset, $whence) + { + switch($whence) { + case SEEK_SET: + if ($offset < strlen($GLOBALS[$this->varname]) && $offset >= 0) { + $this->position = $offset; + return true; + } else { + return false; + } + break; + case SEEK_CUR: + if ($offset >= 0) { + $this->position += $offset; + return true; + } else { + return false; + } + break; + case SEEK_END: + if (strlen($GLOBALS[$this->varname]) + $offset >= 0) { + $this->position = strlen($GLOBALS[$this->varname]) + $offset; + return true; + } else { + return false; + } + break; + default: + return false; + } + } + + function stream_set_option($option, $arg1, $arg2) { + return false; + } } if (!stream_wrapper_register("test", "mystream")) { - die("test wrapper registration failed"); + die("test wrapper registration failed"); } echo file_get_contents("test://GLOBALS/data1"); diff --git a/ext/standard/tests/file/include_userstream_001.phpt b/ext/standard/tests/file/include_userstream_001.phpt index d769a4f3b2..988a8bf085 100644 --- a/ext/standard/tests/file/include_userstream_001.phpt +++ b/ext/standard/tests/file/include_userstream_001.phpt @@ -7,66 +7,66 @@ allow_url_include=0 <?php class test { private $data = '<?php echo "Hello World\n";?>'; - private $pos; + private $pos; - function stream_open($path, $mode, $options, &$opened_path) - { - if (strchr($mode, 'a')) - $this->pos = strlen($this->data); - else - $this->po = 0; + function stream_open($path, $mode, $options, &$opened_path) + { + if (strchr($mode, 'a')) + $this->pos = strlen($this->data); + else + $this->po = 0; - return true; - } + return true; + } - function stream_read($count) - { - $ret = substr($this->data, $this->pos, $count); - $this->pos += strlen($ret); - return $ret; - } + function stream_read($count) + { + $ret = substr($this->data, $this->pos, $count); + $this->pos += strlen($ret); + return $ret; + } - function stream_tell() - { - return $this->pos; - } + function stream_tell() + { + return $this->pos; + } - function stream_eof() - { - return $this->pos >= strlen($this->data); - } + function stream_eof() + { + return $this->pos >= strlen($this->data); + } - function stream_seek($offset, $whence) - { - switch($whence) { - case SEEK_SET: - if ($offset < $this->data && $offset >= 0) { - $this->pos = $offset; - return true; - } else { - return false; - } - break; - case SEEK_CUR: - if ($offset >= 0) { - $this->pos += $offset; - return true; - } else { - return false; - } - break; - case SEEK_END: - if (strlen($this->data) + $offset >= 0) { - $this->pos = strlen($this->data) + $offset; - return true; - } else { - return false; - } - break; - default: - return false; - } - } + function stream_seek($offset, $whence) + { + switch($whence) { + case SEEK_SET: + if ($offset < $this->data && $offset >= 0) { + $this->pos = $offset; + return true; + } else { + return false; + } + break; + case SEEK_CUR: + if ($offset >= 0) { + $this->pos += $offset; + return true; + } else { + return false; + } + break; + case SEEK_END: + if (strlen($this->data) + $offset >= 0) { + $this->pos = strlen($this->data) + $offset; + return true; + } else { + return false; + } + break; + default: + return false; + } + } } diff --git a/ext/standard/tests/file/include_userstream_002.phpt b/ext/standard/tests/file/include_userstream_002.phpt index 208248f873..15c05314a5 100644 --- a/ext/standard/tests/file/include_userstream_002.phpt +++ b/ext/standard/tests/file/include_userstream_002.phpt @@ -7,83 +7,83 @@ allow_url_include=0 <?php class test { private $data = '<?php echo "Hello World\n";?>'; - private $pos; - private $stream = null; + private $pos; + private $stream = null; - function stream_open($path, $mode, $options, &$opened_path) - { - if (strpos($path, "test2://") === 0) { - $this->stream = fopen("test1://".substr($path, 8), $mode); - return !empty($this->stream); - } - if (strchr($mode, 'a')) - $this->pos = strlen($this->data); - else - $this->po = 0; + function stream_open($path, $mode, $options, &$opened_path) + { + if (strpos($path, "test2://") === 0) { + $this->stream = fopen("test1://".substr($path, 8), $mode); + return !empty($this->stream); + } + if (strchr($mode, 'a')) + $this->pos = strlen($this->data); + else + $this->po = 0; - return true; - } + return true; + } - function stream_read($count) - { - if (!empty($this->stream)) { - return fread($this->stream, $count); - } - $ret = substr($this->data, $this->pos, $count); - $this->pos += strlen($ret); - return $ret; - } + function stream_read($count) + { + if (!empty($this->stream)) { + return fread($this->stream, $count); + } + $ret = substr($this->data, $this->pos, $count); + $this->pos += strlen($ret); + return $ret; + } - function stream_tell() - { - if (!empty($this->stream)) { - return ftell($this->stream); - } - return $this->pos; - } + function stream_tell() + { + if (!empty($this->stream)) { + return ftell($this->stream); + } + return $this->pos; + } - function stream_eof() - { - if (!empty($this->stream)) { - return feof($this->stream); - } - return $this->pos >= strlen($this->data); - } + function stream_eof() + { + if (!empty($this->stream)) { + return feof($this->stream); + } + return $this->pos >= strlen($this->data); + } - function stream_seek($offset, $whence) - { - if (!empty($this->stream)) { - return fseek($this->stream, $offset, $whence); - } - switch($whence) { - case SEEK_SET: - if ($offset < $this->data && $offset >= 0) { - $this->pos = $offset; - return true; - } else { - return false; - } - break; - case SEEK_CUR: - if ($offset >= 0) { - $this->pos += $offset; - return true; - } else { - return false; - } - break; - case SEEK_END: - if (strlen($this->data) + $offset >= 0) { - $this->pos = strlen($this->data) + $offset; - return true; - } else { - return false; - } - break; - default: - return false; - } - } + function stream_seek($offset, $whence) + { + if (!empty($this->stream)) { + return fseek($this->stream, $offset, $whence); + } + switch($whence) { + case SEEK_SET: + if ($offset < $this->data && $offset >= 0) { + $this->pos = $offset; + return true; + } else { + return false; + } + break; + case SEEK_CUR: + if ($offset >= 0) { + $this->pos += $offset; + return true; + } else { + return false; + } + break; + case SEEK_END: + if (strlen($this->data) + $offset >= 0) { + $this->pos = strlen($this->data) + $offset; + return true; + } else { + return false; + } + break; + default: + return false; + } + } } diff --git a/ext/standard/tests/file/include_userstream_003.phpt b/ext/standard/tests/file/include_userstream_003.phpt index 5ffe28a840..ae6ec62649 100644 --- a/ext/standard/tests/file/include_userstream_003.phpt +++ b/ext/standard/tests/file/include_userstream_003.phpt @@ -7,83 +7,83 @@ allow_url_include=1 <?php class test { private $data = '<?php echo "Hello World\n";?>'; - private $pos; - private $stream = null; - - function stream_open($path, $mode, $options, &$opened_path) - { - if (strpos($path, "test2://") === 0) { - $this->stream = fopen("test1://".substr($path, 8), $mode); - return !empty($this->stream); - } - if (strchr($mode, 'a')) - $this->pos = strlen($this->data); - else - $this->po = 0; - - return true; - } - - function stream_read($count) - { - if (!empty($this->stream)) { - return fread($this->stream, $count); - } - $ret = substr($this->data, $this->pos, $count); - $this->pos += strlen($ret); - return $ret; - } - - function stream_tell() - { - if (!empty($this->stream)) { - return ftell($this->stream); - } - return $this->pos; - } - - function stream_eof() - { - if (!empty($this->stream)) { - return feof($this->stream); - } - return $this->pos >= strlen($this->data); - } - - function stream_seek($offset, $whence) - { - if (!empty($this->stream)) { - return fseek($this->stream, $offset, $whence); - } - switch($whence) { - case SEEK_SET: - if ($offset < $this->data && $offset >= 0) { - $this->pos = $offset; - return true; - } else { - return false; - } - break; - case SEEK_CUR: - if ($offset >= 0) { - $this->pos += $offset; - return true; - } else { - return false; - } - break; - case SEEK_END: - if (strlen($this->data) + $offset >= 0) { - $this->pos = strlen($this->data) + $offset; - return true; - } else { - return false; - } - break; - default: - return false; - } - } + private $pos; + private $stream = null; + + function stream_open($path, $mode, $options, &$opened_path) + { + if (strpos($path, "test2://") === 0) { + $this->stream = fopen("test1://".substr($path, 8), $mode); + return !empty($this->stream); + } + if (strchr($mode, 'a')) + $this->pos = strlen($this->data); + else + $this->po = 0; + + return true; + } + + function stream_read($count) + { + if (!empty($this->stream)) { + return fread($this->stream, $count); + } + $ret = substr($this->data, $this->pos, $count); + $this->pos += strlen($ret); + return $ret; + } + + function stream_tell() + { + if (!empty($this->stream)) { + return ftell($this->stream); + } + return $this->pos; + } + + function stream_eof() + { + if (!empty($this->stream)) { + return feof($this->stream); + } + return $this->pos >= strlen($this->data); + } + + function stream_seek($offset, $whence) + { + if (!empty($this->stream)) { + return fseek($this->stream, $offset, $whence); + } + switch($whence) { + case SEEK_SET: + if ($offset < $this->data && $offset >= 0) { + $this->pos = $offset; + return true; + } else { + return false; + } + break; + case SEEK_CUR: + if ($offset >= 0) { + $this->pos += $offset; + return true; + } else { + return false; + } + break; + case SEEK_END: + if (strlen($this->data) + $offset >= 0) { + $this->pos = strlen($this->data) + $offset; + return true; + } else { + return false; + } + break; + default: + return false; + } + } } diff --git a/ext/standard/tests/file/parse_ini_file.phpt b/ext/standard/tests/file/parse_ini_file.phpt index eed17c0093..817b92aa7f 100644 --- a/ext/standard/tests/file/parse_ini_file.phpt +++ b/ext/standard/tests/file/parse_ini_file.phpt @@ -25,7 +25,7 @@ PHP_CONSTANT = 1.2345678 HELLO = HELLO [date] -date = +date = time = [paths] @@ -64,7 +64,7 @@ Non_alpha11 = / Non_alpha12 = \ ;These chars have a special meaning when used in the value, ; hence parser throws an error -;Non_alpha13 = & +;Non_alpha13 = & ;Non_alpha14 = ^ ;Non_alpha15 = {} ;Non_alpha16 = | @@ -172,7 +172,7 @@ Key16 = Null Key17 = nuLL Key18 = null -[ReservedKeys_as_Keys] +[ReservedKeys_as_Keys] ; Expected:error, reserved key words must not be used as keys for ini file ;YES = 1 ;Yes = 2 diff --git a/ext/standard/tests/file/pathinfo_basic1-win32.phpt b/ext/standard/tests/file/pathinfo_basic1-win32.phpt index acca647a97..060c7e3423 100644 --- a/ext/standard/tests/file/pathinfo_basic1-win32.phpt +++ b/ext/standard/tests/file/pathinfo_basic1-win32.phpt @@ -16,45 +16,45 @@ if(substr(PHP_OS, 0, 3) != "WIN") echo "*** Testing basic functions of pathinfo() ***\n"; $paths = array ( - '', - ' ', - 'c:', - 'c:\\', - 'c:/', - 'afile', - 'c:\test\adir', - 'c:\test\adir\\', - '/usr/include/arpa', - '/usr/include/arpa/', - 'usr/include/arpa', - 'usr/include/arpa/', - 'c:\test\afile', - 'c:\\test\\afile', - 'c://test//afile', - 'c:\test\afile\\', - 'c:\test\prog.exe', - 'c:\\test\\prog.exe', - 'c:/test/prog.exe', - '/usr/include/arpa/inet.h', - '//usr/include//arpa/inet.h', - '\\', - '\\\\', - '/', - '//', - '///', - '/usr/include/arpa/inet.h', - 'c:\windows/system32\drivers/etc\hosts', - '/usr\include/arpa\inet.h', - ' c:\test\adir\afile.txt', - 'c:\test\adir\afile.txt ', - ' c:\test\adir\afile.txt ', - ' /usr/include/arpa/inet.h', - '/usr/include/arpa/inet.h ', - ' /usr/include/arpa/inet.h ', - ' c:', - ' c:\test\adir\afile.txt', - '/usr', - '/usr/' + '', + ' ', + 'c:', + 'c:\\', + 'c:/', + 'afile', + 'c:\test\adir', + 'c:\test\adir\\', + '/usr/include/arpa', + '/usr/include/arpa/', + 'usr/include/arpa', + 'usr/include/arpa/', + 'c:\test\afile', + 'c:\\test\\afile', + 'c://test//afile', + 'c:\test\afile\\', + 'c:\test\prog.exe', + 'c:\\test\\prog.exe', + 'c:/test/prog.exe', + '/usr/include/arpa/inet.h', + '//usr/include//arpa/inet.h', + '\\', + '\\\\', + '/', + '//', + '///', + '/usr/include/arpa/inet.h', + 'c:\windows/system32\drivers/etc\hosts', + '/usr\include/arpa\inet.h', + ' c:\test\adir\afile.txt', + 'c:\test\adir\afile.txt ', + ' c:\test\adir\afile.txt ', + ' /usr/include/arpa/inet.h', + '/usr/include/arpa/inet.h ', + ' /usr/include/arpa/inet.h ', + ' c:', + ' c:\test\adir\afile.txt', + '/usr', + '/usr/' ); $counter = 1; diff --git a/ext/standard/tests/file/pathinfo_basic1.phpt b/ext/standard/tests/file/pathinfo_basic1.phpt index c9e84522a8..d195a76fb3 100644 --- a/ext/standard/tests/file/pathinfo_basic1.phpt +++ b/ext/standard/tests/file/pathinfo_basic1.phpt @@ -16,45 +16,45 @@ if(substr(PHP_OS, 0, 3) == "WIN") echo "*** Testing basic functions of pathinfo() ***\n"; $paths = array ( - '', - ' ', - 'c:', - 'c:\\', - 'c:/', - 'afile', - 'c:\test\adir', - 'c:\test\adir\\', - '/usr/include/arpa', - '/usr/include/arpa/', - 'usr/include/arpa', - 'usr/include/arpa/', - 'c:\test\afile', - 'c:\\test\\afile', - 'c://test//afile', - 'c:\test\afile\\', - 'c:\test\prog.exe', - 'c:\\test\\prog.exe', - 'c:/test/prog.exe', - '/usr/include/arpa/inet.h', - '//usr/include//arpa/inet.h', - '\\', - '\\\\', - '/', - '//', - '///', - '/usr/include/arpa/inet.h', - 'c:\windows/system32\drivers/etc\hosts', - '/usr\include/arpa\inet.h', - ' c:\test\adir\afile.txt', - 'c:\test\adir\afile.txt ', - ' c:\test\adir\afile.txt ', - ' /usr/include/arpa/inet.h', - '/usr/include/arpa/inet.h ', - ' /usr/include/arpa/inet.h ', - ' c:', - ' c:\test\adir\afile.txt', - '/usr', - '/usr/' + '', + ' ', + 'c:', + 'c:\\', + 'c:/', + 'afile', + 'c:\test\adir', + 'c:\test\adir\\', + '/usr/include/arpa', + '/usr/include/arpa/', + 'usr/include/arpa', + 'usr/include/arpa/', + 'c:\test\afile', + 'c:\\test\\afile', + 'c://test//afile', + 'c:\test\afile\\', + 'c:\test\prog.exe', + 'c:\\test\\prog.exe', + 'c:/test/prog.exe', + '/usr/include/arpa/inet.h', + '//usr/include//arpa/inet.h', + '\\', + '\\\\', + '/', + '//', + '///', + '/usr/include/arpa/inet.h', + 'c:\windows/system32\drivers/etc\hosts', + '/usr\include/arpa\inet.h', + ' c:\test\adir\afile.txt', + 'c:\test\adir\afile.txt ', + ' c:\test\adir\afile.txt ', + ' /usr/include/arpa/inet.h', + '/usr/include/arpa/inet.h ', + ' /usr/include/arpa/inet.h ', + ' c:', + ' c:\test\adir\afile.txt', + '/usr', + '/usr/' ); $counter = 1; diff --git a/ext/standard/tests/file/pathinfo_basic2-win32.phpt b/ext/standard/tests/file/pathinfo_basic2-win32.phpt index 5a88b648d3..97f3899426 100644 --- a/ext/standard/tests/file/pathinfo_basic2-win32.phpt +++ b/ext/standard/tests/file/pathinfo_basic2-win32.phpt @@ -16,21 +16,21 @@ if(substr(PHP_OS, 0, 3) != "WIN") echo "*** Testing basic functions of pathinfo() ***\n"; $paths = array ( - 'c:\..\dir1', - 'c:\test\..\test2\.\adir\afile.txt', - '/usr/include/../arpa/./inet.h', - 'c:\test\adir\afile..txt', - '/usr/include/arpa/inet..h', - 'c:\test\adir\afile.', - '/usr/include/arpa/inet.', - '/usr/include/arpa/inet,h', - 'c:afile.txt', - '..\.\..\test\afile.txt', - '.././../test/afile', - '.', - '..', - '...', - '/usr/lib/.../afile' + 'c:\..\dir1', + 'c:\test\..\test2\.\adir\afile.txt', + '/usr/include/../arpa/./inet.h', + 'c:\test\adir\afile..txt', + '/usr/include/arpa/inet..h', + 'c:\test\adir\afile.', + '/usr/include/arpa/inet.', + '/usr/include/arpa/inet,h', + 'c:afile.txt', + '..\.\..\test\afile.txt', + '.././../test/afile', + '.', + '..', + '...', + '/usr/lib/.../afile' ); diff --git a/ext/standard/tests/file/pathinfo_basic2.phpt b/ext/standard/tests/file/pathinfo_basic2.phpt index 51de45d33d..3ae6e1338c 100644 --- a/ext/standard/tests/file/pathinfo_basic2.phpt +++ b/ext/standard/tests/file/pathinfo_basic2.phpt @@ -16,21 +16,21 @@ if(substr(PHP_OS, 0, 3) == "WIN") echo "*** Testing basic functions of pathinfo() ***\n"; $paths = array ( - 'c:\..\dir1', - 'c:\test\..\test2\.\adir\afile.txt', - '/usr/include/../arpa/./inet.h', - 'c:\test\adir\afile..txt', - '/usr/include/arpa/inet..h', - 'c:\test\adir\afile.', - '/usr/include/arpa/inet.', - '/usr/include/arpa/inet,h', - 'c:afile.txt', - '..\.\..\test\afile.txt', - '.././../test/afile', - '.', - '..', - '...', - '/usr/lib/.../afile' + 'c:\..\dir1', + 'c:\test\..\test2\.\adir\afile.txt', + '/usr/include/../arpa/./inet.h', + 'c:\test\adir\afile..txt', + '/usr/include/arpa/inet..h', + 'c:\test\adir\afile.', + '/usr/include/arpa/inet.', + '/usr/include/arpa/inet,h', + 'c:afile.txt', + '..\.\..\test\afile.txt', + '.././../test/afile', + '.', + '..', + '...', + '/usr/lib/.../afile' ); diff --git a/ext/standard/tests/file/popen_pclose_basic-win32-mb.phpt b/ext/standard/tests/file/popen_pclose_basic-win32-mb.phpt index 2d9b2b92dc..008cef3643 100644 --- a/ext/standard/tests/file/popen_pclose_basic-win32-mb.phpt +++ b/ext/standard/tests/file/popen_pclose_basic-win32-mb.phpt @@ -28,7 +28,7 @@ echo "*** Testing popen(): writing to the pipe ***\n"; $arr = array("ggg", "ddd", "aaa", "sss"); // popen("sort", "w") fails if variables_order="GPCS" // this is set in the default INI file -// it doesn't seem to be changeable in the --INI-- section +// it doesn't seem to be changeable in the--INI-- section // also, doing: ini_set('variables_order', ''); doesn't work! // // the only solution is to either put the absolute path here, or diff --git a/ext/standard/tests/file/popen_pclose_basic-win32.phpt b/ext/standard/tests/file/popen_pclose_basic-win32.phpt index dfb00fbeb2..5be3ee4ca8 100644 --- a/ext/standard/tests/file/popen_pclose_basic-win32.phpt +++ b/ext/standard/tests/file/popen_pclose_basic-win32.phpt @@ -28,7 +28,7 @@ echo "*** Testing popen(): writing to the pipe ***\n"; $arr = array("ggg", "ddd", "aaa", "sss"); // popen("sort", "w") fails if variables_order="GPCS" // this is set in the default INI file -// it doesn't seem to be changeable in the --INI-- section +// it doesn't seem to be changeable in the--INI-- section // also, doing: ini_set('variables_order', ''); doesn't work! // // the only solution is to either put the absolute path here, or diff --git a/ext/standard/tests/file/proc_open01.phpt b/ext/standard/tests/file/proc_open01.phpt index 66c601fb91..2f74a17464 100644 --- a/ext/standard/tests/file/proc_open01.phpt +++ b/ext/standard/tests/file/proc_open01.phpt @@ -6,15 +6,15 @@ $pipes = array(1, 2, 3); $orig_pipes = $pipes; $php = getenv('TEST_PHP_EXECUTABLE'); if ($php === false) { - die("no php executable defined"); + die("no php executable defined"); } $proc = proc_open( - "$php -n", - array(0 => array('pipe', 'r'), 1 => array('pipe', 'w')), - $pipes, getcwd(), array(), array() + "$php -n", + array(0 => array('pipe', 'r'), 1 => array('pipe', 'w')), + $pipes, getcwd(), array(), array() ); if ($proc === false) { - print "something went wrong.\n"; + print "something went wrong.\n"; } var_dump($pipes); stream_set_blocking($pipes[1], FALSE); @@ -25,25 +25,25 @@ fclose($pipes[0]); $cnt = ''; $n=0; for ($left = strlen($test_string); $left > 0;) { - if (++$n >1000) { - print "terminated after 1000 iterations\n"; - break; - } - $read_fds = array($pipes[1]); - $write_fds = NULL; - $exp_fds = NULL; - $retval = stream_select($read_fds, $write_fds, $exp_fds, 5); - if ($retval === false) { - print "select() failed\n"; - break; - } - if ($retval === 0) { - print "timed out\n"; - break; - } - $buf = fread($pipes[1], 1024); - $cnt .= $buf; - $left -= strlen($buf); + if (++$n >1000) { + print "terminated after 1000 iterations\n"; + break; + } + $read_fds = array($pipes[1]); + $write_fds = NULL; + $exp_fds = NULL; + $retval = stream_select($read_fds, $write_fds, $exp_fds, 5); + if ($retval === false) { + print "select() failed\n"; + break; + } + if ($retval === 0) { + print "timed out\n"; + break; + } + $buf = fread($pipes[1], 1024); + $cnt .= $buf; + $left -= strlen($buf); } var_dump($cnt); fclose($pipes[1]); diff --git a/ext/standard/tests/file/rename_variation13-win32.phpt b/ext/standard/tests/file/rename_variation13-win32.phpt index 83a4a88b29..e80acae01b 100644 --- a/ext/standard/tests/file/rename_variation13-win32.phpt +++ b/ext/standard/tests/file/rename_variation13-win32.phpt @@ -42,7 +42,7 @@ $file_path = __DIR__."/renameVar13"; $aFile = $file_path.'/afile.tmp'; if (!mkdir($file_path)) { - die("fail to create $file_path tmp dir"); + die("fail to create $file_path tmp dir"); } for( $i=0; $i < count($names_arr); $i++ ) { diff --git a/ext/standard/tests/file/rename_variation3-win32.phpt b/ext/standard/tests/file/rename_variation3-win32.phpt index b14b814295..a9e3057340 100644 --- a/ext/standard/tests/file/rename_variation3-win32.phpt +++ b/ext/standard/tests/file/rename_variation3-win32.phpt @@ -25,7 +25,7 @@ mkdir($dirname); $filename = "$file_path/rename_variation3.tmp"; $fp = fopen($filename, "w"); if (!$fp) { - die("Cannot create $filename\n"); + die("Cannot create $filename\n"); } fclose($fp); diff --git a/ext/standard/tests/file/rename_variation7-win32.phpt b/ext/standard/tests/file/rename_variation7-win32.phpt index fb7c805cbf..bf879ce7d9 100644 --- a/ext/standard/tests/file/rename_variation7-win32.phpt +++ b/ext/standard/tests/file/rename_variation7-win32.phpt @@ -12,7 +12,7 @@ $tmp_link = __FILE__.".tmp.link"; $tmp_link2 = __FILE__.".tmp.link2"; if (symlink(__DIR__."/there_is_no_such_file", $tmp_link)) { - rename($tmp_link, $tmp_link2); + rename($tmp_link, $tmp_link2); } clearstatcache(); diff --git a/ext/standard/tests/file/stream_get_line.phpt b/ext/standard/tests/file/stream_get_line.phpt index 9421bd44c1..773efd2c88 100644 --- a/ext/standard/tests/file/stream_get_line.phpt +++ b/ext/standard/tests/file/stream_get_line.phpt @@ -7,7 +7,7 @@ $path = __DIR__ . '/test.html'; file_put_contents($path, "foo<br>bar<br>foo"); $fp = fopen($path, "r"); while ($fp && !feof($fp)) { - echo stream_get_line($fp, 0, "<br>")."\n"; + echo stream_get_line($fp, 0, "<br>")."\n"; } fclose($fp); @unlink($path); diff --git a/ext/standard/tests/file/stream_rfc2397_002.phpt b/ext/standard/tests/file/stream_rfc2397_002.phpt index 162f1ea9ea..d145456fdb 100644 --- a/ext/standard/tests/file/stream_rfc2397_002.phpt +++ b/ext/standard/tests/file/stream_rfc2397_002.phpt @@ -6,24 +6,24 @@ allow_url_fopen=1 <?php $streams = array( - 'data://,', - 'data://', - 'data://;base64,', - 'data://;base64', - 'data://foo,', - 'data://foo=bar,', - 'data://text/plain,', - 'data://text/plain;foo,', - 'data://text/plain;foo=bar,', - 'data://text/plain;foo=bar;bla,', - 'data://text/plain;foo=bar;base64,', - 'data://text/plain;foo=bar;bar=baz', - 'data://text/plain;foo=bar;bar=baz,', - ); + 'data://,', + 'data://', + 'data://;base64,', + 'data://;base64', + 'data://foo,', + 'data://foo=bar,', + 'data://text/plain,', + 'data://text/plain;foo,', + 'data://text/plain;foo=bar,', + 'data://text/plain;foo=bar;bla,', + 'data://text/plain;foo=bar;base64,', + 'data://text/plain;foo=bar;bar=baz', + 'data://text/plain;foo=bar;bar=baz,', + ); foreach($streams as $stream) { - $stream = fopen($stream, 'r'); + $stream = fopen($stream, 'r'); if ($stream) { $meta = stream_get_meta_data($stream); var_dump($meta); diff --git a/ext/standard/tests/file/stream_rfc2397_003.phpt b/ext/standard/tests/file/stream_rfc2397_003.phpt index 1797d02ab5..a1437a04bb 100644 --- a/ext/standard/tests/file/stream_rfc2397_003.phpt +++ b/ext/standard/tests/file/stream_rfc2397_003.phpt @@ -6,25 +6,25 @@ allow_url_fopen=1 <?php $streams = array( - 'data://,A%20brief%20note', - 'data://application/vnd-xxx-query,select_vcount,fcol_from_fieldtable/local', - 'data://;base64,Zm9vYmFyIGZvb2Jhcg==', - 'stream_rfc2397_003.gif' => 'data://image/gif;base64,R0lGODdhMAAwAPAAAAAAAP///ywAAAAAMAAw + 'data://,A%20brief%20note', + 'data://application/vnd-xxx-query,select_vcount,fcol_from_fieldtable/local', + 'data://;base64,Zm9vYmFyIGZvb2Jhcg==', + 'stream_rfc2397_003.gif' => 'data://image/gif;base64,R0lGODdhMAAwAPAAAAAAAP///ywAAAAAMAAw AAAC8IyPqcvt3wCcDkiLc7C0qwyGHhSWpjQu5yqmCYsapyuvUUlvONmOZtfzgFz ByTB10QgxOR0TqBQejhRNzOfkVJ+5YiUqrXF5Y5lKh/DeuNcP5yLWGsEbtLiOSp a/TPg7JpJHxyendzWTBfX0cxOnKPjgBzi4diinWGdkF8kjdfnycQZXZeYGejmJl ZeGl9i2icVqaNVailT6F5iJ90m6mvuTS4OK05M0vDk0Q4XUtwvKOzrcd3iq9uis F81M1OIcR7lEewwcLp7tuNNkM3uNna3F2JQFo97Vriy/Xl4/f1cf5VWzXyym7PH hhx4dbgYKAAA7', - ); + ); foreach($streams as $original => $stream) { - if (is_string($original)) { - var_dump(file_get_contents(__DIR__ . '/' . $original) == file_get_contents($stream)); - } else { - var_dump(file_get_contents($stream)); - } + if (is_string($original)) { + var_dump(file_get_contents(__DIR__ . '/' . $original) == file_get_contents($stream)); + } else { + var_dump(file_get_contents($stream)); + } } ?> diff --git a/ext/standard/tests/file/stream_rfc2397_004.phpt b/ext/standard/tests/file/stream_rfc2397_004.phpt index 239a12e3bf..cb7012f650 100644 --- a/ext/standard/tests/file/stream_rfc2397_004.phpt +++ b/ext/standard/tests/file/stream_rfc2397_004.phpt @@ -6,17 +6,17 @@ allow_url_fopen=1 <?php $streams = array( - 'data://,;test', - 'data://text/plain,test', - 'data://text/plain;charset=US-ASCII,test', - 'data://;charset=UTF-8,Hello', - 'data://text/plain;charset=UTF-8,Hello', - 'data://,a,b', - ); + 'data://,;test', + 'data://text/plain,test', + 'data://text/plain;charset=US-ASCII,test', + 'data://;charset=UTF-8,Hello', + 'data://text/plain;charset=UTF-8,Hello', + 'data://,a,b', + ); foreach($streams as $stream) { - var_dump(@file_get_contents($stream)); + var_dump(@file_get_contents($stream)); } ?> diff --git a/ext/standard/tests/file/stream_rfc2397_005.phpt b/ext/standard/tests/file/stream_rfc2397_005.phpt index fb1cb85a07..38c0f4b77e 100644 --- a/ext/standard/tests/file/stream_rfc2397_005.phpt +++ b/ext/standard/tests/file/stream_rfc2397_005.phpt @@ -6,20 +6,20 @@ allow_url_fopen=1 <?php $streams = array( - 'data:,A%20brief%20note', - 'data:application/vnd-xxx-query,select_vcount,fcol_from_fieldtable/local', - 'data:;base64,Zm9vYmFyIGZvb2Jhcg==', - 'data:,;test', - 'data:text/plain,test', - 'data:text/plain;charset=US-ASCII,test', - 'data:;charset=UTF-8,Hello', - 'data:text/plain;charset=UTF-8,Hello', - 'data:,a,b', - ); + 'data:,A%20brief%20note', + 'data:application/vnd-xxx-query,select_vcount,fcol_from_fieldtable/local', + 'data:;base64,Zm9vYmFyIGZvb2Jhcg==', + 'data:,;test', + 'data:text/plain,test', + 'data:text/plain;charset=US-ASCII,test', + 'data:;charset=UTF-8,Hello', + 'data:text/plain;charset=UTF-8,Hello', + 'data:,a,b', + ); foreach($streams as $stream) { - var_dump(@file_get_contents($stream)); + var_dump(@file_get_contents($stream)); } ?> diff --git a/ext/standard/tests/file/stream_rfc2397_006.phpt b/ext/standard/tests/file/stream_rfc2397_006.phpt index 7caf1b666e..2c8b8fd720 100644 --- a/ext/standard/tests/file/stream_rfc2397_006.phpt +++ b/ext/standard/tests/file/stream_rfc2397_006.phpt @@ -6,19 +6,19 @@ allow_url_fopen=1 <?php $streams = array( - "data:;base64,\0Zm9vYmFyIGZvb2Jhcg==", - "data:;base64,Zm9vYmFy\0IGZvb2Jhcg==", - 'data:;base64,#Zm9vYmFyIGZvb2Jhcg==', - 'data:;base64,#Zm9vYmFyIGZvb2Jhc=', - ); + "data:;base64,\0Zm9vYmFyIGZvb2Jhcg==", + "data:;base64,Zm9vYmFy\0IGZvb2Jhcg==", + 'data:;base64,#Zm9vYmFyIGZvb2Jhcg==', + 'data:;base64,#Zm9vYmFyIGZvb2Jhc=', + ); foreach($streams as $stream) { - try { - var_dump(file_get_contents($stream)); - } catch (TypeError $e) { - echo $e->getMessage(), "\n"; - } + try { + var_dump(file_get_contents($stream)); + } catch (TypeError $e) { + echo $e->getMessage(), "\n"; + } } ?> diff --git a/ext/standard/tests/file/stream_rfc2397_007.phpt b/ext/standard/tests/file/stream_rfc2397_007.phpt index a1558980c9..56d9162157 100644 --- a/ext/standard/tests/file/stream_rfc2397_007.phpt +++ b/ext/standard/tests/file/stream_rfc2397_007.phpt @@ -6,76 +6,76 @@ allow_url_fopen=1 <?php $streams = array( - "data:,012345", - ); + "data:,012345", + ); foreach($streams as $stream) { - echo "===$stream===\n"; + echo "===$stream===\n"; - $fp = fopen($stream, 'rb'); + $fp = fopen($stream, 'rb'); - var_dump(ftell($fp)); - var_dump(feof($fp)); - echo "===S:4,S===\n"; - var_dump(fseek($fp, 4)); - var_dump(ftell($fp)); - var_dump(feof($fp)); - echo "===GETC===\n"; - var_dump(fgetc($fp)); - var_dump(ftell($fp)); - var_dump(feof($fp)); - echo "===GETC===\n"; - var_dump(fgetc($fp)); - var_dump(fgetc($fp)); - var_dump(ftell($fp)); - var_dump(feof($fp)); - echo "===REWIND===\n"; - var_dump(rewind($fp)); - var_dump(ftell($fp)); - var_dump(feof($fp)); - echo "===GETC===\n"; - var_dump(fgetc($fp)); - var_dump(ftell($fp)); - var_dump(feof($fp)); - echo "===S:3,S===\n"; - var_dump(fseek($fp, 3, SEEK_SET)); - var_dump(ftell($fp)); - var_dump(feof($fp)); - echo "===S:1,C===\n"; - var_dump(fseek($fp, 1, SEEK_CUR)); - var_dump(ftell($fp)); - var_dump(feof($fp)); - echo "===S:-2,C===\n"; - var_dump(fseek($fp, -2, SEEK_CUR)); - var_dump(ftell($fp)); - var_dump(feof($fp)); - echo "===S:-10,C===\n"; - var_dump(fseek($fp, -10, SEEK_CUR)); - var_dump(ftell($fp)); - var_dump(feof($fp)); - echo "===S:3,S===\n"; - var_dump(fseek($fp, 3, SEEK_SET)); - var_dump(ftell($fp)); - var_dump(feof($fp)); - echo "===S:10,C===\n"; - var_dump(fseek($fp, 10, SEEK_CUR)); - var_dump(ftell($fp)); - var_dump(feof($fp)); - echo "===S:-1,E===\n"; - var_dump(fseek($fp, -1, SEEK_END)); - var_dump(ftell($fp)); - var_dump(feof($fp)); - echo "===S:0,E===\n"; - var_dump(fseek($fp, 0, SEEK_END)); - var_dump(ftell($fp)); - var_dump(feof($fp)); - echo "===S:1,E===\n"; - var_dump(fseek($fp, 1, SEEK_END)); - var_dump(ftell($fp)); - var_dump(feof($fp)); + var_dump(ftell($fp)); + var_dump(feof($fp)); + echo "===S:4,S===\n"; + var_dump(fseek($fp, 4)); + var_dump(ftell($fp)); + var_dump(feof($fp)); + echo "===GETC===\n"; + var_dump(fgetc($fp)); + var_dump(ftell($fp)); + var_dump(feof($fp)); + echo "===GETC===\n"; + var_dump(fgetc($fp)); + var_dump(fgetc($fp)); + var_dump(ftell($fp)); + var_dump(feof($fp)); + echo "===REWIND===\n"; + var_dump(rewind($fp)); + var_dump(ftell($fp)); + var_dump(feof($fp)); + echo "===GETC===\n"; + var_dump(fgetc($fp)); + var_dump(ftell($fp)); + var_dump(feof($fp)); + echo "===S:3,S===\n"; + var_dump(fseek($fp, 3, SEEK_SET)); + var_dump(ftell($fp)); + var_dump(feof($fp)); + echo "===S:1,C===\n"; + var_dump(fseek($fp, 1, SEEK_CUR)); + var_dump(ftell($fp)); + var_dump(feof($fp)); + echo "===S:-2,C===\n"; + var_dump(fseek($fp, -2, SEEK_CUR)); + var_dump(ftell($fp)); + var_dump(feof($fp)); + echo "===S:-10,C===\n"; + var_dump(fseek($fp, -10, SEEK_CUR)); + var_dump(ftell($fp)); + var_dump(feof($fp)); + echo "===S:3,S===\n"; + var_dump(fseek($fp, 3, SEEK_SET)); + var_dump(ftell($fp)); + var_dump(feof($fp)); + echo "===S:10,C===\n"; + var_dump(fseek($fp, 10, SEEK_CUR)); + var_dump(ftell($fp)); + var_dump(feof($fp)); + echo "===S:-1,E===\n"; + var_dump(fseek($fp, -1, SEEK_END)); + var_dump(ftell($fp)); + var_dump(feof($fp)); + echo "===S:0,E===\n"; + var_dump(fseek($fp, 0, SEEK_END)); + var_dump(ftell($fp)); + var_dump(feof($fp)); + echo "===S:1,E===\n"; + var_dump(fseek($fp, 1, SEEK_END)); + var_dump(ftell($fp)); + var_dump(feof($fp)); - fclose($fp); + fclose($fp); } ?> diff --git a/ext/standard/tests/file/tempnam_variation3-win32.phpt b/ext/standard/tests/file/tempnam_variation3-win32.phpt index 33965b4f26..3311b0bc7c 100644 --- a/ext/standard/tests/file/tempnam_variation3-win32.phpt +++ b/ext/standard/tests/file/tempnam_variation3-win32.phpt @@ -18,76 +18,76 @@ obscure_filename echo "*** Testing tempnam() with obscure prefixes ***\n"; $file_path = __DIR__."/tempnamVar3"; if (!mkdir($file_path)) { - echo "Failed, cannot create temp dir $filepath\n"; - exit(1); + echo "Failed, cannot create temp dir $filepath\n"; + exit(1); } $file_path = realpath($file_path); /* An array of prefixes */ $names_arr = array( - /* Valid args (casting)*/ - -1, - TRUE, - FALSE, - NULL, - "", - " ", - "\0", - /* Invalid args */ - array(), + /* Valid args (casting)*/ + -1, + TRUE, + FALSE, + NULL, + "", + " ", + "\0", + /* Invalid args */ + array(), - /* Valid args*/ - /* prefix with path separator of a non existing directory*/ - "/no/such/file/dir", - "php/php" + /* Valid args*/ + /* prefix with path separator of a non existing directory*/ + "/no/such/file/dir", + "php/php" ); $res_arr = array( - /* Invalid args */ - true, - true, - true, - true, - true, - true, - true, - false, + /* Invalid args */ + true, + true, + true, + true, + true, + true, + true, + false, - /* prefix with path separator of a non existing directory*/ - true, - true + /* prefix with path separator of a non existing directory*/ + true, + true ); for( $i=0; $i<count($names_arr); $i++ ) { - echo "-- Iteration $i --\n"; - try { + echo "-- Iteration $i --\n"; + try { $file_name = tempnam($file_path, $names_arr[$i]); } catch (TypeError $e) { echo $e->getMessage(), "\n"; continue; } - /* creating the files in existing dir */ - if (file_exists($file_name) && !$res_arr[$i]) { - echo "Failed\n"; - } - if ($res_arr[$i]) { - $file_dir = dirname($file_name); - if (realpath($file_dir) == $file_path || realpath($file_dir . "\\") == $file_path) { - echo "OK\n"; - } else { - echo "Failed, not created in the correct directory " . realpath($file_dir) . ' vs ' . $file_path ."\n"; - } + /* creating the files in existing dir */ + if (file_exists($file_name) && !$res_arr[$i]) { + echo "Failed\n"; + } + if ($res_arr[$i]) { + $file_dir = dirname($file_name); + if (realpath($file_dir) == $file_path || realpath($file_dir . "\\") == $file_path) { + echo "OK\n"; + } else { + echo "Failed, not created in the correct directory " . realpath($file_dir) . ' vs ' . $file_path ."\n"; + } - if (!is_writable($file_name)) { - printf("%o\n", fileperms($file_name) ); + if (!is_writable($file_name)) { + printf("%o\n", fileperms($file_name) ); - } - } else { - echo "OK\n"; - } - @unlink($file_name); + } + } else { + echo "OK\n"; + } + @unlink($file_name); } rmdir($file_path); diff --git a/ext/standard/tests/file/tempnam_variation7-win32.phpt b/ext/standard/tests/file/tempnam_variation7-win32.phpt index bfc23a9541..26ccaef84d 100644 --- a/ext/standard/tests/file/tempnam_variation7-win32.phpt +++ b/ext/standard/tests/file/tempnam_variation7-win32.phpt @@ -19,52 +19,52 @@ obscure_filename echo "*** Testing tempnam() with invalid/non-existing directory names ***\n"; /* An array of names, which will be passed as a dir name */ $names_arr = array( - /* Invalid args */ - -1, - TRUE, - FALSE, - NULL, - "", - " ", - "\0", - array(), + /* Invalid args */ + -1, + TRUE, + FALSE, + NULL, + "", + " ", + "\0", + array(), - /* Non-existing dirs */ - "/no/such/file/dir", - "php" + /* Non-existing dirs */ + "/no/such/file/dir", + "php" ); for( $i=0; $i<count($names_arr); $i++ ) { - echo "-- Iteration $i --\n"; - try { + echo "-- Iteration $i --\n"; + try { $file_name = tempnam($names_arr[$i], "tempnam_variation3.tmp"); } catch (TypeError $e) { echo $e->getMessage(), "\n"; continue; } - if( file_exists($file_name) ){ + if( file_exists($file_name) ){ - echo "File name is => "; - print($file_name); - echo "\n"; + echo "File name is => "; + print($file_name); + echo "\n"; - echo "File permissions are => "; - printf("%o", fileperms($file_name) ); - echo "\n"; + echo "File permissions are => "; + printf("%o", fileperms($file_name) ); + echo "\n"; - echo "File created in => "; - $file_dir = dirname($file_name); - if (realpath($file_dir) == realpath(sys_get_temp_dir()) || realpath($file_dir."\\") == realpath(sys_get_temp_dir())) { - echo "temp dir\n"; - } else { - echo "unknown location\n"; - } - } else { - echo "-- File is not created --\n"; - } + echo "File created in => "; + $file_dir = dirname($file_name); + if (realpath($file_dir) == realpath(sys_get_temp_dir()) || realpath($file_dir."\\") == realpath(sys_get_temp_dir())) { + echo "temp dir\n"; + } else { + echo "unknown location\n"; + } + } else { + echo "-- File is not created --\n"; + } - unlink($file_name); + unlink($file_name); } ?> --EXPECTF-- diff --git a/ext/standard/tests/file/touch_variation5-win32.phpt b/ext/standard/tests/file/touch_variation5-win32.phpt index 02cc4cfb4e..83d1879634 100644 --- a/ext/standard/tests/file/touch_variation5-win32.phpt +++ b/ext/standard/tests/file/touch_variation5-win32.phpt @@ -22,7 +22,7 @@ chdir($cwd); if (!mkdir($cwd . '/' . $workDir)) die("cannot create directory $workDir"); $paths = array( - // relative + // relative $workDir.'/'.$subDirOrFile, './'.$workDir.'/'.$subDirOrFile, $workDir.'/../'.$workDir.'/'.$subDirOrFile, @@ -66,66 +66,66 @@ rmdir($workDir); function test_nonexisting($paths) { - foreach($paths as $path) { - echo "--- testing $path ---\n"; - - if (is_dir($path) || is_file($path)) { - echo "FAILED: $path - exists\n"; - } - else { - $res = touch($path); - if ($res === true) { - // something was created - if (file_exists($path)) { - // something found - if (is_dir($path)) { - echo "FAILED: $path - unexpected directory\n"; - } - else { - echo "PASSED: $path - created\n"; - unlink($path); - } - } - else { - // nothing found - echo "FAILED: $path - touch returned true, nothing there\n"; - } - } - else { - // nothing created - if (file_exists($path)) { - //something found - echo "FAILED: $path - touch returned false, something there\n"; - if (is_dir($path)) { - rmdir($path); - } - else { - unlink($path); - } - } - } - } - } + foreach($paths as $path) { + echo "--- testing $path ---\n"; + + if (is_dir($path) || is_file($path)) { + echo "FAILED: $path - exists\n"; + } + else { + $res = touch($path); + if ($res === true) { + // something was created + if (file_exists($path)) { + // something found + if (is_dir($path)) { + echo "FAILED: $path - unexpected directory\n"; + } + else { + echo "PASSED: $path - created\n"; + unlink($path); + } + } + else { + // nothing found + echo "FAILED: $path - touch returned true, nothing there\n"; + } + } + else { + // nothing created + if (file_exists($path)) { + //something found + echo "FAILED: $path - touch returned false, something there\n"; + if (is_dir($path)) { + rmdir($path); + } + else { + unlink($path); + } + } + } + } + } } function test_existing($paths, $are_dirs) { - foreach($paths as $path) { - if ($are_dirs) { - $res = @mkdir($path); - if ($res == true) { + foreach($paths as $path) { + if ($are_dirs) { + $res = @mkdir($path); + if ($res == true) { test_path($path); rmdir($path); } - } - else { - $h = @fopen($path,"w"); - if ($h !== false) { - fclose($h); + } + else { + $h = @fopen($path,"w"); + if ($h !== false) { + fclose($h); test_path($path); unlink($path); } - } - } + } + } } diff --git a/ext/standard/tests/file/touch_variation5.phpt b/ext/standard/tests/file/touch_variation5.phpt index a42e509809..67382f3b99 100644 --- a/ext/standard/tests/file/touch_variation5.phpt +++ b/ext/standard/tests/file/touch_variation5.phpt @@ -22,7 +22,7 @@ mkdir($workDir); $cwd = getcwd(); $paths = array( - // relative + // relative $workDir.'/'.$subDirOrFile, './'.$workDir.'/'.$subDirOrFile, $workDir.'/../'.$workDir.'/'.$subDirOrFile, @@ -66,66 +66,66 @@ rmdir($workDir); function test_nonexisting($paths) { - foreach($paths as $path) { - echo "--- testing $path ---\n"; - - if (is_dir($path) || is_file($path)) { - echo "FAILED: $path - exists\n"; - } - else { - $res = touch($path); - if ($res === true) { - // something was created - if (file_exists($path)) { - // something found - if (is_dir($path)) { - echo "FAILED: $path - unexpected directory\n"; - } - else { - echo "PASSED: $path - created\n"; - unlink($path); - } - } - else { - // nothing found - echo "FAILED: $path - touch returned true, nothing there\n"; - } - } - else { - // nothing created - if (file_exists($path)) { - //something found - echo "FAILED: $path - touch returned false, something there\n"; - if (is_dir($path)) { - rmdir($path); - } - else { - unlink($path); - } - } - } - } - } + foreach($paths as $path) { + echo "--- testing $path ---\n"; + + if (is_dir($path) || is_file($path)) { + echo "FAILED: $path - exists\n"; + } + else { + $res = touch($path); + if ($res === true) { + // something was created + if (file_exists($path)) { + // something found + if (is_dir($path)) { + echo "FAILED: $path - unexpected directory\n"; + } + else { + echo "PASSED: $path - created\n"; + unlink($path); + } + } + else { + // nothing found + echo "FAILED: $path - touch returned true, nothing there\n"; + } + } + else { + // nothing created + if (file_exists($path)) { + //something found + echo "FAILED: $path - touch returned false, something there\n"; + if (is_dir($path)) { + rmdir($path); + } + else { + unlink($path); + } + } + } + } + } } function test_existing($paths, $are_dirs) { - foreach($paths as $path) { - if ($are_dirs) { - $res = @mkdir($path); - if ($res == true) { + foreach($paths as $path) { + if ($are_dirs) { + $res = @mkdir($path); + if ($res == true) { test_path($path); rmdir($path); } - } - else { - $h = @fopen($path,"w"); - if ($h !== false) { - fclose($h); + } + else { + $h = @fopen($path,"w"); + if ($h !== false) { + fclose($h); test_path($path); unlink($path); } - } - } + } + } } diff --git a/ext/standard/tests/file/touch_variation6-win32.phpt b/ext/standard/tests/file/touch_variation6-win32.phpt index d03671fff8..b9e9ce7a6c 100644 --- a/ext/standard/tests/file/touch_variation6-win32.phpt +++ b/ext/standard/tests/file/touch_variation6-win32.phpt @@ -25,7 +25,7 @@ $cwd = getcwd(); $unixifiedDirOrFile = '/'.substr(str_replace('\\','/',$cwd).'/'.$workDir.'/'.$subDirOrFile, 3); $paths = array( - // relative + // relative $workDir.'\\'.$subDirOrFile, '.\\'.$workDir.'\\'.$subDirOrFile, $workDir.'\\..\\'.$workDir.'\\'.$subDirOrFile, @@ -72,66 +72,66 @@ rmdir($workDir); function test_nonexisting($paths) { - foreach($paths as $path) { - echo "--- testing $path ---\n"; - - if (is_dir($path) || is_file($path)) { - echo "FAILED: $path - exists\n"; - } - else { - $res = touch($path); - if ($res === true) { - // something was created - if (file_exists($path)) { - // something found - if (is_dir($path)) { - echo "FAILED: $path - unexpected directory\n"; - } - else { - echo "PASSED: $path - created\n"; - unlink($path); - } - } - else { - // nothing found - echo "FAILED: $path - touch returned true, nothing there\n"; - } - } - else { - // nothing created - if (file_exists($path)) { - //something found - echo "FAILED: $path - touch returned false, something there\n"; - if (is_dir($path)) { - rmdir($path); - } - else { - unlink($path); - } - } - } - } - } + foreach($paths as $path) { + echo "--- testing $path ---\n"; + + if (is_dir($path) || is_file($path)) { + echo "FAILED: $path - exists\n"; + } + else { + $res = touch($path); + if ($res === true) { + // something was created + if (file_exists($path)) { + // something found + if (is_dir($path)) { + echo "FAILED: $path - unexpected directory\n"; + } + else { + echo "PASSED: $path - created\n"; + unlink($path); + } + } + else { + // nothing found + echo "FAILED: $path - touch returned true, nothing there\n"; + } + } + else { + // nothing created + if (file_exists($path)) { + //something found + echo "FAILED: $path - touch returned false, something there\n"; + if (is_dir($path)) { + rmdir($path); + } + else { + unlink($path); + } + } + } + } + } } function test_existing($paths, $are_dirs) { - foreach($paths as $path) { - if ($are_dirs) { - $res = @mkdir($path); - if ($res == true) { + foreach($paths as $path) { + if ($are_dirs) { + $res = @mkdir($path); + if ($res == true) { test_path($path); rmdir($path); } - } - else { - $h = @fopen($path,"w"); - if ($h !== false) { - fclose($h); + } + else { + $h = @fopen($path,"w"); + if ($h !== false) { + fclose($h); test_path($path); unlink($path); } - } - } + } + } } diff --git a/ext/standard/tests/file/unlink_variation10.phpt b/ext/standard/tests/file/unlink_variation10.phpt index 3a56a73a5a..ae48764d9b 100644 --- a/ext/standard/tests/file/unlink_variation10.phpt +++ b/ext/standard/tests/file/unlink_variation10.phpt @@ -56,18 +56,18 @@ rmdir($workDir); function test_link($linkedDir, $toLinkTo, $tounlink, $softlink) { if ($softlink == true) { - symlink($toLinkTo, $linkedDir); - $msg = "soft link"; + symlink($toLinkTo, $linkedDir); + $msg = "soft link"; } else { - link($toLinkTo, $linkedDir); - $msg = "hard link"; + link($toLinkTo, $linkedDir); + $msg = "hard link"; } echo "-- unlinking $msg $tounlink --\n"; $res = unlink($tounlink); if ($res === true) { if (is_link($tounlink) === false) { - echo "directory unlinked\n"; + echo "directory unlinked\n"; } else { echo "FAILED: directory not unlinked\n"; diff --git a/ext/standard/tests/file/unlink_variation8-win32.phpt b/ext/standard/tests/file/unlink_variation8-win32.phpt index efd24a22cb..12b43a340f 100644 --- a/ext/standard/tests/file/unlink_variation8-win32.phpt +++ b/ext/standard/tests/file/unlink_variation8-win32.phpt @@ -65,7 +65,7 @@ function test_realfile($file, $tounlink) { $res = unlink($tounlink); if ($res === true) { if (file_exists($tounlink) === false) { - echo "file removed\n"; + echo "file removed\n"; } else { echo "FAILED: file not removed\n"; diff --git a/ext/standard/tests/file/unlink_variation8.phpt b/ext/standard/tests/file/unlink_variation8.phpt index ee2540dd69..41c18f710b 100644 --- a/ext/standard/tests/file/unlink_variation8.phpt +++ b/ext/standard/tests/file/unlink_variation8.phpt @@ -70,7 +70,7 @@ function test_realfile($file, $tounlink) { $res = unlink($tounlink); if ($res === true) { if (file_exists($tounlink) === false) { - echo "file removed\n"; + echo "file removed\n"; } else { echo "FAILED: file not removed\n"; @@ -83,18 +83,18 @@ function test_realfile($file, $tounlink) { function test_link($linkedfile, $toLinkTo, $tounlink, $softlink) { if ($softlink == true) { - symlink($toLinkTo, $linkedfile); - $msg = "soft link"; + symlink($toLinkTo, $linkedfile); + $msg = "soft link"; } else { - link($toLinkTo, $linkedfile); - $msg = "hard link"; + link($toLinkTo, $linkedfile); + $msg = "hard link"; } echo "-- unlinking $msg $tounlink --\n"; $res = unlink($tounlink); if ($res === true) { if (file_exists($tounlink) === false) { - echo "file unlinked\n"; + echo "file unlinked\n"; } else { echo "FAILED: file not unlinked\n"; diff --git a/ext/standard/tests/file/unlink_variation9-win32.phpt b/ext/standard/tests/file/unlink_variation9-win32.phpt index 3c9d5e4a14..83a3f5617d 100644 --- a/ext/standard/tests/file/unlink_variation9-win32.phpt +++ b/ext/standard/tests/file/unlink_variation9-win32.phpt @@ -58,14 +58,14 @@ $files = array( foreach($files as $fileToUnlink) { - $file = $workDir.'/'.$tmpFile; - $tounlink = $fileToUnlink; + $file = $workDir.'/'.$tmpFile; + $tounlink = $fileToUnlink; touch($file); echo "-- removing $tounlink --\n"; $res = unlink($tounlink); if ($res === true) { if (file_exists($tounlink) === false) { - echo "file removed\n"; + echo "file removed\n"; } else { echo "FAILED: file not removed\n"; diff --git a/ext/standard/tests/file/userdirstream.phpt b/ext/standard/tests/file/userdirstream.phpt index a83e899b83..e2f03dabb7 100644 --- a/ext/standard/tests/file/userdirstream.phpt +++ b/ext/standard/tests/file/userdirstream.phpt @@ -3,33 +3,33 @@ Directory Streams --FILE-- <?php class test { - public $idx = 0; + public $idx = 0; - function dir_opendir($path, $options) { - print "Opening\n"; - $this->idx = 0; + function dir_opendir($path, $options) { + print "Opening\n"; + $this->idx = 0; - return true; - } + return true; + } - function dir_readdir() { - $sample = array('first','second','third','fourth'); + function dir_readdir() { + $sample = array('first','second','third','fourth'); - if ($this->idx >= count($sample)) return false; - else return $sample[$this->idx++]; - } + if ($this->idx >= count($sample)) return false; + else return $sample[$this->idx++]; + } - function dir_rewinddir() { - $this->idx = 0; + function dir_rewinddir() { + $this->idx = 0; - return true; - } + return true; + } - function dir_closedir() { - print "Closing up!\n"; + function dir_closedir() { + print "Closing up!\n"; - return true; - } + return true; + } } stream_wrapper_register('test', 'test'); diff --git a/ext/standard/tests/file/userstreams.phpt b/ext/standard/tests/file/userstreams.phpt index 790b74a0c3..5b753e02e4 100644 --- a/ext/standard/tests/file/userstreams.phpt +++ b/ext/standard/tests/file/userstreams.phpt @@ -22,7 +22,7 @@ call me what you will Free to speak my mind anywhere and Ill redefine anywhere Anywhere I roam - Where I lay my head is home + Where I lay my head is home ...and the earth becomes my throne I adapt to the unknown under wandering stars Ive grown @@ -38,12 +38,12 @@ call me what you will Free to speak my mind anywhere and Ill never mind anywhere Anywhere I roam - Where I lay my head is home + Where I lay my head is home But Ill take my time anywhere Free to speak my mind anywhere and Ill take my find anywhere Anywhere I roam - Where I lay my head is home + Where I lay my head is home carved upon my stone my body lie but still I roam Wherever I may roam. @@ -57,10 +57,10 @@ EOD; * to seek around... */ $DATA = ""; for ($i = 0; $i < 30; $i++) { - if ($i % 2 == 0) - $DATA .= str_rot13($lyrics); - else - $DATA .= $lyrics; + if ($i % 2 == 0) + $DATA .= str_rot13($lyrics); + else + $DATA .= $lyrics; } /* store the data in a regular file so that we can compare @@ -70,10 +70,10 @@ fwrite($tf, $DATA); $n = ftell($tf); rewind($tf) or die("failed to rewind tmp file!"); if (ftell($tf) != 0) - die("tmpfile is not at start!"); + die("tmpfile is not at start!"); $DATALEN = strlen($DATA); if ($n != $DATALEN) - die("tmpfile stored $n bytes; should be $DATALEN!"); + die("tmpfile stored $n bytes; should be $DATALEN!"); class uselessstream { @@ -81,150 +81,150 @@ class uselessstream class mystream { - public $path; - public $mode; - public $options; - - public $position; - public $varname; - - function stream_open($path, $mode, $options, &$opened_path) - { - $this->path = $path; - $this->mode = $mode; - $this->options = $options; - - $split = parse_url($path); - $this->varname = $split["host"]; - - if (strchr($mode, 'a')) - $this->position = strlen($GLOBALS[$this->varname]); - else - $this->position = 0; - - return true; - } - - function stream_read($count) - { - $ret = substr($GLOBALS[$this->varname], $this->position, $count); - $this->position += strlen($ret); - return $ret; - } - - function stream_tell() - { - return $this->position; - } - - function stream_eof() - { - return $this->position >= strlen($GLOBALS[$this->varname]); - } - - function stream_seek($offset, $whence) - { - switch($whence) { - case SEEK_SET: - if ($offset < strlen($GLOBALS[$this->varname]) && $offset >= 0) { - $this->position = $offset; - return true; - } else { - return false; - } - break; - case SEEK_CUR: - if ($offset >= 0) { - $this->position += $offset; - return true; - } else { - return false; - } - break; - case SEEK_END: - if (strlen($GLOBALS[$this->varname]) + $offset >= 0) { - $this->position = strlen($GLOBALS[$this->varname]) + $offset; - return true; - } else { - return false; - } - break; - default: - return false; - } - } + public $path; + public $mode; + public $options; + + public $position; + public $varname; + + function stream_open($path, $mode, $options, &$opened_path) + { + $this->path = $path; + $this->mode = $mode; + $this->options = $options; + + $split = parse_url($path); + $this->varname = $split["host"]; + + if (strchr($mode, 'a')) + $this->position = strlen($GLOBALS[$this->varname]); + else + $this->position = 0; + + return true; + } + + function stream_read($count) + { + $ret = substr($GLOBALS[$this->varname], $this->position, $count); + $this->position += strlen($ret); + return $ret; + } + + function stream_tell() + { + return $this->position; + } + + function stream_eof() + { + return $this->position >= strlen($GLOBALS[$this->varname]); + } + + function stream_seek($offset, $whence) + { + switch($whence) { + case SEEK_SET: + if ($offset < strlen($GLOBALS[$this->varname]) && $offset >= 0) { + $this->position = $offset; + return true; + } else { + return false; + } + break; + case SEEK_CUR: + if ($offset >= 0) { + $this->position += $offset; + return true; + } else { + return false; + } + break; + case SEEK_END: + if (strlen($GLOBALS[$this->varname]) + $offset >= 0) { + $this->position = strlen($GLOBALS[$this->varname]) + $offset; + return true; + } else { + return false; + } + break; + default: + return false; + } + } } if (@stream_wrapper_register("bogus", "class_not_exist")) { - die("Registered a non-existent class!!!???"); + die("Registered a non-existent class!!!???"); } echo "Not Registered\n"; if (!stream_wrapper_register("test", "mystream")) { - die("test wrapper registration failed"); + die("test wrapper registration failed"); } echo "Registered\n"; if (!stream_wrapper_register("bogon", "uselessstream")) { - die("bogon wrapper registration failed"); + die("bogon wrapper registration failed"); } echo "Registered\n"; $b = @fopen("bogon://url", "rb"); if (is_resource($b)) { - die("Opened a bogon??"); + die("Opened a bogon??"); } $fp = fopen("test://DATA", "rb"); if (!$fp || !is_resource($fp)) { - die("Failed to open resource"); + die("Failed to open resource"); } /* some default seeks that will cause buffer/cache misses */ $seeks = array( - array(SEEK_SET, 0, 0), - array(SEEK_CUR, 8450, 8450), - array(SEEK_CUR, -7904, 546), - array(SEEK_CUR, 12456, 13002), - - /* end up at BOF so that randomly generated seek offsets - * below will know where they are supposed to be */ - array(SEEK_SET, 0, 0) + array(SEEK_SET, 0, 0), + array(SEEK_CUR, 8450, 8450), + array(SEEK_CUR, -7904, 546), + array(SEEK_CUR, 12456, 13002), + + /* end up at BOF so that randomly generated seek offsets + * below will know where they are supposed to be */ + array(SEEK_SET, 0, 0) ); $whence_map = array( - SEEK_CUR, - SEEK_SET, - SEEK_END + SEEK_CUR, + SEEK_SET, + SEEK_END ); $whence_names = array( - SEEK_CUR => "SEEK_CUR", - SEEK_SET => "SEEK_SET", - SEEK_END => "SEEK_END" - ); + SEEK_CUR => "SEEK_CUR", + SEEK_SET => "SEEK_SET", + SEEK_END => "SEEK_END" + ); /* generate some random seek offsets */ $position = 0; for ($i = 0; $i < 256; $i++) { - $whence = $whence_map[array_rand($whence_map, 1)]; - switch($whence) { - case SEEK_SET: - $offset = rand(0, $DATALEN - 1); - $position = $offset; - break; - case SEEK_END: - $offset = -rand(0, $DATALEN - 1); - $position = $DATALEN + $offset; - break; - case SEEK_CUR: - $offset = rand(0, $DATALEN - 1); - $offset -= $position; - $position += $offset; - break; - } - - $seeks[] = array($whence, $offset, $position); + $whence = $whence_map[array_rand($whence_map, 1)]; + switch($whence) { + case SEEK_SET: + $offset = rand(0, $DATALEN - 1); + $position = $offset; + break; + case SEEK_END: + $offset = -rand(0, $DATALEN - 1); + $position = $DATALEN + $offset; + break; + case SEEK_CUR: + $offset = rand(0, $DATALEN - 1); + $offset -= $position; + $position += $offset; + break; + } + + $seeks[] = array($whence, $offset, $position); } /* we compare the results of fgets using differing line lengths to @@ -234,50 +234,50 @@ $fail_count = 0; ob_start(); foreach($line_lengths as $line_length) { - /* now compare the real stream with the user stream */ - $j = 0; - rewind($tf); - rewind($fp); - foreach($seeks as $seekdata) { - list($whence, $offset, $position) = $seekdata; - - $rpb = ftell($tf); - $rr = (int)fseek($tf, $offset, $whence); - $rpa = ftell($tf); - $rline = fgets($tf, $line_length); - (int)fseek($tf, - strlen($rline), SEEK_CUR); - - $upb = ftell($fp); - $ur = (int)fseek($fp, $offset, $whence); - $upa = ftell($fp); - $uline = fgets($fp, $line_length); - (int)fseek($fp, - strlen($uline), SEEK_CUR); - - printf("\n--[%d] whence=%s offset=%d line_length=%d position_should_be=%d --\n", - $j, $whence_names[$whence], $offset, $line_length, $position); - printf("REAL: pos=(%d,%d,%d) ret=%d line[%d]=`%s'\n", $rpb, $rpa, ftell($tf), $rr, strlen($rline), $rline); - printf("USER: pos=(%d,%d,%d) ret=%d line[%d]=`%s'\n", $upb, $upa, ftell($fp), $ur, strlen($uline), $uline); - - if ($rr != $ur || $rline != $uline || $rpa != $position || $upa != $position) { - $fail_count++; - echo "###################################### FAIL!\n"; - $dat = stream_get_meta_data($fp); - var_dump($dat); - break; - } - - $j++; - } - if ($fail_count) - break; + /* now compare the real stream with the user stream */ + $j = 0; + rewind($tf); + rewind($fp); + foreach($seeks as $seekdata) { + list($whence, $offset, $position) = $seekdata; + + $rpb = ftell($tf); + $rr = (int)fseek($tf, $offset, $whence); + $rpa = ftell($tf); + $rline = fgets($tf, $line_length); + (int)fseek($tf, - strlen($rline), SEEK_CUR); + + $upb = ftell($fp); + $ur = (int)fseek($fp, $offset, $whence); + $upa = ftell($fp); + $uline = fgets($fp, $line_length); + (int)fseek($fp, - strlen($uline), SEEK_CUR); + + printf("\n--[%d] whence=%s offset=%d line_length=%d position_should_be=%d --\n", + $j, $whence_names[$whence], $offset, $line_length, $position); + printf("REAL: pos=(%d,%d,%d) ret=%d line[%d]=`%s'\n", $rpb, $rpa, ftell($tf), $rr, strlen($rline), $rline); + printf("USER: pos=(%d,%d,%d) ret=%d line[%d]=`%s'\n", $upb, $upa, ftell($fp), $ur, strlen($uline), $uline); + + if ($rr != $ur || $rline != $uline || $rpa != $position || $upa != $position) { + $fail_count++; + echo "###################################### FAIL!\n"; + $dat = stream_get_meta_data($fp); + var_dump($dat); + break; + } + + $j++; + } + if ($fail_count) + break; } if ($fail_count == 0) { - ob_end_clean(); - echo "SEEK: OK\n"; + ob_end_clean(); + echo "SEEK: OK\n"; } else { - echo "SEEK: FAIL\n"; - ob_end_flush(); + echo "SEEK: FAIL\n"; + ob_end_flush(); } $fail_count = 0; @@ -286,23 +286,23 @@ fseek($fp, $DATALEN / 2, SEEK_SET); fseek($tf, $DATALEN / 2, SEEK_SET); if (ftell($fp) != ftell($tf)) { - echo "SEEK: positions do not match!\n"; + echo "SEEK: positions do not match!\n"; } $n = 0; while(!feof($fp)) { - $uline = fgets($fp, 1024); - $rline = fgets($tf, 1024); - - if ($uline != $rline) { - echo "FGETS: FAIL\niter=$n user=$uline [pos=" . ftell($fp) . "]\nreal=$rline [pos=" . ftell($tf) . "]\n"; - $fail_count++; - break; - } + $uline = fgets($fp, 1024); + $rline = fgets($tf, 1024); + + if ($uline != $rline) { + echo "FGETS: FAIL\niter=$n user=$uline [pos=" . ftell($fp) . "]\nreal=$rline [pos=" . ftell($tf) . "]\n"; + $fail_count++; + break; + } } if ($fail_count == 0) { - echo "FGETS: OK\n"; + echo "FGETS: OK\n"; } /* One final test to see if the position is respected when opened for append */ diff --git a/ext/standard/tests/file/userstreams_002.phpt b/ext/standard/tests/file/userstreams_002.phpt index b625e46f26..95e085947f 100644 --- a/ext/standard/tests/file/userstreams_002.phpt +++ b/ext/standard/tests/file/userstreams_002.phpt @@ -3,30 +3,30 @@ User-space streams: stream_cast() --FILE-- <?php class test_wrapper_base { - public $return_value; - function stream_open($path, $mode, $openedpath) { - return true; - } - function stream_eof() { - return false; - } + public $return_value; + function stream_open($path, $mode, $openedpath) { + return true; + } + function stream_eof() { + return false; + } } class test_wrapper extends test_wrapper_base { - function stream_cast($castas) { - return $this->return_value; - } + function stream_cast($castas) { + return $this->return_value; + } } function test($name, $fd, $return_value) { - echo "\n------ $name: -------\n"; - $data = stream_get_meta_data($fd); - $data['wrapper_data']->return_value = $return_value; - $r = array($fd); - $w = $e = null; - try { - var_dump(stream_select($r, $w, $e, 0) !== false); - } catch (TypeError|ValueError $e) { - echo $e->getMessage(), "\n"; - } + echo "\n------ $name: -------\n"; + $data = stream_get_meta_data($fd); + $data['wrapper_data']->return_value = $return_value; + $r = array($fd); + $w = $e = null; + try { + var_dump(stream_select($r, $w, $e, 0) !== false); + } catch (TypeError|ValueError $e) { + echo $e->getMessage(), "\n"; + } } var_dump(stream_wrapper_register('test', 'test_wrapper')); diff --git a/ext/standard/tests/file/userstreams_003.phpt b/ext/standard/tests/file/userstreams_003.phpt index 9ee71f2666..686963adf7 100644 --- a/ext/standard/tests/file/userstreams_003.phpt +++ b/ext/standard/tests/file/userstreams_003.phpt @@ -3,37 +3,37 @@ User-space streams: stream_set_option() --FILE-- <?php class test_wrapper_base { - public $return_value; - public $expected_option; - public $expected_value; - function stream_open($path, $mode, $openedpath) { - return true; - } - function stream_eof() { - return false; - } + public $return_value; + public $expected_option; + public $expected_value; + function stream_open($path, $mode, $openedpath) { + return true; + } + function stream_eof() { + return false; + } } class test_wrapper extends test_wrapper_base { - function stream_set_option($option, $value, $ptrparam) { - echo "value:\n"; - var_dump($value); - echo "ptrparam:\n"; - var_dump($ptrparam); - echo "\$option === $option === " . $this->expected_option . ":\n"; - var_dump($option === $this->expected_option); - echo "\$value === $value === " . $this->expected_value. ":\n"; - var_dump($value === $this->expected_value); - return $this->return_value; - } + function stream_set_option($option, $value, $ptrparam) { + echo "value:\n"; + var_dump($value); + echo "ptrparam:\n"; + var_dump($ptrparam); + echo "\$option === $option === " . $this->expected_option . ":\n"; + var_dump($option === $this->expected_option); + echo "\$value === $value === " . $this->expected_value. ":\n"; + var_dump($value === $this->expected_value); + return $this->return_value; + } } function test($name, $fd, $return_value, $func, $args, $expected_option, $expected_value) { - echo "\n------ $name: -------\n"; - $data = stream_get_meta_data($fd); - $data['wrapper_data']->return_value = $return_value; - $data['wrapper_data']->expected_option = $expected_option; - $data['wrapper_data']->expected_value = $expected_value; - var_dump(call_user_func_array($func, $args)); + echo "\n------ $name: -------\n"; + $data = stream_get_meta_data($fd); + $data['wrapper_data']->return_value = $return_value; + $data['wrapper_data']->expected_option = $expected_option; + $data['wrapper_data']->expected_value = $expected_value; + var_dump(call_user_func_array($func, $args)); } var_dump(stream_wrapper_register('test', 'test_wrapper')); diff --git a/ext/standard/tests/file/userstreams_004.phpt b/ext/standard/tests/file/userstreams_004.phpt index da9f148b5d..df1a9f3604 100644 --- a/ext/standard/tests/file/userstreams_004.phpt +++ b/ext/standard/tests/file/userstreams_004.phpt @@ -3,24 +3,24 @@ User-space streams: stream_lock() --FILE-- <?php class test_wrapper_base { - public $mode; - function stream_open($path, $mode, $openedpath) { - return true; - } - function stream_eof() { - return false; - } + public $mode; + function stream_open($path, $mode, $openedpath) { + return true; + } + function stream_eof() { + return false; + } } class test_wrapper extends test_wrapper_base { - function stream_lock($mode) { - $this->mode = $mode; - } + function stream_lock($mode) { + $this->mode = $mode; + } } function test($name, $fd, $mode) { - echo "------ $name: -------\n"; - flock($fd, $mode); - $data = stream_get_meta_data($fd); - var_dump($data['wrapper_data']->mode === $mode); + echo "------ $name: -------\n"; + flock($fd, $mode); + $data = stream_get_meta_data($fd); + var_dump($data['wrapper_data']->mode === $mode); } var_dump(stream_wrapper_register('test', 'test_wrapper')); @@ -32,8 +32,8 @@ $fd2 = fopen("test2://foo","r"); test("stream_lock not implemented", $fd2, LOCK_EX); foreach(array("LOCK_SH","LOCK_EX","LOCK_UN") as $mode) { - test("fclock($mode)", $fd, constant($mode)); - test("fclock($mode|LOCK_NB)", $fd, constant($mode)|LOCK_NB); + test("fclock($mode)", $fd, constant($mode)); + test("fclock($mode|LOCK_NB)", $fd, constant($mode)|LOCK_NB); } ?> diff --git a/ext/standard/tests/file/userstreams_005.phpt b/ext/standard/tests/file/userstreams_005.phpt index 0c3113c197..5650df2aa0 100644 --- a/ext/standard/tests/file/userstreams_005.phpt +++ b/ext/standard/tests/file/userstreams_005.phpt @@ -3,29 +3,29 @@ User-space streams: stream_truncate() --FILE-- <?php class test_wrapper_base { - public $mode; - function stream_open($path, $mode, $openedpath) { - return true; - } - function stream_eof() { - return false; - } + public $mode; + function stream_open($path, $mode, $openedpath) { + return true; + } + function stream_eof() { + return false; + } } class test_wrapper extends test_wrapper_base { - function stream_truncate($new_size) { - echo "truncation with new_size=$new_size\n"; - return true; - } + function stream_truncate($new_size) { + echo "truncation with new_size=$new_size\n"; + return true; + } } class test_wrapper_bad extends test_wrapper_base { - function stream_truncate($new_size) { - echo "truncation with new_size=$new_size\n"; - return "kkk"; - } + function stream_truncate($new_size) { + echo "truncation with new_size=$new_size\n"; + return "kkk"; + } } function test($name, $fd, $dest_size) { - echo "------ $name: -------\n"; - var_dump(ftruncate($fd, $dest_size)); + echo "------ $name: -------\n"; + var_dump(ftruncate($fd, $dest_size)); } var_dump(stream_wrapper_register('test', 'test_wrapper')); var_dump(stream_wrapper_register('test2', 'test_wrapper_base')); diff --git a/ext/standard/tests/file/userstreams_006.phpt b/ext/standard/tests/file/userstreams_006.phpt index 3269ccce3e..561bea4fb5 100644 --- a/ext/standard/tests/file/userstreams_006.phpt +++ b/ext/standard/tests/file/userstreams_006.phpt @@ -3,20 +3,20 @@ User-space streams: set_options returns "not implemented" for unhandled option t --FILE-- <?php class test_wrapper { - function stream_open($path, $mode, $openedpath) { - return true; - } - function stream_eof() { - return false; - } - function stream_write($data) { - echo "size: ", strlen($data), "\n"; - return strlen($data); - } - function stream_set_option($option, $arg1, $arg2) { - echo "option: ", $option, ", ", $arg1, ", ", $arg2, "\n"; - return false; - } + function stream_open($path, $mode, $openedpath) { + return true; + } + function stream_eof() { + return false; + } + function stream_write($data) { + echo "size: ", strlen($data), "\n"; + return strlen($data); + } + function stream_set_option($option, $arg1, $arg2) { + echo "option: ", $option, ", ", $arg1, ", ", $arg2, "\n"; + return false; + } } var_dump(stream_wrapper_register('test', 'test_wrapper')); diff --git a/ext/standard/tests/file/userstreams_007.phpt b/ext/standard/tests/file/userstreams_007.phpt index b3e52bb098..31a7e4f872 100644 --- a/ext/standard/tests/file/userstreams_007.phpt +++ b/ext/standard/tests/file/userstreams_007.phpt @@ -3,19 +3,19 @@ User-space streams: test metadata option --FILE-- <?php class test_wrapper { - function stream_open($path, $mode, $openedpath) { - return true; - } + function stream_open($path, $mode, $openedpath) { + return true; + } public function stream_metadata($path, $option, $var) { - echo "metadata: $path, $option\n"; - if(is_array($var)) { - echo join(",", $var); - } else { - echo $var; - } - echo "\n"; - return false; - } + echo "metadata: $path, $option\n"; + if(is_array($var)) { + echo join(",", $var); + } else { + echo $var; + } + echo "\n"; + return false; + } } var_dump(stream_wrapper_register('test', 'test_wrapper')); diff --git a/ext/standard/tests/file/userwrapper.phpt b/ext/standard/tests/file/userwrapper.phpt index dd4f0d3dd1..6e516d68db 100644 --- a/ext/standard/tests/file/userwrapper.phpt +++ b/ext/standard/tests/file/userwrapper.phpt @@ -20,9 +20,9 @@ class test { } function url_stat($path, $options) { - /* By printing out a notice that we are actively stating the file - then subsequently performing multiple stat operations on it - we effectively test the stat cache mechanism */ + /* By printing out a notice that we are actively stating the file + then subsequently performing multiple stat operations on it + we effectively test the stat cache mechanism */ print "Stating file: $path\n"; return array('dev'=>1, 'ino'=>2, 'mode'=>0644, 'nlink'=>3, 'uid'=>100, 'gid'=>1000, 'rdev'=>-1, 'size'=>31337, diff --git a/ext/standard/tests/file/windows_acls/bug44859.phpt b/ext/standard/tests/file/windows_acls/bug44859.phpt index 679734b379..513c3a6af8 100644 --- a/ext/standard/tests/file/windows_acls/bug44859.phpt +++ b/ext/standard/tests/file/windows_acls/bug44859.phpt @@ -12,42 +12,42 @@ include_once __DIR__ . '/common.inc'; fix_acls(); $iteration = array( - PHPT_ACL_READ => false, - PHPT_ACL_NONE => false, - PHPT_ACL_WRITE => true, - PHPT_ACL_WRITE|PHPT_ACL_READ => true, + PHPT_ACL_READ => false, + PHPT_ACL_NONE => false, + PHPT_ACL_WRITE => true, + PHPT_ACL_WRITE|PHPT_ACL_READ => true, ); echo "Testing file:\n"; $i = 1; $path = $uniqueBasePath . '_file.txt'; foreach ($iteration as $perms => $exp) { - create_file($path, $perms); - clearstatcache(true, $path); - echo 'Iteration #' . $i++ . ': '; - if (is_writable($path) == $exp) { - echo "passed.\n"; - } else { - var_dump(is_writable($path), $exp); - echo "failed.\n"; - } - delete_file($path); + create_file($path, $perms); + clearstatcache(true, $path); + echo 'Iteration #' . $i++ . ': '; + if (is_writable($path) == $exp) { + echo "passed.\n"; + } else { + var_dump(is_writable($path), $exp); + echo "failed.\n"; + } + delete_file($path); } echo "Testing directory:\n"; $path = $uniqueBasePath . '_dir'; $i = 1; foreach ($iteration as $perms => $exp) { - create_dir($path, $perms); - clearstatcache(true, $path); - echo 'Iteration #' . $i++ . ': '; - if (is_writable($path) == $exp) { - echo "passed.\n"; - } else { - var_dump(is_writable($path), $exp); - echo "failed.\n"; - } - delete_dir($path); + create_dir($path, $perms); + clearstatcache(true, $path); + echo 'Iteration #' . $i++ . ': '; + if (is_writable($path) == $exp) { + echo "passed.\n"; + } else { + var_dump(is_writable($path), $exp); + echo "failed.\n"; + } + delete_dir($path); } ?> diff --git a/ext/standard/tests/file/windows_acls/bug44859_2.phpt b/ext/standard/tests/file/windows_acls/bug44859_2.phpt index b88d07f820..4b5fd9e139 100644 --- a/ext/standard/tests/file/windows_acls/bug44859_2.phpt +++ b/ext/standard/tests/file/windows_acls/bug44859_2.phpt @@ -12,42 +12,42 @@ include_once __DIR__ . '/common.inc'; fix_acls(); $iteration = array( - PHPT_ACL_READ => true, - PHPT_ACL_NONE => false, - PHPT_ACL_WRITE => false, - PHPT_ACL_WRITE|PHPT_ACL_READ => true, + PHPT_ACL_READ => true, + PHPT_ACL_NONE => false, + PHPT_ACL_WRITE => false, + PHPT_ACL_WRITE|PHPT_ACL_READ => true, ); echo "Testing file:\n"; $i = 1; $path = $uniqueBasePath . '_file.txt'; foreach ($iteration as $perms => $exp) { - create_file($path, $perms); - clearstatcache(true, $path); - echo 'Iteration #' . $i++ . ': '; - if (is_readable($path) == $exp) { - echo "passed.\n"; - } else { - var_dump(is_readable($path), $exp); - echo "failed.\n"; - } - delete_file($path); + create_file($path, $perms); + clearstatcache(true, $path); + echo 'Iteration #' . $i++ . ': '; + if (is_readable($path) == $exp) { + echo "passed.\n"; + } else { + var_dump(is_readable($path), $exp); + echo "failed.\n"; + } + delete_file($path); } echo "Testing directory:\n"; $path = $uniqueBasePath . '_dir'; $i = 1; foreach ($iteration as $perms => $exp) { - create_dir($path, $perms); - clearstatcache(true, $path); - echo 'Iteration #' . $i++ . ': '; - if (is_readable($path) == $exp) { - echo "passed.\n"; - } else { - var_dump(is_readable($path), $exp); - echo "failed.\n"; - } - delete_dir($path); + create_dir($path, $perms); + clearstatcache(true, $path); + echo 'Iteration #' . $i++ . ': '; + if (is_readable($path) == $exp) { + echo "passed.\n"; + } else { + var_dump(is_readable($path), $exp); + echo "failed.\n"; + } + delete_dir($path); } ?> diff --git a/ext/standard/tests/file/windows_acls/bug44859_3.phpt b/ext/standard/tests/file/windows_acls/bug44859_3.phpt index 35db1f29be..465c7557ac 100644 --- a/ext/standard/tests/file/windows_acls/bug44859_3.phpt +++ b/ext/standard/tests/file/windows_acls/bug44859_3.phpt @@ -11,23 +11,23 @@ include_once __DIR__ . '/common.inc'; fix_acls(); $iteration = array( - 'tiny.exe' => true, - //'tiny.bat' => true, To be fixed in _access - __FILE__ => false + 'tiny.exe' => true, + //'tiny.bat' => true, To be fixed in _access + __FILE__ => false ); $i = 1; $path = __DIR__; foreach ($iteration as $file => $exp) { - $path = __DIR__ . '/' . $file; - echo 'Iteration #' . $i++ . ': '; - if (is_executable($path) == $exp) { - echo "passed.\n"; - } else { - var_dump(is_executable($path), $exp); - echo "failed.\n"; - } + $path = __DIR__ . '/' . $file; + echo 'Iteration #' . $i++ . ': '; + if (is_executable($path) == $exp) { + echo "passed.\n"; + } else { + var_dump(is_executable($path), $exp); + echo "failed.\n"; + } } diff --git a/ext/standard/tests/file/windows_acls/bug44859_4.phpt b/ext/standard/tests/file/windows_acls/bug44859_4.phpt index e0fbe11f4b..483438bcf6 100644 --- a/ext/standard/tests/file/windows_acls/bug44859_4.phpt +++ b/ext/standard/tests/file/windows_acls/bug44859_4.phpt @@ -14,42 +14,42 @@ include_once __DIR__ . '/common.inc'; fix_acls(); $iteration = array( - PHPT_ACL_READ => true, - PHPT_ACL_NONE => false, - PHPT_ACL_WRITE => false, - PHPT_ACL_WRITE|PHPT_ACL_READ => true, + PHPT_ACL_READ => true, + PHPT_ACL_NONE => false, + PHPT_ACL_WRITE => false, + PHPT_ACL_WRITE|PHPT_ACL_READ => true, ); echo "Testing file with relative path:\n"; $i = 1; $path = './' . $uniqueBaseName . '_file.txt'; foreach ($iteration as $perms => $exp) { - create_file($path, $perms); - clearstatcache(true, $path); - echo 'Iteration #' . $i++ . ': '; - if (is_readable($path) == $exp) { - echo "passed.\n"; - } else { - var_dump(is_readable($path), $exp); - echo "failed.\n"; - } - delete_file($path); + create_file($path, $perms); + clearstatcache(true, $path); + echo 'Iteration #' . $i++ . ': '; + if (is_readable($path) == $exp) { + echo "passed.\n"; + } else { + var_dump(is_readable($path), $exp); + echo "failed.\n"; + } + delete_file($path); } echo "Testing directory with relative path:\n"; $path = $uniqueBaseName . '_dir'; $i = 1; foreach ($iteration as $perms => $exp) { - create_dir($path, $perms); - clearstatcache(true, $path); - echo 'Iteration #' . $i++ . ': '; - if (is_readable($path) == $exp) { - echo "passed.\n"; - } else { - var_dump(is_readable($path), $exp); - echo "failed.\n"; - } - delete_dir($path); + create_dir($path, $perms); + clearstatcache(true, $path); + echo 'Iteration #' . $i++ . ': '; + if (is_readable($path) == $exp) { + echo "passed.\n"; + } else { + var_dump(is_readable($path), $exp); + echo "failed.\n"; + } + delete_dir($path); } ?> diff --git a/ext/standard/tests/file/windows_acls/common.inc b/ext/standard/tests/file/windows_acls/common.inc index 5d4b402840..b3490ebb43 100644 --- a/ext/standard/tests/file/windows_acls/common.inc +++ b/ext/standard/tests/file/windows_acls/common.inc @@ -10,161 +10,161 @@ define('PHPT_ACL_GRANT', 1); define('PHPT_ACL_DENY', 2); function skipif() { - if(substr(PHP_OS, 0, 3) != 'WIN' ) { - die('skip windows only test'); - } - if(stripos(php_uname(), 'XP') !== FALSE) { - die('skip windows 2003 or newer only test'); - } + if(substr(PHP_OS, 0, 3) != 'WIN' ) { + die('skip windows only test'); + } + if(stripos(php_uname(), 'XP') !== FALSE) { + die('skip windows 2003 or newer only test'); + } } function get_username(){ - $user = getenv('USERNAME'); + $user = getenv('USERNAME'); - if (!$user) { - $user = get_current_user(); - } + if (!$user) { + $user = get_current_user(); + } - if (!$user) { - $user = exec('echo %USERNAME%'); - } + if (!$user) { + $user = exec('echo %USERNAME%'); + } - return $user; + return $user; } function get_domainname() { - $domain = getenv('USERDOMAIN'); + $domain = getenv('USERDOMAIN'); - return $domain; + return $domain; } function get_icacls() { - $sysroot = exec('echo %SYSTEMROOT%'); + $sysroot = exec('echo %SYSTEMROOT%'); - return "$sysroot\\System32\\icacls.exe"; + return "$sysroot\\System32\\icacls.exe"; } function fix_acls() { - $user = get_username(); - /* Current user needs to be owner of the test files. As well - all the other users having acls on the files must loose them. - The following fixes this just partially, as dynamically reading - all the users having acls on a file could be sophisticated. */ - exec(get_icacls() . ' ' . __DIR__ . ' /setowner ' . escapeshellarg($user) . ' /T /L /Q /C > nul 2>&1'); - exec(get_icacls() . ' ' . __DIR__ . ' /remove:g Administrators /T /L /Q /C > nul 2>&1'); + $user = get_username(); + /* Current user needs to be owner of the test files. As well + all the other users having acls on the files must loose them. + The following fixes this just partially, as dynamically reading + all the users having acls on a file could be sophisticated. */ + exec(get_icacls() . ' ' . __DIR__ . ' /setowner ' . escapeshellarg($user) . ' /T /L /Q /C > nul 2>&1'); + exec(get_icacls() . ' ' . __DIR__ . ' /remove:g Administrators /T /L /Q /C > nul 2>&1'); } function icacls_set($path, $mode, $perm) { - $icacls = get_icacls(); - $user = get_username(); - $path_escaped = '"' . $path . '"'; - $perm_entry = array(); - - if ($perm & PHPT_ACL_READ) $perm_entry[] = 'R'; - if ($perm & PHPT_ACL_WRITE) $perm_entry[] = 'W'; - if ($perm & PHPT_ACL_EXEC) $perm_entry[] = 'RX'; - if ($perm & PHPT_ACL_FULL) $perm_entry[] = 'F'; - - // Deny all - $cmd = $icacls . ' ' . $path_escaped . ' /inheritance:r /deny ' . $user . ':(F,M,R,RX,W)'; - exec($cmd); - - if ($perm & PHPT_ACL_NONE) { - /* - This is required to remove all the previously denied - permission for the USER. Just granting permission doesn't - remove the previously denied permission. - */ - $cmd = $icacls . ' ' . $path_escaped . ' /remove:d ' . $user; - exec($cmd); - $cmd = $icacls . ' ' . $path_escaped . ' /remove:g ' . $user; - exec($cmd); - return; - } - - if ($mode == PHPT_ACL_GRANT) { - $mode = 'grant'; - } else { - $mode = 'deny'; - } - - - // Deny all - $cmd = $icacls . ' ' . $path_escaped . ' /deny ' . $user . ':(F,M,R,RX,W)'; - exec($cmd); - - /* - This is required to remove all the previously denied - permission for the USER. Just granting permission doesn't - remove the previously denied permission. - */ - $cmd = $icacls . ' ' . $path_escaped . ' /remove:d ' . $user; - exec($cmd); - $cmd = $icacls . ' ' . $path_escaped . ' /remove:g ' . $user; - exec($cmd); - - - /* - Required to set no permission and check that is_readable() - returns false. If the $perm_entry contains 'N' skip this step. - This will make the file/dir with NO aceess. - */ - if (!in_array('N', $perm_entry)) { - /* - This is required to remove all the previously denied - permission for the USER. Just granting permission doesn't - remove the previously denied permission. - */ - $cmd = $icacls . ' ' . $path_escaped . ' /remove:d ' . $user; - exec($cmd); - $cmd = $icacls . ' ' . $path_escaped . ' /remove:g ' . $user; - exec($cmd); - - $cmd = $icacls . ' ' . $path_escaped . ' /' . $mode . ' ' . $user; - $cmd .= ':' . '(' . implode(',', $perm_entry) . ')'; - exec($cmd); - } + $icacls = get_icacls(); + $user = get_username(); + $path_escaped = '"' . $path . '"'; + $perm_entry = array(); + + if ($perm & PHPT_ACL_READ) $perm_entry[] = 'R'; + if ($perm & PHPT_ACL_WRITE) $perm_entry[] = 'W'; + if ($perm & PHPT_ACL_EXEC) $perm_entry[] = 'RX'; + if ($perm & PHPT_ACL_FULL) $perm_entry[] = 'F'; + + // Deny all + $cmd = $icacls . ' ' . $path_escaped . ' /inheritance:r /deny ' . $user . ':(F,M,R,RX,W)'; + exec($cmd); + + if ($perm & PHPT_ACL_NONE) { + /* + This is required to remove all the previously denied + permission for the USER. Just granting permission doesn't + remove the previously denied permission. + */ + $cmd = $icacls . ' ' . $path_escaped . ' /remove:d ' . $user; + exec($cmd); + $cmd = $icacls . ' ' . $path_escaped . ' /remove:g ' . $user; + exec($cmd); + return; + } + + if ($mode == PHPT_ACL_GRANT) { + $mode = 'grant'; + } else { + $mode = 'deny'; + } + + + // Deny all + $cmd = $icacls . ' ' . $path_escaped . ' /deny ' . $user . ':(F,M,R,RX,W)'; + exec($cmd); + + /* + This is required to remove all the previously denied + permission for the USER. Just granting permission doesn't + remove the previously denied permission. + */ + $cmd = $icacls . ' ' . $path_escaped . ' /remove:d ' . $user; + exec($cmd); + $cmd = $icacls . ' ' . $path_escaped . ' /remove:g ' . $user; + exec($cmd); + + + /* + Required to set no permission and check that is_readable() + returns false. If the $perm_entry contains 'N' skip this step. + This will make the file/dir with NO aceess. + */ + if (!in_array('N', $perm_entry)) { + /* + This is required to remove all the previously denied + permission for the USER. Just granting permission doesn't + remove the previously denied permission. + */ + $cmd = $icacls . ' ' . $path_escaped . ' /remove:d ' . $user; + exec($cmd); + $cmd = $icacls . ' ' . $path_escaped . ' /remove:g ' . $user; + exec($cmd); + + $cmd = $icacls . ' ' . $path_escaped . ' /' . $mode . ' ' . $user; + $cmd .= ':' . '(' . implode(',', $perm_entry) . ')'; + exec($cmd); + } } function create_dir($name, $perms) { - if (empty($name)) { - echo "create_dir: Empty name is not allowed\n"; - return; - } - - mkdir($name); - $dst = realpath($name); - icacls_set($name, PHPT_ACL_GRANT, $perms); + if (empty($name)) { + echo "create_dir: Empty name is not allowed\n"; + return; + } + + mkdir($name); + $dst = realpath($name); + icacls_set($name, PHPT_ACL_GRANT, $perms); } function create_file($name, $perms) { - if (empty($name)) { - echo "create_file: Empty name is not allowed\n"; - return; - } + if (empty($name)) { + echo "create_file: Empty name is not allowed\n"; + return; + } - touch($name); - icacls_set($name, PHPT_ACL_GRANT, $perms); + touch($name); + icacls_set($name, PHPT_ACL_GRANT, $perms); } function delete_file($path) { - icacls_set($path, PHPT_ACL_GRANT, PHPT_ACL_FULL); - if (is_file($path)) { - unlink($path); - } else { - echo "delete_file: '$path' is not a file\n"; - return; - } + icacls_set($path, PHPT_ACL_GRANT, PHPT_ACL_FULL); + if (is_file($path)) { + unlink($path); + } else { + echo "delete_file: '$path' is not a file\n"; + return; + } } function delete_dir($path) { - if (is_dir($path)) { - icacls_set($path, PHPT_ACL_GRANT, PHPT_ACL_FULL); - rmdir($path); - } else { - echo "delete_dir: '$path' is not a directory\n"; - return; - } + if (is_dir($path)) { + icacls_set($path, PHPT_ACL_GRANT, PHPT_ACL_FULL); + rmdir($path); + } else { + echo "delete_dir: '$path' is not a directory\n"; + return; + } } diff --git a/ext/standard/tests/file/windows_links/common.inc b/ext/standard/tests/file/windows_links/common.inc index 505368b8b0..4d4409e9d8 100644 --- a/ext/standard/tests/file/windows_links/common.inc +++ b/ext/standard/tests/file/windows_links/common.inc @@ -1,23 +1,23 @@ <?php function get_sysroot() { - // usually c:\\windows, but not always - return exec('echo %SYSTEMROOT%'); + // usually c:\\windows, but not always + return exec('echo %SYSTEMROOT%'); } function get_junction(){ - // junction.exe isn't included with Windows - // its a sysinternals tool for working with filesystem links - // see: http://technet.microsoft.com/en-us/sysinternals/bb896768 + // junction.exe isn't included with Windows + // its a sysinternals tool for working with filesystem links + // see: http://technet.microsoft.com/en-us/sysinternals/bb896768 - // install somewhere that is on %path% or added to %path% - return "junction.exe"; + // install somewhere that is on %path% or added to %path% + return "junction.exe"; } function get_mountvol() { - $sysroot = get_sysroot(); + $sysroot = get_sysroot(); - return "$sysroot\\System32\\mountvol.exe"; + return "$sysroot\\System32\\mountvol.exe"; } ?> diff --git a/ext/standard/tests/file/windows_links/readlink_compat.phpt b/ext/standard/tests/file/windows_links/readlink_compat.phpt index e119473895..b4ac07682e 100644 --- a/ext/standard/tests/file/windows_links/readlink_compat.phpt +++ b/ext/standard/tests/file/windows_links/readlink_compat.phpt @@ -20,7 +20,7 @@ mkdir($tmpDir); // mounted volume $volume = trim(exec('mountvol C: /L')); exec(sprintf('mountvol "%s" %s', $tmpDir, $volume)); -var_dump(readlink($tmpDir)); +var_dump(readlink($tmpDir)); exec(sprintf('mountvol "%s" /D', $tmpDir)); mkdir($tmpDir . '\\test\\directory', 0777, true); @@ -35,7 +35,7 @@ rmdir($link); // junction to a directory $link = $tmpDir . '\\test\\directory_junction'; $target = $tmpDir . '\\test\\directory'; -exec(sprintf('mklink /J "%s" "%s"', $link, $target)); +exec(sprintf('mklink /J "%s" "%s"', $link, $target)); var_dump(readlink($link)); rmdir($link); @@ -56,7 +56,7 @@ fclose($fh); // symlink to a file (absolute and relative) $link = $tmpDir . '\\test\\file_symlink'; -exec(sprintf('mklink "%s" "%s"', $link, $filename)); +exec(sprintf('mklink "%s" "%s"', $link, $filename)); var_dump(readlink($link)); unlink($link); exec(sprintf('mklink "%s" directory\\a.php', $link)); @@ -64,7 +64,7 @@ var_dump(readlink($link)); unlink($link); // unexpected behaviour -echo "\n*** Unexpected behaviour when not a reparse point\n"; +echo "\n*** Unexpected behaviour when not a reparse point\n"; var_dump(readlink($tmpDir . '\\test\\directory')); var_dump(readlink($filename)); diff --git a/ext/standard/tests/file/windows_mb_path/bug54028.phpt b/ext/standard/tests/file/windows_mb_path/bug54028.phpt index 9c11be61f4..6f3e6dab51 100644 --- a/ext/standard/tests/file/windows_mb_path/bug54028.phpt +++ b/ext/standard/tests/file/windows_mb_path/bug54028.phpt @@ -22,23 +22,23 @@ $dirs = array("a", "ソ", "ゾ", "şŞıİğĞ", "多国語", "王", "汚れã¦æ mkdir($prefix); foreach ($dirs as $d) { - mkdir($prefix . $d); + mkdir($prefix . $d); } $directory = dir($prefix); while (false !== ($content = $directory->read())) { - if ("." == $content || ".." == $content) continue; + if ("." == $content || ".." == $content) continue; printf("Returned (%s)\n", $content); printf("Encoding: %s\n", mb_detect_encoding($content)); if ($content != get_basename_with_cp($prefix . $content, 65001, false)) { - echo "Verification failed!\n"; - } - echo "\n"; + echo "Verification failed!\n"; + } + echo "\n"; } foreach ($dirs as $d) { - rmdir($prefix . $d); + rmdir($prefix . $d); } rmdir($prefix); diff --git a/ext/standard/tests/file/windows_mb_path/bug54028_2.phpt b/ext/standard/tests/file/windows_mb_path/bug54028_2.phpt index 87e7c162b0..d6ef5925a8 100644 --- a/ext/standard/tests/file/windows_mb_path/bug54028_2.phpt +++ b/ext/standard/tests/file/windows_mb_path/bug54028_2.phpt @@ -22,20 +22,20 @@ $dirs = array("a", "ソ", "ゾ", "şŞıİğĞ", "多国語", "王", "汚れã¦æ mkdir($prefix); foreach ($dirs as $d) { - mkdir($prefix . $d); + mkdir($prefix . $d); } $old_cwd = getcwd(); foreach ($dirs as $d) { - $now = $prefix . $d; - var_dump(chdir($now)); - var_dump($dn = realpath(".")); - var_dump($d == get_basename_with_cp($dn, 65001, false)); + $now = $prefix . $d; + var_dump(chdir($now)); + var_dump($dn = realpath(".")); + var_dump($d == get_basename_with_cp($dn, 65001, false)); } chdir($old_cwd); foreach ($dirs as $d) { - rmdir($prefix . $d); + rmdir($prefix . $d); } rmdir($prefix); diff --git a/ext/standard/tests/file/windows_mb_path/bug54977.phpt b/ext/standard/tests/file/windows_mb_path/bug54977.phpt index b8749576ae..5edead63ed 100644 --- a/ext/standard/tests/file/windows_mb_path/bug54977.phpt +++ b/ext/standard/tests/file/windows_mb_path/bug54977.phpt @@ -22,19 +22,19 @@ $paths = array("多国語", "王", "汚れã¦æŽ˜ã‚‹"); mkdir($prefix); foreach ($paths as $d) { - mkdir($prefix . $d); - file_put_contents($prefix . $d . ".test", $d); + mkdir($prefix . $d); + file_put_contents($prefix . $d . ".test", $d); } $myDirectory = opendir($prefix); while($entryName = readdir($myDirectory)) { - echo get_basename_with_cp($prefix . $entryName, 65001, false) . "\n"; + echo get_basename_with_cp($prefix . $entryName, 65001, false) . "\n"; } closedir($myDirectory); foreach ($paths as $d) { - rmdir($prefix . $d); - unlink($prefix . $d . ".test"); + rmdir($prefix . $d); + unlink($prefix . $d . ".test"); } rmdir($prefix); diff --git a/ext/standard/tests/file/windows_mb_path/bug64506.phpt b/ext/standard/tests/file/windows_mb_path/bug64506.phpt index fa9653fbd2..0bcf0d778c 100644 --- a/ext/standard/tests/file/windows_mb_path/bug64506.phpt +++ b/ext/standard/tests/file/windows_mb_path/bug64506.phpt @@ -22,9 +22,9 @@ $fnw = __DIR__ . DIRECTORY_SEPARATOR . "Å¡.txt"; // UTF-8 $f = fopen($fnw, 'w'); if ($f) { - var_dump($f, fwrite($f, "writing to an mb filename")); + var_dump($f, fwrite($f, "writing to an mb filename")); } else { - echo "open utf8 failed\n"; + echo "open utf8 failed\n"; } var_dump(fclose($f)); diff --git a/ext/standard/tests/file/windows_mb_path/bug64699.phpt b/ext/standard/tests/file/windows_mb_path/bug64699.phpt index 8b6859176f..20d4182b71 100644 --- a/ext/standard/tests/file/windows_mb_path/bug64699.phpt +++ b/ext/standard/tests/file/windows_mb_path/bug64699.phpt @@ -25,7 +25,7 @@ $dirs = array("a", "ソ", "ゾ", "şŞıİğĞ", "多国語", "表"); mkdir($prefix); foreach ($dirs as $d) { - mkdir($prefix . $d); + mkdir($prefix . $d); } $dir = $prefix; @@ -41,7 +41,7 @@ if ($dh = opendir($dir)) { } foreach ($dirs as $d) { - rmdir($prefix . $d); + rmdir($prefix . $d); } rmdir($prefix); diff --git a/ext/standard/tests/file/windows_mb_path/bug74923.phpt b/ext/standard/tests/file/windows_mb_path/bug74923.phpt index 544a7110ee..9cffd5860f 100644 --- a/ext/standard/tests/file/windows_mb_path/bug74923.phpt +++ b/ext/standard/tests/file/windows_mb_path/bug74923.phpt @@ -12,7 +12,7 @@ if (getenv("SKIP_SLOW_TESTS")) die("skip slow test"); <?php /* No way to affect timeout here. On different systems this might take some - dozens of seconds to complete. */ + dozens of seconds to complete. */ $s = '\\\\hello.com' . str_repeat('\\', 260); diff --git a/ext/standard/tests/file/windows_mb_path/bug75063_cp1251.phpt b/ext/standard/tests/file/windows_mb_path/bug75063_cp1251.phpt index c841aff194..32cb2adead 100644 --- a/ext/standard/tests/file/windows_mb_path/bug75063_cp1251.phpt +++ b/ext/standard/tests/file/windows_mb_path/bug75063_cp1251.phpt @@ -34,16 +34,16 @@ $code = <<<CODE <?php foreach(["test", "òàñò"] as \$fn) { - file_put_contents("\$fn.txt", ""); + file_put_contents("\$fn.txt", ""); } var_dump(getcwd()); if (\$dh = opendir(getcwd())) { - while ((\$file = readdir(\$dh)) !== false) { - if ("." == \$file || ".." == \$file) continue; - var_dump(\$file); - } - closedir(\$dh); + while ((\$file = readdir(\$dh)) !== false) { + if ("." == \$file || ".." == \$file) continue; + var_dump(\$file); + } + closedir(\$dh); } CODE; $code_fn = "code.php"; @@ -53,7 +53,7 @@ print(shell_exec(getenv('TEST_PHP_EXECUTABLE') . " -n -d default_charset=cp1251 chdir($old_cwd); -/* --CLEAN-- section were the right place, but it won't accept default_charset ATM, it seems. */ +/*--CLEAN-- section were the right place, but it won't accept default_charset ATM, it seems. */ $dir_basename = "òåñò"; $prefix = __DIR__ . DIRECTORY_SEPARATOR . "bug75063-cp1251"; $d0 = $prefix . DIRECTORY_SEPARATOR . $dir_basename; diff --git a/ext/standard/tests/file/windows_mb_path/bug75063_utf8.phpt b/ext/standard/tests/file/windows_mb_path/bug75063_utf8.phpt index 49a5229cf6..b8235c8842 100644 --- a/ext/standard/tests/file/windows_mb_path/bug75063_utf8.phpt +++ b/ext/standard/tests/file/windows_mb_path/bug75063_utf8.phpt @@ -32,16 +32,16 @@ $code = <<<CODE <?php foreach(["test", "таÑÑ‚"] as \$fn) { - file_put_contents("\$fn.txt", ""); + file_put_contents("\$fn.txt", ""); } var_dump(getcwd()); if (\$dh = opendir(getcwd())) { - while ((\$file = readdir(\$dh)) !== false) { - if ("." == \$file || ".." == \$file) continue; - var_dump(\$file); - } - closedir(\$dh); + while ((\$file = readdir(\$dh)) !== false) { + if ("." == \$file || ".." == \$file) continue; + var_dump(\$file); + } + closedir(\$dh); } CODE; $code_fn = "code.php"; diff --git a/ext/standard/tests/file/windows_mb_path/recursive_it.phpt b/ext/standard/tests/file/windows_mb_path/recursive_it.phpt index 538aa0ad21..fb97086b2b 100644 --- a/ext/standard/tests/file/windows_mb_path/recursive_it.phpt +++ b/ext/standard/tests/file/windows_mb_path/recursive_it.phpt @@ -15,7 +15,7 @@ $need_len = 1024; //$need_len = 259; $dir = __DIR__; while ($need_len - strlen($dir) > 32) { - $dir .= DIRECTORY_SEPARATOR . str_repeat("a", 32); + $dir .= DIRECTORY_SEPARATOR . str_repeat("a", 32); } $dir .= DIRECTORY_SEPARATOR . str_repeat("a", $need_len - strlen($dir)); mkdir($dir, 0700, true); @@ -26,34 +26,34 @@ file_put_contents($fl, ""); $start = substr($dir, 0, strpos($dir, DIRECTORY_SEPARATOR, strlen(__DIR__)+1)); $iter = new RecursiveIteratorIterator( - new RecursiveDirectoryIterator( - $start, - FilesystemIterator::SKIP_DOTS - ), - RecursiveIteratorIterator::CHILD_FIRST + new RecursiveDirectoryIterator( + $start, + FilesystemIterator::SKIP_DOTS + ), + RecursiveIteratorIterator::CHILD_FIRST ); foreach ($iter as $item) { - if (!$item->isDir()) { - var_dump($item->getPathname()); - } + if (!$item->isDir()) { + var_dump($item->getPathname()); + } } $iter->rewind(); foreach ($iter as $item) { - if ($item->isDir()) { - rmdir($item->getPathname()); - } else { - unlink($item->getPathname()); - } + if ($item->isDir()) { + rmdir($item->getPathname()); + } else { + unlink($item->getPathname()); + } } rmdir($start); var_dump(file_exists($start)); /*unlink($fl); do { - rmdir($dir); - $dir = dirname($dir); + rmdir($dir); + $dir = dirname($dir); } while (__DIR__ != $dir);*/ ?> diff --git a/ext/standard/tests/file/windows_mb_path/test_big5_0.phpt b/ext/standard/tests/file/windows_mb_path/test_big5_0.phpt index 39a6d30c77..41fd2e7552 100644 --- a/ext/standard/tests/file/windows_mb_path/test_big5_0.phpt +++ b/ext/standard/tests/file/windows_mb_path/test_big5_0.phpt @@ -27,10 +27,10 @@ $fn = $prefix . DIRECTORY_SEPARATOR . "$item"; $f = fopen($fn, 'r'); if ($f) { - var_dump($f, fread($f, 42)); - var_dump(fclose($f)); + var_dump($f, fread($f, 42)); + var_dump(fclose($f)); } else { - echo "open utf8 failed\n"; + echo "open utf8 failed\n"; } remove_data("file_big5"); diff --git a/ext/standard/tests/file/windows_mb_path/test_big5_2.phpt b/ext/standard/tests/file/windows_mb_path/test_big5_2.phpt index 5cc2c736ec..5460ae9dfa 100644 --- a/ext/standard/tests/file/windows_mb_path/test_big5_2.phpt +++ b/ext/standard/tests/file/windows_mb_path/test_big5_2.phpt @@ -27,10 +27,10 @@ $fn = $prefix . DIRECTORY_SEPARATOR . "{$item}25"; $f = fopen($fn, 'w'); if ($f) { - var_dump($f, fwrite($f, "writing to an mb filename")); - var_dump(fclose($f)); + var_dump($f, fwrite($f, "writing to an mb filename")); + var_dump(fclose($f)); } else { - echo "open utf8 failed\n"; + echo "open utf8 failed\n"; } var_dump(file_get_contents($fn)); diff --git a/ext/standard/tests/file/windows_mb_path/test_big5_to_utf8_0.phpt b/ext/standard/tests/file/windows_mb_path/test_big5_to_utf8_0.phpt index 4a6dd19864..0dcc09dae9 100644 --- a/ext/standard/tests/file/windows_mb_path/test_big5_to_utf8_0.phpt +++ b/ext/standard/tests/file/windows_mb_path/test_big5_to_utf8_0.phpt @@ -24,10 +24,10 @@ $fn = $prefix . DIRECTORY_SEPARATOR . "$item"; $f = fopen($fn, 'r'); if ($f) { - var_dump($f, fread($f, 42)); - var_dump(fclose($f)); + var_dump($f, fread($f, 42)); + var_dump(fclose($f)); } else { - echo "open utf8 failed\n"; + echo "open utf8 failed\n"; } remove_data("file_big5"); diff --git a/ext/standard/tests/file/windows_mb_path/test_big5_to_utf8_2.phpt b/ext/standard/tests/file/windows_mb_path/test_big5_to_utf8_2.phpt index e9294ababd..6269aaf050 100644 --- a/ext/standard/tests/file/windows_mb_path/test_big5_to_utf8_2.phpt +++ b/ext/standard/tests/file/windows_mb_path/test_big5_to_utf8_2.phpt @@ -24,10 +24,10 @@ $fn = $prefix . DIRECTORY_SEPARATOR . "{$item}25"; $f = fopen($fn, 'w'); if ($f) { - var_dump($f, fwrite($f, "writing to an mb filename")); - var_dump(fclose($f)); + var_dump($f, fwrite($f, "writing to an mb filename")); + var_dump(fclose($f)); } else { - echo "open utf8 failed\n"; + echo "open utf8 failed\n"; } var_dump(file_get_contents($fn)); diff --git a/ext/standard/tests/file/windows_mb_path/test_cp1250_to_utf8_0.phpt b/ext/standard/tests/file/windows_mb_path/test_cp1250_to_utf8_0.phpt index 6de73c02a8..10db18c19b 100644 --- a/ext/standard/tests/file/windows_mb_path/test_cp1250_to_utf8_0.phpt +++ b/ext/standard/tests/file/windows_mb_path/test_cp1250_to_utf8_0.phpt @@ -24,10 +24,10 @@ $fn = $prefix . DIRECTORY_SEPARATOR . $item; $f = fopen($fn, 'r'); if ($f) { - var_dump($f, fread($f, 42)); - var_dump(fclose($f)); + var_dump($f, fread($f, 42)); + var_dump(fclose($f)); } else { - echo "open utf8 failed\n"; + echo "open utf8 failed\n"; } remove_data("file_cp1250"); diff --git a/ext/standard/tests/file/windows_mb_path/test_cp1250_to_utf8_2.phpt b/ext/standard/tests/file/windows_mb_path/test_cp1250_to_utf8_2.phpt index 82255919ab..571daff094 100644 --- a/ext/standard/tests/file/windows_mb_path/test_cp1250_to_utf8_2.phpt +++ b/ext/standard/tests/file/windows_mb_path/test_cp1250_to_utf8_2.phpt @@ -24,10 +24,10 @@ $fn = $prefix . DIRECTORY_SEPARATOR . "${item}33"; $f = fopen($fn, 'w'); if ($f) { - var_dump($f, fwrite($f, "writing to an mb filename")); - var_dump(fclose($f)); + var_dump($f, fwrite($f, "writing to an mb filename")); + var_dump(fclose($f)); } else { - echo "open utf8 failed\n"; + echo "open utf8 failed\n"; } var_dump(file_get_contents($fn)); diff --git a/ext/standard/tests/file/windows_mb_path/test_cp1250_to_utf8_3.phpt b/ext/standard/tests/file/windows_mb_path/test_cp1250_to_utf8_3.phpt index d359158564..568f56361b 100644 --- a/ext/standard/tests/file/windows_mb_path/test_cp1250_to_utf8_3.phpt +++ b/ext/standard/tests/file/windows_mb_path/test_cp1250_to_utf8_3.phpt @@ -24,10 +24,10 @@ $fn = $prefix . DIRECTORY_SEPARATOR . $item; $f = fopen($fn, 'r'); if ($f) { - var_dump($f, fread($f, 42)); - var_dump(fclose($f)); + var_dump($f, fread($f, 42)); + var_dump(fclose($f)); } else { - echo "open utf8 failed\n"; + echo "open utf8 failed\n"; } remove_data("file_cp1250"); diff --git a/ext/standard/tests/file/windows_mb_path/test_cp1250_to_utf8_5.phpt b/ext/standard/tests/file/windows_mb_path/test_cp1250_to_utf8_5.phpt index d5230c3782..ef9e17b7f2 100644 --- a/ext/standard/tests/file/windows_mb_path/test_cp1250_to_utf8_5.phpt +++ b/ext/standard/tests/file/windows_mb_path/test_cp1250_to_utf8_5.phpt @@ -24,10 +24,10 @@ $fn = $prefix . DIRECTORY_SEPARATOR . "${item}33"; $f = fopen($fn, 'w'); if ($f) { - var_dump($f, fwrite($f, "writing to an mb filename")); - var_dump(fclose($f)); + var_dump($f, fwrite($f, "writing to an mb filename")); + var_dump(fclose($f)); } else { - echo "open utf8 failed\n"; + echo "open utf8 failed\n"; } var_dump(file_get_contents($fn)); diff --git a/ext/standard/tests/file/windows_mb_path/test_cp1251_0.phpt b/ext/standard/tests/file/windows_mb_path/test_cp1251_0.phpt index aeedc2c875..d1c4f0f4fc 100644 --- a/ext/standard/tests/file/windows_mb_path/test_cp1251_0.phpt +++ b/ext/standard/tests/file/windows_mb_path/test_cp1251_0.phpt @@ -27,10 +27,10 @@ $fn = $prefix . DIRECTORY_SEPARATOR . $item; $f = fopen($fn, 'r'); if ($f) { - var_dump($f, fread($f, 42)); - var_dump(fclose($f)); + var_dump($f, fread($f, 42)); + var_dump(fclose($f)); } else { - echo "open utf8 failed\n"; + echo "open utf8 failed\n"; } remove_data("file_cp1251"); diff --git a/ext/standard/tests/file/windows_mb_path/test_cp1251_2.phpt b/ext/standard/tests/file/windows_mb_path/test_cp1251_2.phpt index 06bc8d2d87..1161747564 100644 --- a/ext/standard/tests/file/windows_mb_path/test_cp1251_2.phpt +++ b/ext/standard/tests/file/windows_mb_path/test_cp1251_2.phpt @@ -27,10 +27,10 @@ $fn = $prefix . DIRECTORY_SEPARATOR . "${item}7"; $f = fopen($fn, 'w'); if ($f) { - var_dump($f, fwrite($f, "writing to an mb filename")); - var_dump(fclose($f)); + var_dump($f, fwrite($f, "writing to an mb filename")); + var_dump(fclose($f)); } else { - echo "open utf8 failed\n"; + echo "open utf8 failed\n"; } var_dump(file_get_contents($fn)); diff --git a/ext/standard/tests/file/windows_mb_path/test_cp1251_to_utf8_0.phpt b/ext/standard/tests/file/windows_mb_path/test_cp1251_to_utf8_0.phpt index dc870e829d..b780065d90 100644 --- a/ext/standard/tests/file/windows_mb_path/test_cp1251_to_utf8_0.phpt +++ b/ext/standard/tests/file/windows_mb_path/test_cp1251_to_utf8_0.phpt @@ -24,10 +24,10 @@ $fn = $prefix . DIRECTORY_SEPARATOR . $item; $f = fopen($fn, 'r'); if ($f) { - var_dump($f, fread($f, 42)); - var_dump(fclose($f)); + var_dump($f, fread($f, 42)); + var_dump(fclose($f)); } else { - echo "open utf8 failed\n"; + echo "open utf8 failed\n"; } remove_data("file_cp1251"); diff --git a/ext/standard/tests/file/windows_mb_path/test_cp1251_to_utf8_2.phpt b/ext/standard/tests/file/windows_mb_path/test_cp1251_to_utf8_2.phpt index b5192dcf84..251fa2c000 100644 --- a/ext/standard/tests/file/windows_mb_path/test_cp1251_to_utf8_2.phpt +++ b/ext/standard/tests/file/windows_mb_path/test_cp1251_to_utf8_2.phpt @@ -24,10 +24,10 @@ $fn = $prefix . DIRECTORY_SEPARATOR . "${item}7"; $f = fopen($fn, 'w'); if ($f) { - var_dump($f, fwrite($f, "writing to an mb filename")); - var_dump(fclose($f)); + var_dump($f, fwrite($f, "writing to an mb filename")); + var_dump(fclose($f)); } else { - echo "open utf8 failed\n"; + echo "open utf8 failed\n"; } var_dump(file_get_contents($fn)); diff --git a/ext/standard/tests/file/windows_mb_path/test_cp1251_zend_multibyte_0.phpt b/ext/standard/tests/file/windows_mb_path/test_cp1251_zend_multibyte_0.phpt index 9694e54ffd..2f28a922e3 100644 --- a/ext/standard/tests/file/windows_mb_path/test_cp1251_zend_multibyte_0.phpt +++ b/ext/standard/tests/file/windows_mb_path/test_cp1251_zend_multibyte_0.phpt @@ -27,10 +27,10 @@ $fn = $prefix . DIRECTORY_SEPARATOR . $item; $f = fopen($fn, 'r'); if ($f) { - var_dump($f, fread($f, 42)); - var_dump(fclose($f)); + var_dump($f, fread($f, 42)); + var_dump(fclose($f)); } else { - echo "open failed\n"; + echo "open failed\n"; } remove_data("file_cp1251"); diff --git a/ext/standard/tests/file/windows_mb_path/test_cp1251_zend_multibyte_2.phpt b/ext/standard/tests/file/windows_mb_path/test_cp1251_zend_multibyte_2.phpt index 3788ef2411..d6ff64e4e5 100644 --- a/ext/standard/tests/file/windows_mb_path/test_cp1251_zend_multibyte_2.phpt +++ b/ext/standard/tests/file/windows_mb_path/test_cp1251_zend_multibyte_2.phpt @@ -27,10 +27,10 @@ $fn = $prefix . DIRECTORY_SEPARATOR . $item; $f = fopen($fn, 'w'); if ($f) { - var_dump($f, fwrite($f, "writing to an mb filename")); - var_dump(fclose($f)); + var_dump($f, fwrite($f, "writing to an mb filename")); + var_dump(fclose($f)); } else { - echo "open failed\n"; + echo "open failed\n"; } var_dump(file_get_contents($fn)); diff --git a/ext/standard/tests/file/windows_mb_path/test_cp1252_to_utf8_0.phpt b/ext/standard/tests/file/windows_mb_path/test_cp1252_to_utf8_0.phpt index 8a601bf666..e85636d989 100644 --- a/ext/standard/tests/file/windows_mb_path/test_cp1252_to_utf8_0.phpt +++ b/ext/standard/tests/file/windows_mb_path/test_cp1252_to_utf8_0.phpt @@ -24,10 +24,10 @@ $fn = $prefix . DIRECTORY_SEPARATOR . $item; $f = fopen($fn, 'r'); if ($f) { - var_dump($f, fread($f, 42)); - var_dump(fclose($f)); + var_dump($f, fread($f, 42)); + var_dump(fclose($f)); } else { - echo "open utf8 failed\n"; + echo "open utf8 failed\n"; } remove_data("file_cp1252"); diff --git a/ext/standard/tests/file/windows_mb_path/test_cp1252_to_utf8_2.phpt b/ext/standard/tests/file/windows_mb_path/test_cp1252_to_utf8_2.phpt index dc042a0475..0709d1270c 100644 --- a/ext/standard/tests/file/windows_mb_path/test_cp1252_to_utf8_2.phpt +++ b/ext/standard/tests/file/windows_mb_path/test_cp1252_to_utf8_2.phpt @@ -24,10 +24,10 @@ $fn = $prefix . DIRECTORY_SEPARATOR . "${item}7"; $f = fopen($fn, 'w'); if ($f) { - var_dump($f, fwrite($f, "writing to an mb filename")); - var_dump(fclose($f)); + var_dump($f, fwrite($f, "writing to an mb filename")); + var_dump(fclose($f)); } else { - echo "open utf8 failed\n"; + echo "open utf8 failed\n"; } var_dump(file_get_contents($fn)); diff --git a/ext/standard/tests/file/windows_mb_path/test_cp1252_to_utf8_3.phpt b/ext/standard/tests/file/windows_mb_path/test_cp1252_to_utf8_3.phpt index 264558a657..3abbc58205 100644 --- a/ext/standard/tests/file/windows_mb_path/test_cp1252_to_utf8_3.phpt +++ b/ext/standard/tests/file/windows_mb_path/test_cp1252_to_utf8_3.phpt @@ -24,10 +24,10 @@ $fn = $prefix . DIRECTORY_SEPARATOR . $item; $f = fopen($fn, 'r'); if ($f) { - var_dump($f, fread($f, 42)); - var_dump(fclose($f)); + var_dump($f, fread($f, 42)); + var_dump(fclose($f)); } else { - echo "open utf8 failed\n"; + echo "open utf8 failed\n"; } remove_data("file2_cp1252"); diff --git a/ext/standard/tests/file/windows_mb_path/test_cp1252_to_utf8_5.phpt b/ext/standard/tests/file/windows_mb_path/test_cp1252_to_utf8_5.phpt index 1945fc54be..8f45ed24e4 100644 --- a/ext/standard/tests/file/windows_mb_path/test_cp1252_to_utf8_5.phpt +++ b/ext/standard/tests/file/windows_mb_path/test_cp1252_to_utf8_5.phpt @@ -24,10 +24,10 @@ $fn = $prefix . DIRECTORY_SEPARATOR . "${item}7"; $f = fopen($fn, 'w'); if ($f) { - var_dump($f, fwrite($f, "writing to an mb filename")); - var_dump(fclose($f)); + var_dump($f, fwrite($f, "writing to an mb filename")); + var_dump(fclose($f)); } else { - echo "open utf8 failed\n"; + echo "open utf8 failed\n"; } var_dump(file_get_contents($fn)); diff --git a/ext/standard/tests/file/windows_mb_path/test_cp1253_0.phpt b/ext/standard/tests/file/windows_mb_path/test_cp1253_0.phpt index 08ab2aa7bb..8ed2b2d97b 100644 --- a/ext/standard/tests/file/windows_mb_path/test_cp1253_0.phpt +++ b/ext/standard/tests/file/windows_mb_path/test_cp1253_0.phpt @@ -27,10 +27,10 @@ $fn = $prefix . DIRECTORY_SEPARATOR . $item; $f = fopen($fn, 'r'); if ($f) { - var_dump($f, fread($f, 42)); - var_dump(fclose($f)); + var_dump($f, fread($f, 42)); + var_dump(fclose($f)); } else { - echo "open utf8 failed\n"; + echo "open utf8 failed\n"; } remove_data("file_cp1253"); diff --git a/ext/standard/tests/file/windows_mb_path/test_cp1253_2.phpt b/ext/standard/tests/file/windows_mb_path/test_cp1253_2.phpt index c1ea99e32b..88f28fa281 100644 --- a/ext/standard/tests/file/windows_mb_path/test_cp1253_2.phpt +++ b/ext/standard/tests/file/windows_mb_path/test_cp1253_2.phpt @@ -27,10 +27,10 @@ $fn = $prefix . DIRECTORY_SEPARATOR . "${item}33"; $f = fopen($fn, 'w'); if ($f) { - var_dump($f, fwrite($f, "writing to an mb filename")); - var_dump(fclose($f)); + var_dump($f, fwrite($f, "writing to an mb filename")); + var_dump(fclose($f)); } else { - echo "open utf8 failed\n"; + echo "open utf8 failed\n"; } var_dump(file_get_contents($fn)); diff --git a/ext/standard/tests/file/windows_mb_path/test_cp1253_to_utf8_0.phpt b/ext/standard/tests/file/windows_mb_path/test_cp1253_to_utf8_0.phpt index 675bdd12c4..4f0d601d4a 100644 --- a/ext/standard/tests/file/windows_mb_path/test_cp1253_to_utf8_0.phpt +++ b/ext/standard/tests/file/windows_mb_path/test_cp1253_to_utf8_0.phpt @@ -24,10 +24,10 @@ $fn = $prefix . DIRECTORY_SEPARATOR . $item; $f = fopen($fn, 'r'); if ($f) { - var_dump($f, fread($f, 42)); - var_dump(fclose($f)); + var_dump($f, fread($f, 42)); + var_dump(fclose($f)); } else { - echo "open utf8 failed\n"; + echo "open utf8 failed\n"; } remove_data("file_cp1253"); diff --git a/ext/standard/tests/file/windows_mb_path/test_cp1253_to_utf8_2.phpt b/ext/standard/tests/file/windows_mb_path/test_cp1253_to_utf8_2.phpt index 8210704b3f..af329eadcf 100644 --- a/ext/standard/tests/file/windows_mb_path/test_cp1253_to_utf8_2.phpt +++ b/ext/standard/tests/file/windows_mb_path/test_cp1253_to_utf8_2.phpt @@ -24,10 +24,10 @@ $fn = $prefix . DIRECTORY_SEPARATOR . "${item}33"; $f = fopen($fn, 'w'); if ($f) { - var_dump($f, fwrite($f, "writing to an mb filename")); - var_dump(fclose($f)); + var_dump($f, fwrite($f, "writing to an mb filename")); + var_dump(fclose($f)); } else { - echo "open utf8 failed\n"; + echo "open utf8 failed\n"; } var_dump(file_get_contents($fn)); diff --git a/ext/standard/tests/file/windows_mb_path/test_cp1254_0.phpt b/ext/standard/tests/file/windows_mb_path/test_cp1254_0.phpt index 1ceefc759e..d619576ad5 100644 --- a/ext/standard/tests/file/windows_mb_path/test_cp1254_0.phpt +++ b/ext/standard/tests/file/windows_mb_path/test_cp1254_0.phpt @@ -27,10 +27,10 @@ $fn = $prefix . DIRECTORY_SEPARATOR . $item; $f = fopen($fn, 'r'); if ($f) { - var_dump($f, fread($f, 42)); - var_dump(fclose($f)); + var_dump($f, fread($f, 42)); + var_dump(fclose($f)); } else { - echo "open utf8 failed\n"; + echo "open utf8 failed\n"; } remove_data("file_cp1254"); diff --git a/ext/standard/tests/file/windows_mb_path/test_cp1254_2.phpt b/ext/standard/tests/file/windows_mb_path/test_cp1254_2.phpt index 4de9478b32..f6357366e7 100644 --- a/ext/standard/tests/file/windows_mb_path/test_cp1254_2.phpt +++ b/ext/standard/tests/file/windows_mb_path/test_cp1254_2.phpt @@ -27,10 +27,10 @@ $fn = $prefix . DIRECTORY_SEPARATOR . "${item}33"; $f = fopen($fn, 'w'); if ($f) { - var_dump($f, fwrite($f, "writing to an mb filename")); - var_dump(fclose($f)); + var_dump($f, fwrite($f, "writing to an mb filename")); + var_dump(fclose($f)); } else { - echo "open utf8 failed\n"; + echo "open utf8 failed\n"; } var_dump(file_get_contents($fn)); diff --git a/ext/standard/tests/file/windows_mb_path/test_cp1254_to_utf8_0.phpt b/ext/standard/tests/file/windows_mb_path/test_cp1254_to_utf8_0.phpt index 39308b3368..eac345d8be 100644 --- a/ext/standard/tests/file/windows_mb_path/test_cp1254_to_utf8_0.phpt +++ b/ext/standard/tests/file/windows_mb_path/test_cp1254_to_utf8_0.phpt @@ -24,10 +24,10 @@ $fn = $prefix . DIRECTORY_SEPARATOR . $item; $f = fopen($fn, 'r'); if ($f) { - var_dump($f, fread($f, 42)); - var_dump(fclose($f)); + var_dump($f, fread($f, 42)); + var_dump(fclose($f)); } else { - echo "open utf8 failed\n"; + echo "open utf8 failed\n"; } remove_data("file_cp1254"); diff --git a/ext/standard/tests/file/windows_mb_path/test_cp1254_to_utf8_2.phpt b/ext/standard/tests/file/windows_mb_path/test_cp1254_to_utf8_2.phpt index 1f0c7816ec..09caa2c386 100644 --- a/ext/standard/tests/file/windows_mb_path/test_cp1254_to_utf8_2.phpt +++ b/ext/standard/tests/file/windows_mb_path/test_cp1254_to_utf8_2.phpt @@ -24,10 +24,10 @@ $fn = $prefix . DIRECTORY_SEPARATOR . "${item}33"; $f = fopen($fn, 'w'); if ($f) { - var_dump($f, fwrite($f, "writing to an mb filename")); - var_dump(fclose($f)); + var_dump($f, fwrite($f, "writing to an mb filename")); + var_dump(fclose($f)); } else { - echo "open utf8 failed\n"; + echo "open utf8 failed\n"; } var_dump(file_get_contents($fn)); diff --git a/ext/standard/tests/file/windows_mb_path/test_cp1255_0.phpt b/ext/standard/tests/file/windows_mb_path/test_cp1255_0.phpt index 26388620a1..c360e82119 100644 --- a/ext/standard/tests/file/windows_mb_path/test_cp1255_0.phpt +++ b/ext/standard/tests/file/windows_mb_path/test_cp1255_0.phpt @@ -27,10 +27,10 @@ $fn = $prefix . DIRECTORY_SEPARATOR . $item; $f = fopen($fn, 'r'); if ($f) { - var_dump($f, fread($f, 42)); - var_dump(fclose($f)); + var_dump($f, fread($f, 42)); + var_dump(fclose($f)); } else { - echo "open utf8 failed\n"; + echo "open utf8 failed\n"; } remove_data("file_cp1255"); diff --git a/ext/standard/tests/file/windows_mb_path/test_cp1255_2.phpt b/ext/standard/tests/file/windows_mb_path/test_cp1255_2.phpt index 4b7ac57968..346620c6c5 100644 --- a/ext/standard/tests/file/windows_mb_path/test_cp1255_2.phpt +++ b/ext/standard/tests/file/windows_mb_path/test_cp1255_2.phpt @@ -27,10 +27,10 @@ $fn = $prefix . DIRECTORY_SEPARATOR . "${item}33"; $f = fopen($fn, 'w'); if ($f) { - var_dump($f, fwrite($f, "writing to an mb filename")); - var_dump(fclose($f)); + var_dump($f, fwrite($f, "writing to an mb filename")); + var_dump(fclose($f)); } else { - echo "open utf8 failed\n"; + echo "open utf8 failed\n"; } var_dump(file_get_contents($fn)); diff --git a/ext/standard/tests/file/windows_mb_path/test_cp1255_to_utf8_0.phpt b/ext/standard/tests/file/windows_mb_path/test_cp1255_to_utf8_0.phpt index c9517a18e3..c930515c57 100644 --- a/ext/standard/tests/file/windows_mb_path/test_cp1255_to_utf8_0.phpt +++ b/ext/standard/tests/file/windows_mb_path/test_cp1255_to_utf8_0.phpt @@ -24,10 +24,10 @@ $fn = $prefix . DIRECTORY_SEPARATOR . $item; $f = fopen($fn, 'r'); if ($f) { - var_dump($f, fread($f, 42)); - var_dump(fclose($f)); + var_dump($f, fread($f, 42)); + var_dump(fclose($f)); } else { - echo "open utf8 failed\n"; + echo "open utf8 failed\n"; } remove_data("file_cp1255"); diff --git a/ext/standard/tests/file/windows_mb_path/test_cp1255_to_utf8_2.phpt b/ext/standard/tests/file/windows_mb_path/test_cp1255_to_utf8_2.phpt index 363d1b02b5..8e18ca690f 100644 --- a/ext/standard/tests/file/windows_mb_path/test_cp1255_to_utf8_2.phpt +++ b/ext/standard/tests/file/windows_mb_path/test_cp1255_to_utf8_2.phpt @@ -24,10 +24,10 @@ $fn = $prefix . DIRECTORY_SEPARATOR . "${item}33"; $f = fopen($fn, 'w'); if ($f) { - var_dump($f, fwrite($f, "writing to an mb filename")); - var_dump(fclose($f)); + var_dump($f, fwrite($f, "writing to an mb filename")); + var_dump(fclose($f)); } else { - echo "open utf8 failed\n"; + echo "open utf8 failed\n"; } var_dump(file_get_contents($fn)); diff --git a/ext/standard/tests/file/windows_mb_path/test_cp1256_0.phpt b/ext/standard/tests/file/windows_mb_path/test_cp1256_0.phpt index 35ad1def2e..5619b33f06 100644 --- a/ext/standard/tests/file/windows_mb_path/test_cp1256_0.phpt +++ b/ext/standard/tests/file/windows_mb_path/test_cp1256_0.phpt @@ -27,10 +27,10 @@ $fn = $prefix . DIRECTORY_SEPARATOR . $item; $f = fopen($fn, 'r'); if ($f) { - var_dump($f, fread($f, 42)); - var_dump(fclose($f)); + var_dump($f, fread($f, 42)); + var_dump(fclose($f)); } else { - echo "open utf8 failed\n"; + echo "open utf8 failed\n"; } remove_data("file_cp1256"); diff --git a/ext/standard/tests/file/windows_mb_path/test_cp1256_2.phpt b/ext/standard/tests/file/windows_mb_path/test_cp1256_2.phpt index b277fc208b..e756a3e093 100644 --- a/ext/standard/tests/file/windows_mb_path/test_cp1256_2.phpt +++ b/ext/standard/tests/file/windows_mb_path/test_cp1256_2.phpt @@ -27,10 +27,10 @@ $fn = $prefix . DIRECTORY_SEPARATOR . "${item}33"; $f = fopen($fn, 'w'); if ($f) { - var_dump($f, fwrite($f, "writing to an mb filename")); - var_dump(fclose($f)); + var_dump($f, fwrite($f, "writing to an mb filename")); + var_dump(fclose($f)); } else { - echo "open utf8 failed\n"; + echo "open utf8 failed\n"; } var_dump(file_get_contents($fn)); diff --git a/ext/standard/tests/file/windows_mb_path/test_cp1256_to_utf8_0.phpt b/ext/standard/tests/file/windows_mb_path/test_cp1256_to_utf8_0.phpt index 306414e5ca..d7e0ed5afc 100644 --- a/ext/standard/tests/file/windows_mb_path/test_cp1256_to_utf8_0.phpt +++ b/ext/standard/tests/file/windows_mb_path/test_cp1256_to_utf8_0.phpt @@ -24,10 +24,10 @@ $fn = $prefix . DIRECTORY_SEPARATOR . $item; $f = fopen($fn, 'r'); if ($f) { - var_dump($f, fread($f, 42)); - var_dump(fclose($f)); + var_dump($f, fread($f, 42)); + var_dump(fclose($f)); } else { - echo "open utf8 failed\n"; + echo "open utf8 failed\n"; } remove_data("file_cp1256"); diff --git a/ext/standard/tests/file/windows_mb_path/test_cp1256_to_utf8_2.phpt b/ext/standard/tests/file/windows_mb_path/test_cp1256_to_utf8_2.phpt index 38ae6a4754..b05c4301e5 100644 --- a/ext/standard/tests/file/windows_mb_path/test_cp1256_to_utf8_2.phpt +++ b/ext/standard/tests/file/windows_mb_path/test_cp1256_to_utf8_2.phpt @@ -24,10 +24,10 @@ $fn = $prefix . DIRECTORY_SEPARATOR . "${item}33"; $f = fopen($fn, 'w'); if ($f) { - var_dump($f, fwrite($f, "writing to an mb filename")); - var_dump(fclose($f)); + var_dump($f, fwrite($f, "writing to an mb filename")); + var_dump(fclose($f)); } else { - echo "open utf8 failed\n"; + echo "open utf8 failed\n"; } var_dump(file_get_contents($fn)); diff --git a/ext/standard/tests/file/windows_mb_path/test_cp874_0.phpt b/ext/standard/tests/file/windows_mb_path/test_cp874_0.phpt index 7beae3a6bb..e8bc394a5d 100644 --- a/ext/standard/tests/file/windows_mb_path/test_cp874_0.phpt +++ b/ext/standard/tests/file/windows_mb_path/test_cp874_0.phpt @@ -22,27 +22,27 @@ default_charset=cp874 include __DIR__ . DIRECTORY_SEPARATOR . "util.inc"; $names = array( /* cp874 */ - "à»ç¹á¿éÁ·Õè·´Êͺ1", - "à»ç¹á¿éÁ·Õè·´Êͺ2", - "à»ç¹á¿éÁ·Õè·´Êͺ3", - "à»ç¹á¿éÁ·Õè·´Êͺ4", - "à»ç¹á¿éÁ·Õè·´Êͺ5", - "à»ç¹á¿éÁ·Õè·´Êͺ6", - "à»ç¹á¿éÁ·Õè·´Êͺ7", - "à»ç¹á¿éÁ·Õè·´Êͺ8", - "à»ç¹á¿éÁ·Õè·´Êͺ8 10", + "à»ç¹á¿éÁ·Õè·´Êͺ1", + "à»ç¹á¿éÁ·Õè·´Êͺ2", + "à»ç¹á¿éÁ·Õè·´Êͺ3", + "à»ç¹á¿éÁ·Õè·´Êͺ4", + "à»ç¹á¿éÁ·Õè·´Êͺ5", + "à»ç¹á¿éÁ·Õè·´Êͺ6", + "à»ç¹á¿éÁ·Õè·´Êͺ7", + "à»ç¹á¿éÁ·Õè·´Êͺ8", + "à»ç¹á¿éÁ·Õè·´Êͺ8 10", ); $i = 0; foreach ($names as $name) { - $path = __DIR__ . DIRECTORY_SEPARATOR . $name . ".txt"; + $path = __DIR__ . DIRECTORY_SEPARATOR . $name . ".txt"; - file_put_contents($path, "hello" . $i++); + file_put_contents($path, "hello" . $i++); - get_basename_with_cp($path, 874); - var_dump(file_get_contents($path)); + get_basename_with_cp($path, 874); + var_dump(file_get_contents($path)); - unlink($path); + unlink($path); } ?> diff --git a/ext/standard/tests/file/windows_mb_path/test_cp874_to_utf8_0.phpt b/ext/standard/tests/file/windows_mb_path/test_cp874_to_utf8_0.phpt index 009fcf16a5..c21f124b6e 100644 --- a/ext/standard/tests/file/windows_mb_path/test_cp874_to_utf8_0.phpt +++ b/ext/standard/tests/file/windows_mb_path/test_cp874_to_utf8_0.phpt @@ -19,27 +19,27 @@ skip_if_no_required_exts(); include __DIR__ . DIRECTORY_SEPARATOR . "util.inc"; $names = array( /* cp874 */ - "à»ç¹á¿éÁ·Õè·´Êͺ1", - "à»ç¹á¿éÁ·Õè·´Êͺ2", - "à»ç¹á¿éÁ·Õè·´Êͺ3", - "à»ç¹á¿éÁ·Õè·´Êͺ4", - "à»ç¹á¿éÁ·Õè·´Êͺ5", - "à»ç¹á¿éÁ·Õè·´Êͺ6", - "à»ç¹á¿éÁ·Õè·´Êͺ7", - "à»ç¹á¿éÁ·Õè·´Êͺ8", - "à»ç¹á¿éÁ·Õè·´Êͺ8 10", + "à»ç¹á¿éÁ·Õè·´Êͺ1", + "à»ç¹á¿éÁ·Õè·´Êͺ2", + "à»ç¹á¿éÁ·Õè·´Êͺ3", + "à»ç¹á¿éÁ·Õè·´Êͺ4", + "à»ç¹á¿éÁ·Õè·´Êͺ5", + "à»ç¹á¿éÁ·Õè·´Êͺ6", + "à»ç¹á¿éÁ·Õè·´Êͺ7", + "à»ç¹á¿éÁ·Õè·´Êͺ8", + "à»ç¹á¿éÁ·Õè·´Êͺ8 10", ); $i = 0; foreach ($names as $name) { - $pathw = __DIR__ . DIRECTORY_SEPARATOR . iconv('cp874', 'utf-8', $name) . ".txt"; + $pathw = __DIR__ . DIRECTORY_SEPARATOR . iconv('cp874', 'utf-8', $name) . ".txt"; - file_put_contents($pathw, "hello" . $i++); + file_put_contents($pathw, "hello" . $i++); - get_basename_with_cp($pathw, 65001); - var_dump(file_get_contents($pathw)); + get_basename_with_cp($pathw, 65001); + var_dump(file_get_contents($pathw)); - unlink($pathw); + unlink($pathw); } ?> diff --git a/ext/standard/tests/file/windows_mb_path/test_cp932_0.phpt b/ext/standard/tests/file/windows_mb_path/test_cp932_0.phpt index f56aa7231e..afd1ef3e7a 100644 --- a/ext/standard/tests/file/windows_mb_path/test_cp932_0.phpt +++ b/ext/standard/tests/file/windows_mb_path/test_cp932_0.phpt @@ -27,10 +27,10 @@ $fn = $prefix . DIRECTORY_SEPARATOR . $item; $f = fopen($fn, 'r'); if ($f) { - var_dump($f, fread($f, 42)); - var_dump(fclose($f)); + var_dump($f, fread($f, 42)); + var_dump(fclose($f)); } else { - echo "open utf8 failed\n"; + echo "open utf8 failed\n"; } remove_data("file_cp932"); diff --git a/ext/standard/tests/file/windows_mb_path/test_cp932_2.phpt b/ext/standard/tests/file/windows_mb_path/test_cp932_2.phpt index 51420195e8..97bad6412e 100644 --- a/ext/standard/tests/file/windows_mb_path/test_cp932_2.phpt +++ b/ext/standard/tests/file/windows_mb_path/test_cp932_2.phpt @@ -27,10 +27,10 @@ $fn = $prefix . DIRECTORY_SEPARATOR . "${item}33"; $f = fopen($fn, 'w'); if ($f) { - var_dump($f, fwrite($f, "writing to an mb filename")); - var_dump(fclose($f)); + var_dump($f, fwrite($f, "writing to an mb filename")); + var_dump(fclose($f)); } else { - echo "open utf8 failed\n"; + echo "open utf8 failed\n"; } var_dump(file_get_contents($fn)); diff --git a/ext/standard/tests/file/windows_mb_path/test_cp932_to_utf8_0.phpt b/ext/standard/tests/file/windows_mb_path/test_cp932_to_utf8_0.phpt index 40cef63621..7da7aff1fc 100644 --- a/ext/standard/tests/file/windows_mb_path/test_cp932_to_utf8_0.phpt +++ b/ext/standard/tests/file/windows_mb_path/test_cp932_to_utf8_0.phpt @@ -24,10 +24,10 @@ $fn = $prefix . DIRECTORY_SEPARATOR . $item; $f = fopen($fn, 'r'); if ($f) { - var_dump($f, fread($f, 42)); - var_dump(fclose($f)); + var_dump($f, fread($f, 42)); + var_dump(fclose($f)); } else { - echo "open utf8 failed\n"; + echo "open utf8 failed\n"; } remove_data("file_cp932"); diff --git a/ext/standard/tests/file/windows_mb_path/test_cp932_to_utf8_2.phpt b/ext/standard/tests/file/windows_mb_path/test_cp932_to_utf8_2.phpt index 2c1adc9e0a..c8aaa0b56b 100644 --- a/ext/standard/tests/file/windows_mb_path/test_cp932_to_utf8_2.phpt +++ b/ext/standard/tests/file/windows_mb_path/test_cp932_to_utf8_2.phpt @@ -24,10 +24,10 @@ $fn = $prefix . DIRECTORY_SEPARATOR . "${item}33"; $f = fopen($fn, 'w'); if ($f) { - var_dump($f, fwrite($f, "writing to an mb filename")); - var_dump(fclose($f)); + var_dump($f, fwrite($f, "writing to an mb filename")); + var_dump(fclose($f)); } else { - echo "open utf8 failed\n"; + echo "open utf8 failed\n"; } var_dump(file_get_contents($fn)); diff --git a/ext/standard/tests/file/windows_mb_path/test_cp936_0.phpt b/ext/standard/tests/file/windows_mb_path/test_cp936_0.phpt index 9b65cd6905..a67cc6683c 100644 --- a/ext/standard/tests/file/windows_mb_path/test_cp936_0.phpt +++ b/ext/standard/tests/file/windows_mb_path/test_cp936_0.phpt @@ -27,10 +27,10 @@ $fn = $prefix . DIRECTORY_SEPARATOR . "$item"; $f = fopen($fn, 'r'); if ($f) { - var_dump($f, fread($f, 42)); - var_dump(fclose($f)); + var_dump($f, fread($f, 42)); + var_dump(fclose($f)); } else { - echo "open utf8 failed\n"; + echo "open utf8 failed\n"; } remove_data("file_cp936"); diff --git a/ext/standard/tests/file/windows_mb_path/test_cp936_2.phpt b/ext/standard/tests/file/windows_mb_path/test_cp936_2.phpt index d079666467..c913f4e352 100644 --- a/ext/standard/tests/file/windows_mb_path/test_cp936_2.phpt +++ b/ext/standard/tests/file/windows_mb_path/test_cp936_2.phpt @@ -27,10 +27,10 @@ $fn = $prefix . DIRECTORY_SEPARATOR . "{$item}25"; $f = fopen($fn, 'w'); if ($f) { - var_dump($f, fwrite($f, "writing to an mb filename")); - var_dump(fclose($f)); + var_dump($f, fwrite($f, "writing to an mb filename")); + var_dump(fclose($f)); } else { - echo "open utf8 failed\n"; + echo "open utf8 failed\n"; } var_dump(file_get_contents($fn)); diff --git a/ext/standard/tests/file/windows_mb_path/test_cp936_to_utf8_0.phpt b/ext/standard/tests/file/windows_mb_path/test_cp936_to_utf8_0.phpt index 1be1f57f5f..9653f2ec1f 100644 --- a/ext/standard/tests/file/windows_mb_path/test_cp936_to_utf8_0.phpt +++ b/ext/standard/tests/file/windows_mb_path/test_cp936_to_utf8_0.phpt @@ -24,10 +24,10 @@ $fn = $prefix . DIRECTORY_SEPARATOR . "$item"; $f = fopen($fn, 'r'); if ($f) { - var_dump($f, fread($f, 42)); - var_dump(fclose($f)); + var_dump($f, fread($f, 42)); + var_dump(fclose($f)); } else { - echo "open utf8 failed\n"; + echo "open utf8 failed\n"; } remove_data("file_cp936"); diff --git a/ext/standard/tests/file/windows_mb_path/test_cp936_to_utf8_2.phpt b/ext/standard/tests/file/windows_mb_path/test_cp936_to_utf8_2.phpt index 9d6ba06c21..ab0b836da7 100644 --- a/ext/standard/tests/file/windows_mb_path/test_cp936_to_utf8_2.phpt +++ b/ext/standard/tests/file/windows_mb_path/test_cp936_to_utf8_2.phpt @@ -24,10 +24,10 @@ $fn = $prefix . DIRECTORY_SEPARATOR . "{$item}25"; $f = fopen($fn, 'w'); if ($f) { - var_dump($f, fwrite($f, "writing to an mb filename")); - var_dump(fclose($f)); + var_dump($f, fwrite($f, "writing to an mb filename")); + var_dump(fclose($f)); } else { - echo "open utf8 failed\n"; + echo "open utf8 failed\n"; } var_dump(file_get_contents($fn)); diff --git a/ext/standard/tests/file/windows_mb_path/test_eucjp_to_utf8_0.phpt b/ext/standard/tests/file/windows_mb_path/test_eucjp_to_utf8_0.phpt index a8d4e99a69..a72a80ac8b 100644 --- a/ext/standard/tests/file/windows_mb_path/test_eucjp_to_utf8_0.phpt +++ b/ext/standard/tests/file/windows_mb_path/test_eucjp_to_utf8_0.phpt @@ -24,10 +24,10 @@ $fn = $prefix . DIRECTORY_SEPARATOR . $item; $f = fopen($fn, 'r'); if ($f) { - var_dump($f, fread($f, 42)); - var_dump(fclose($f)); + var_dump($f, fread($f, 42)); + var_dump(fclose($f)); } else { - echo "open utf8 failed\n"; + echo "open utf8 failed\n"; } remove_data("file_eucjp"); diff --git a/ext/standard/tests/file/windows_mb_path/test_eucjp_to_utf8_2.phpt b/ext/standard/tests/file/windows_mb_path/test_eucjp_to_utf8_2.phpt index dfd7de5273..f43e27bd29 100644 --- a/ext/standard/tests/file/windows_mb_path/test_eucjp_to_utf8_2.phpt +++ b/ext/standard/tests/file/windows_mb_path/test_eucjp_to_utf8_2.phpt @@ -24,10 +24,10 @@ $fn = $prefix . DIRECTORY_SEPARATOR . "${item}33"; $f = fopen($fn, 'w'); if ($f) { - var_dump($f, fwrite($f, "writing to an mb filename")); - var_dump(fclose($f)); + var_dump($f, fwrite($f, "writing to an mb filename")); + var_dump(fclose($f)); } else { - echo "open utf8 failed\n"; + echo "open utf8 failed\n"; } var_dump(file_get_contents($fn)); diff --git a/ext/standard/tests/file/windows_mb_path/test_kartuli_utf8_0.phpt b/ext/standard/tests/file/windows_mb_path/test_kartuli_utf8_0.phpt index 796abf9867..b9a8552313 100644 --- a/ext/standard/tests/file/windows_mb_path/test_kartuli_utf8_0.phpt +++ b/ext/standard/tests/file/windows_mb_path/test_kartuli_utf8_0.phpt @@ -24,10 +24,10 @@ $fn = $prefix . DIRECTORY_SEPARATOR . $item; $f = fopen($fn, 'r'); if ($f) { - var_dump($f, fread($f, 42)); - var_dump(fclose($f)); + var_dump($f, fread($f, 42)); + var_dump(fclose($f)); } else { - echo "open utf8 failed\n"; + echo "open utf8 failed\n"; } remove_data("file_kartuli"); diff --git a/ext/standard/tests/file/windows_mb_path/test_kartuli_utf8_2.phpt b/ext/standard/tests/file/windows_mb_path/test_kartuli_utf8_2.phpt index 04b4dc0aa3..c0c881f0f3 100644 --- a/ext/standard/tests/file/windows_mb_path/test_kartuli_utf8_2.phpt +++ b/ext/standard/tests/file/windows_mb_path/test_kartuli_utf8_2.phpt @@ -24,10 +24,10 @@ $fn = $prefix . DIRECTORY_SEPARATOR . "${item}33"; $f = fopen($fn, 'w'); if ($f) { - var_dump($f, fwrite($f, "writing to an mb filename")); - var_dump(fclose($f)); + var_dump($f, fwrite($f, "writing to an mb filename")); + var_dump(fclose($f)); } else { - echo "open utf8 failed\n"; + echo "open utf8 failed\n"; } var_dump(file_get_contents($fn)); diff --git a/ext/standard/tests/file/windows_mb_path/test_long_path_0.phpt b/ext/standard/tests/file/windows_mb_path/test_long_path_0.phpt index b88424471f..3705582484 100644 --- a/ext/standard/tests/file/windows_mb_path/test_long_path_0.phpt +++ b/ext/standard/tests/file/windows_mb_path/test_long_path_0.phpt @@ -17,8 +17,8 @@ $s = str_repeat('a', 50); $how_many = 32; for ($i = 0; $i < $how_many; $i++) { - $p .= "$s"; - $p .= DIRECTORY_SEPARATOR; + $p .= "$s"; + $p .= DIRECTORY_SEPARATOR; } $p = realpath(__DIR__) . DIRECTORY_SEPARATOR . $p; @@ -30,8 +30,8 @@ var_dump(mkdir($p, 0777, true)); var_dump(file_exists($p)); for ($i = 0; $i < $how_many; $i++) { - $p0 = substr($p, 0, strlen($p) - $i*51); - rmdir($p0); + $p0 = substr($p, 0, strlen($p) - $i*51); + rmdir($p0); } var_dump(file_exists(realpath(__DIR__) . DIRECTORY_SEPARATOR . $s)); diff --git a/ext/standard/tests/file/windows_mb_path/test_long_path_1.phpt b/ext/standard/tests/file/windows_mb_path/test_long_path_1.phpt index ae3e1635a5..427f0e9cf5 100644 --- a/ext/standard/tests/file/windows_mb_path/test_long_path_1.phpt +++ b/ext/standard/tests/file/windows_mb_path/test_long_path_1.phpt @@ -17,8 +17,8 @@ $how_many = 32; for ($i = 0; $i < $how_many; $i++) { - $p .= "$s"; - $p .= DIRECTORY_SEPARATOR; + $p .= "$s"; + $p .= DIRECTORY_SEPARATOR; } $p = realpath(__DIR__) . DIRECTORY_SEPARATOR . $p; @@ -37,8 +37,8 @@ var_dump(file_get_contents($p7)); unlink($p7); for ($i = 0; $i < $how_many; $i++) { - $p0 = substr($p, 0, strlen($p) - $i*51); - rmdir($p0); + $p0 = substr($p, 0, strlen($p) - $i*51); + rmdir($p0); } var_dump(file_exists(realpath(__DIR__) . DIRECTORY_SEPARATOR . $s)); diff --git a/ext/standard/tests/file/windows_mb_path/test_long_path_2.phpt b/ext/standard/tests/file/windows_mb_path/test_long_path_2.phpt index 2e39fa8d5c..05982133c1 100644 --- a/ext/standard/tests/file/windows_mb_path/test_long_path_2.phpt +++ b/ext/standard/tests/file/windows_mb_path/test_long_path_2.phpt @@ -17,8 +17,8 @@ $how_many = 32; for ($i = 0; $i < $how_many; $i++) { - $p .= "$s"; - $p .= DIRECTORY_SEPARATOR; + $p .= "$s"; + $p .= DIRECTORY_SEPARATOR; } /* path doesn't exist at this point! */ @@ -43,8 +43,8 @@ var_dump(file_get_contents($p7)); unlink($p7); for ($i = 0; $i < $how_many; $i++) { - $p0 = substr($p, 0, strlen($p) - $i*(strlen($s) + 1)); - rmdir($p0); + $p0 = substr($p, 0, strlen($p) - $i*(strlen($s) + 1)); + rmdir($p0); } var_dump(file_exists(realpath(__DIR__) . DIRECTORY_SEPARATOR . $s)); diff --git a/ext/standard/tests/file/windows_mb_path/test_long_path_bug70943.phpt b/ext/standard/tests/file/windows_mb_path/test_long_path_bug70943.phpt index 72d78b3b60..5b797d293b 100644 --- a/ext/standard/tests/file/windows_mb_path/test_long_path_bug70943.phpt +++ b/ext/standard/tests/file/windows_mb_path/test_long_path_bug70943.phpt @@ -17,8 +17,8 @@ touch($testFile); echo "Opening file... "; if ($fp = fopen($testFile, "r")) { - fclose($fp); - echo "OK", "\n"; + fclose($fp); + echo "OK", "\n"; } unlink($testFile); diff --git a/ext/standard/tests/file/windows_mb_path/test_long_path_bug71103.phpt b/ext/standard/tests/file/windows_mb_path/test_long_path_bug71103.phpt index b98e087560..a81ff66dfb 100644 --- a/ext/standard/tests/file/windows_mb_path/test_long_path_bug71103.phpt +++ b/ext/standard/tests/file/windows_mb_path/test_long_path_bug71103.phpt @@ -20,27 +20,27 @@ $bar = $d . '\\5b53796d666f6e795c42756e646c655c5477696742756e646c655c436f6e74726 mkdir($d, NULL, true); foreach (array($foo, $bar) as $f) { - touch($f); - - $foo_obj = new \SplFileInfo($f); - var_dump( - $f, - strlen($f) > 260, /* exceeds _MAX_PATH */ - file_exists($f), - file_exists($foo_obj), - is_readable($f), - is_readable($foo_obj), - is_writable($f), - is_writable($foo_obj) - ); - - unlink($f); + touch($f); + + $foo_obj = new \SplFileInfo($f); + var_dump( + $f, + strlen($f) > 260, /* exceeds _MAX_PATH */ + file_exists($f), + file_exists($foo_obj), + is_readable($f), + is_readable($foo_obj), + is_writable($f), + is_writable($foo_obj) + ); + + unlink($f); } $p = $d; do { - rmdir($p); - $p = dirname($p); + rmdir($p); + $p = dirname($p); } while ($p != $base); ?> diff --git a/ext/standard/tests/file/windows_mb_path/test_long_path_mkdir.phpt b/ext/standard/tests/file/windows_mb_path/test_long_path_mkdir.phpt index c3cceb6d1a..1e3d7cd19c 100644 --- a/ext/standard/tests/file/windows_mb_path/test_long_path_mkdir.phpt +++ b/ext/standard/tests/file/windows_mb_path/test_long_path_mkdir.phpt @@ -20,15 +20,15 @@ $s = str_repeat('a', 50); $how_many = 32; for ($i = 0; $i < $how_many; $i++) { - $p .= "$s\\"; + $p .= "$s\\"; } $start = realpath(__DIR__); $newstart = false; if (strlen($start) <= 248) { - // create the exact length - $start = $start . "\\" . str_repeat('a', 251 - strlen($start) - 1); - $newstart = true; + // create the exact length + $start = $start . "\\" . str_repeat('a', 251 - strlen($start) - 1); + $newstart = true; } var_dump($start); @@ -46,11 +46,11 @@ var_dump(file_get_contents($p7)); // cleanup unlink($p7); for ($i = 0; $i < $how_many; $i++) { - $p0 = substr($p, 0, strlen($p) - $i*51); - rmdir($p0); + $p0 = substr($p, 0, strlen($p) - $i*51); + rmdir($p0); } if ($newstart) { - rmdir($start); + rmdir($start); } ?> diff --git a/ext/standard/tests/file/windows_mb_path/test_readdir_mb_names.phpt b/ext/standard/tests/file/windows_mb_path/test_readdir_mb_names.phpt index 62db0c8c65..e671ef8f1d 100644 --- a/ext/standard/tests/file/windows_mb_path/test_readdir_mb_names.phpt +++ b/ext/standard/tests/file/windows_mb_path/test_readdir_mb_names.phpt @@ -47,7 +47,7 @@ if (is_dir($dirw)) { closedir($dh); } } else { - echo "is_dir failed\n"; + echo "is_dir failed\n"; } set_active_cp($old_cp); diff --git a/ext/standard/tests/file/windows_mb_path/util.inc b/ext/standard/tests/file/windows_mb_path/util.inc index fc80a7613f..a26a66c017 100644 --- a/ext/standard/tests/file/windows_mb_path/util.inc +++ b/ext/standard/tests/file/windows_mb_path/util.inc @@ -2,153 +2,153 @@ function get_active_cp($kind = "") { - if (version_compare(PHP_VERSION, '7.1', '<')) { - $s = exec("chcp"); - preg_match(",.*: (\d+),", $s, $m); - - return $m[1]; - } else { - return sapi_windows_cp_get($kind); - } + if (version_compare(PHP_VERSION, '7.1', '<')) { + $s = exec("chcp"); + preg_match(",.*: (\d+),", $s, $m); + + return $m[1]; + } else { + return sapi_windows_cp_get($kind); + } } function set_active_cp($cp, $echo = true) { - if (version_compare(PHP_VERSION, '7.1', '<')) { - $ret = exec("chcp $cp"); - } else { - if (!sapi_windows_cp_set($cp)) { - echo "Failed to set cp $cp\n"; - return; - } - - if ($echo) echo "Active code page: ", get_active_cp(), "\n"; - } + if (version_compare(PHP_VERSION, '7.1', '<')) { + $ret = exec("chcp $cp"); + } else { + if (!sapi_windows_cp_set($cp)) { + echo "Failed to set cp $cp\n"; + return; + } + + if ($echo) echo "Active code page: ", get_active_cp(), "\n"; + } } function get_basename_with_cp($path, $cp, $echo = true) { - $old_cp = get_active_cp(); - set_active_cp($cp, $echo); + $old_cp = get_active_cp(); + set_active_cp($cp, $echo); - if ($echo) echo "getting basename of $path\n"; + if ($echo) echo "getting basename of $path\n"; - $cmd = "powershell -command \"Get-Item -Path '$path' | Format-Table -HideTableHeaders Name\""; - $out = trim(shell_exec($cmd)); + $cmd = "powershell -command \"Get-Item -Path '$path' | Format-Table -HideTableHeaders Name\""; + $out = trim(shell_exec($cmd)); - if ($echo) var_dump($out, $out == basename($path)); - if ($echo) var_dump(realpath($path)); + if ($echo) var_dump($out, $out == basename($path)); + if ($echo) var_dump(realpath($path)); - set_active_cp($old_cp, $echo); + set_active_cp($old_cp, $echo); - return $out; + return $out; } function skip_if_wrong_cp($cp, $kind = "") { - if (get_active_cp($kind) != $cp) { - die("skip this test expect codepage $cp"); - } + if (get_active_cp($kind) != $cp) { + die("skip this test expect codepage $cp"); + } } function skip_if_no_required_exts() { - $exts = func_get_args(); - $exts[] = "iconv"; - - foreach ($exts as $ext) { - if (!extension_loaded($ext)) { - die("skip $ext is not loaded"); - } - } + $exts = func_get_args(); + $exts[] = "iconv"; + + foreach ($exts as $ext) { + if (!extension_loaded($ext)) { + die("skip $ext is not loaded"); + } + } } function skip_if_not_win() { - if(substr(PHP_OS, 0, 3) != 'WIN' ) { - die('skip windows only test'); - } + if(substr(PHP_OS, 0, 3) != 'WIN' ) { + die('skip windows only test'); + } } function create_verify_file($prefix, $basename, $content = "", $cp = 65001) { - $full = $prefix . DIRECTORY_SEPARATOR . $basename; - - if (!touch($full)) { - echo "failed to touch create $full\n"; - return; - } - - $now = get_basename_with_cp($full, $cp, false); - if ($now !== $basename) { - echo "expected '$basename', got '$now'\n"; - return; - } - - if ($content) { - file_put_contents($full, $content); - } + $full = $prefix . DIRECTORY_SEPARATOR . $basename; + + if (!touch($full)) { + echo "failed to touch create $full\n"; + return; + } + + $now = get_basename_with_cp($full, $cp, false); + if ($now !== $basename) { + echo "expected '$basename', got '$now'\n"; + return; + } + + if ($content) { + file_put_contents($full, $content); + } } function create_verify_dir($prefix, $basename, $cp = 65001) { - $full = $prefix . DIRECTORY_SEPARATOR . $basename; + $full = $prefix . DIRECTORY_SEPARATOR . $basename; - if (!mkdir($full)) { - echo "failed to create dir '$full'\n"; - return; - } + if (!mkdir($full)) { + echo "failed to create dir '$full'\n"; + return; + } - $now = get_basename_with_cp($full, $cp, false); - if ($now !== $basename) { - echo "expected '$basename', got '$now'\n"; - } + $now = get_basename_with_cp($full, $cp, false); + if ($now !== $basename) { + echo "expected '$basename', got '$now'\n"; + } } function remove_data($id, $dir = NULL) { - if (!$dir) { - $dir = dirname(__FILE__) . DIRECTORY_SEPARATOR . $id; - } - - if (is_dir($dir)) { - $objects = scandir($dir); - foreach ($objects as $object) { - if ($object != "." && $object != "..") { - if (filetype($dir . DIRECTORY_SEPARATOR . $object) == "dir") - remove_data($id, $dir . DIRECTORY_SEPARATOR . $object); - else - unlink($dir . DIRECTORY_SEPARATOR . $object); - } - } - reset($objects); - rmdir($dir); - } + if (!$dir) { + $dir = dirname(__FILE__) . DIRECTORY_SEPARATOR . $id; + } + + if (is_dir($dir)) { + $objects = scandir($dir); + foreach ($objects as $object) { + if ($object != "." && $object != "..") { + if (filetype($dir . DIRECTORY_SEPARATOR . $object) == "dir") + remove_data($id, $dir . DIRECTORY_SEPARATOR . $object); + else + unlink($dir . DIRECTORY_SEPARATOR . $object); + } + } + reset($objects); + rmdir($dir); + } } function create_data($id, $item = "", $cp = 65001, $utf8 = true) { - if ($utf8) { - /* Keep this file ASCII, so zend.multibyte related stuff can be tasted as well. */ - include dirname(__FILE__) . DIRECTORY_SEPARATOR . "util_utf8.inc"; - return create_data_from_utf8($id, $item, $cp); - } else { - - $prefix = dirname(__FILE__) . DIRECTORY_SEPARATOR . $id; - - if (!is_dir($prefix)) { - mkdir($prefix); - } - - if (0 === strpos($id, "dir")) { - create_verify_dir($prefix, $item, $cp); - } else if (0 === strpos($id, "file")) { - /* a bit unhandy, but content can be put from outside, if needed */ - create_verify_file($prefix, $item, "dummy content", $cp); - } else { - echo "Item has either to start with \"dir\" or \"file\""; - } - } - - return $prefix; + if ($utf8) { + /* Keep this file ASCII, so zend.multibyte related stuff can be tasted as well. */ + include dirname(__FILE__) . DIRECTORY_SEPARATOR . "util_utf8.inc"; + return create_data_from_utf8($id, $item, $cp); + } else { + + $prefix = dirname(__FILE__) . DIRECTORY_SEPARATOR . $id; + + if (!is_dir($prefix)) { + mkdir($prefix); + } + + if (0 === strpos($id, "dir")) { + create_verify_dir($prefix, $item, $cp); + } else if (0 === strpos($id, "file")) { + /* a bit unhandy, but content can be put from outside, if needed */ + create_verify_file($prefix, $item, "dummy content", $cp); + } else { + echo "Item has either to start with \"dir\" or \"file\""; + } + } + + return $prefix; } diff --git a/ext/standard/tests/file/windows_mb_path/util_utf8.inc b/ext/standard/tests/file/windows_mb_path/util_utf8.inc index e091564998..e51fad13b6 100644 --- a/ext/standard/tests/file/windows_mb_path/util_utf8.inc +++ b/ext/standard/tests/file/windows_mb_path/util_utf8.inc @@ -2,93 +2,93 @@ function create_data_from_utf8($id, $item = "", $cp = 65001) { - $prefix = dirname(__FILE__) . DIRECTORY_SEPARATOR . $id; + $prefix = dirname(__FILE__) . DIRECTORY_SEPARATOR . $id; - if (!is_dir($prefix)) { - mkdir($prefix); - } + if (!is_dir($prefix)) { + mkdir($prefix); + } - /* Using a UTF-8 encoded filenames if !zend.multibyte, otherwise files in retrospective charset. */ - switch ($id) { + /* Using a UTF-8 encoded filenames if !zend.multibyte, otherwise files in retrospective charset. */ + switch ($id) { - case "file_mb3": - $content = "<?php + case "file_mb3": + $content = "<?php echo \"hello there from the include\n\";"; - create_verify_file($prefix, "ÄeskýtestovánÃ.inc", $content); - break; + create_verify_file($prefix, "ÄeskýtestovánÃ.inc", $content); + break; - case "bug71509": - $content = "that's my file with swedish filename + case "bug71509": + $content = "that's my file with swedish filename "; - create_verify_file($prefix, $item, $content); - break; + create_verify_file($prefix, $item, $content); + break; - case "file_mb4": - create_verify_file($prefix, "Å¡.txt", ""); - break; + case "file_mb4": + create_verify_file($prefix, "Å¡.txt", ""); + break; - case "file_cp1252": - $content = "hallo + case "file_cp1252": + $content = "hallo "; - create_verify_file($prefix, "tschüß", $content); - break; - - case "file2_cp1252": - create_verify_file($prefix, $item, "hola"); - break; - - case "file2_mb": - create_verify_file($prefix, "Ελλάδα.txt", ""); - break; - - case "file_cp1251": - create_verify_file($prefix, $item, "opened an utf8 filename for reading", $cp); - break; - - case "file_cp1255": - case "file_cp1254": - case "file_cp1253": - case "file_kartuli": - case "file_cp1250": - case "file_cp1256": - case "file_cp874": - case "file_big5": - case "file_cp936": - case "file_cp932": - case "file_eucjp": - case "file_mb": - $content = "reading file wihh multibyte filename + create_verify_file($prefix, "tschüß", $content); + break; + + case "file2_cp1252": + create_verify_file($prefix, $item, "hola"); + break; + + case "file2_mb": + create_verify_file($prefix, "Ελλάδα.txt", ""); + break; + + case "file_cp1251": + create_verify_file($prefix, $item, "opened an utf8 filename for reading", $cp); + break; + + case "file_cp1255": + case "file_cp1254": + case "file_cp1253": + case "file_kartuli": + case "file_cp1250": + case "file_cp1256": + case "file_cp874": + case "file_big5": + case "file_cp936": + case "file_cp932": + case "file_eucjp": + case "file_mb": + $content = "reading file wihh multibyte filename "; - create_verify_file($prefix, $item, $content, $cp); - break; - - case "dir_mb": - create_verify_dir($prefix, "テストマルãƒãƒã‚¤ãƒˆãƒ»ãƒ‘ス42"); - break; - - case "dir_cp1255": - case "dir_cp1254": - case "dir_cp1253": - case "dir_kartuli": - case "dir_cp1250": - case "dir_cp1256": - case "dir_cp874": - case "dir_cp932": - case "dir_cp936": - case "dir_eucjp": - case "dir2_cp1252": - case "dir_cp1252": - case "dir_cp1251": - case "dir_big5": - case "dir": - create_verify_dir($prefix, $item, $cp); - break; - - case "file": - create_verify_file($prefix, $item, "", $cp); - break; - } - - return $prefix; + create_verify_file($prefix, $item, $content, $cp); + break; + + case "dir_mb": + create_verify_dir($prefix, "テストマルãƒãƒã‚¤ãƒˆãƒ»ãƒ‘ス42"); + break; + + case "dir_cp1255": + case "dir_cp1254": + case "dir_cp1253": + case "dir_kartuli": + case "dir_cp1250": + case "dir_cp1256": + case "dir_cp874": + case "dir_cp932": + case "dir_cp936": + case "dir_eucjp": + case "dir2_cp1252": + case "dir_cp1252": + case "dir_cp1251": + case "dir_big5": + case "dir": + create_verify_dir($prefix, $item, $cp); + break; + + case "file": + create_verify_file($prefix, $item, "", $cp); + break; + } + + return $prefix; } diff --git a/ext/standard/tests/filters/basic.phpt b/ext/standard/tests/filters/basic.phpt index c9162e5bef..c0d4e5d85b 100644 --- a/ext/standard/tests/filters/basic.phpt +++ b/ext/standard/tests/filters/basic.phpt @@ -8,19 +8,19 @@ $filters = array("string.rot13", "string.toupper", "string.tolower"); function filter_test($names) { - $fp = tmpfile(); - fwrite($fp, $GLOBALS["text"]); - rewind($fp); - foreach ($names as $name) { - echo "filter: $name\n"; - var_dump(stream_filter_prepend($fp, $name)); - } - var_dump(fgets($fp)); - fclose($fp); + $fp = tmpfile(); + fwrite($fp, $GLOBALS["text"]); + rewind($fp); + foreach ($names as $name) { + echo "filter: $name\n"; + var_dump(stream_filter_prepend($fp, $name)); + } + var_dump(fgets($fp)); + fclose($fp); } foreach ($filters as $filter) { - filter_test(array($filter)); + filter_test(array($filter)); } filter_test(array($filters[0], $filters[1])); diff --git a/ext/standard/tests/filters/bug22538.phpt b/ext/standard/tests/filters/bug22538.phpt index 0ef37a7bc1..920dd55c79 100644 --- a/ext/standard/tests/filters/bug22538.phpt +++ b/ext/standard/tests/filters/bug22538.phpt @@ -3,16 +3,16 @@ Bug #22538 (filtered stream doesn't update file pointer) --FILE-- <?php function my_stream_copy_to_stream($fin, $fout) { - while (!feof($fin)) { - fwrite($fout, fread($fin, 4096)); - } + while (!feof($fin)) { + fwrite($fout, fread($fin, 4096)); + } } $size = 65536; do { - $path1 = sprintf("%s/%s%da", __DIR__, uniqid(), time()); - $path2 = sprintf("%s/%s%db", __DIR__, uniqid(), time()); + $path1 = sprintf("%s/%s%da", __DIR__, uniqid(), time()); + $path2 = sprintf("%s/%s%db", __DIR__, uniqid(), time()); } while ($path1 == $path2); $fp = fopen($path1, "w") or die("Can not open $path1\n"); @@ -20,7 +20,7 @@ $str = "abcdefghijklmnopqrstuvwxyz\n"; $str_len = strlen($str); $cnt = $size; while (($cnt -= $str_len) > 0) { - fwrite($fp, $str); + fwrite($fp, $str); } $cnt = $size - ($str_len + $cnt); fclose($fp); diff --git a/ext/standard/tests/filters/bug35916.phpt b/ext/standard/tests/filters/bug35916.phpt index a890b41a57..e234949303 100644 --- a/ext/standard/tests/filters/bug35916.phpt +++ b/ext/standard/tests/filters/bug35916.phpt @@ -9,22 +9,22 @@ class strtoupper_filter extends php_user_filter { function filter($in, $out, &$consumed, $closing) { - while($bucket=stream_bucket_make_writeable($in)) { - $bucket->data = strtoupper($bucket->data); - $consumed += $bucket->datalen; - stream_bucket_append($out, $bucket); - stream_bucket_append($out, $bucket); + while($bucket=stream_bucket_make_writeable($in)) { + $bucket->data = strtoupper($bucket->data); + $consumed += $bucket->datalen; + stream_bucket_append($out, $bucket); + stream_bucket_append($out, $bucket); } - return PSFS_PASS_ON; + return PSFS_PASS_ON; } - function onCreate() - { - echo "fffffffffff\n"; - } - function onClose() - { - echo "hello\n"; - } + function onCreate() + { + echo "fffffffffff\n"; + } + function onClose() + { + echo "hello\n"; + } } stream_filter_register("strtoupper", "strtoupper_filter"); diff --git a/ext/standard/tests/filters/bug46164-1.phpt b/ext/standard/tests/filters/bug46164-1.phpt index b2d2d4e85d..ecdd86bbe2 100644 --- a/ext/standard/tests/filters/bug46164-1.phpt +++ b/ext/standard/tests/filters/bug46164-1.phpt @@ -3,13 +3,13 @@ Bug #46164 - 1 (stream_filter_remove() closes the stream) --FILE-- <?php class user_filter extends php_user_filter { - function filter($in, $out, &$consumed, $closing) { - while($bucket = stream_bucket_make_writeable($in)) { - $consumed += $bucket->datalen; - stream_bucket_append($out, $bucket); - } - return PSFS_PASS_ON; - } + function filter($in, $out, &$consumed, $closing) { + while($bucket = stream_bucket_make_writeable($in)) { + $consumed += $bucket->datalen; + stream_bucket_append($out, $bucket); + } + return PSFS_PASS_ON; + } } stream_filter_register('user_filter','user_filter'); diff --git a/ext/standard/tests/filters/bug46164-2.phpt b/ext/standard/tests/filters/bug46164-2.phpt index 6a1bde5962..c58295076f 100644 --- a/ext/standard/tests/filters/bug46164-2.phpt +++ b/ext/standard/tests/filters/bug46164-2.phpt @@ -3,14 +3,14 @@ Bug #46164 - 2 (stream_filter_remove() closes the stream) --FILE-- <?php class user_filter extends php_user_filter { - function filter($in, $out, &$consumed, $closing) { - while($bucket = stream_bucket_make_writeable($in)) { - $consumed += $bucket->datalen; - stream_bucket_append($out, $bucket); - } - unset($this->stream); - return PSFS_PASS_ON; - } + function filter($in, $out, &$consumed, $closing) { + while($bucket = stream_bucket_make_writeable($in)) { + $consumed += $bucket->datalen; + stream_bucket_append($out, $bucket); + } + unset($this->stream); + return PSFS_PASS_ON; + } } stream_filter_register('user_filter','user_filter'); diff --git a/ext/standard/tests/filters/chunked_001.phpt b/ext/standard/tests/filters/chunked_001.phpt index c90dd403ec..094b49d7b9 100644 --- a/ext/standard/tests/filters/chunked_001.phpt +++ b/ext/standard/tests/filters/chunked_001.phpt @@ -10,19 +10,19 @@ allow_url_fopen=1 --FILE-- <?php $streams = array( - "data://text/plain,0\r\n", - "data://text/plain,2\r\nte\r\n2\r\nst\r\n0\r\n", - "data://text/plain,2\nte\n2\nst\n0\n", - "data://text/plain,2;a=1\nte\n2;a=2;b=3\r\nst\n0\n", - "data://text/plain,2\nte\n2\nst\n0\na=b\r\nc=d\n\r\n", - "data://text/plain,1f\n0123456789abcdef0123456789abcde\n1\nf\n0\n", - "data://text/plain,1E\n0123456789abcdef0123456789abcd\n2\nef\n0\n", + "data://text/plain,0\r\n", + "data://text/plain,2\r\nte\r\n2\r\nst\r\n0\r\n", + "data://text/plain,2\nte\n2\nst\n0\n", + "data://text/plain,2;a=1\nte\n2;a=2;b=3\r\nst\n0\n", + "data://text/plain,2\nte\n2\nst\n0\na=b\r\nc=d\n\r\n", + "data://text/plain,1f\n0123456789abcdef0123456789abcde\n1\nf\n0\n", + "data://text/plain,1E\n0123456789abcdef0123456789abcd\n2\nef\n0\n", ); foreach ($streams as $name) { - $fp = fopen($name, "r"); - stream_filter_append($fp, "dechunk", STREAM_FILTER_READ); - var_dump(stream_get_contents($fp)); - fclose($fp); + $fp = fopen($name, "r"); + stream_filter_append($fp, "dechunk", STREAM_FILTER_READ); + var_dump(stream_get_contents($fp)); + fclose($fp); } ?> --EXPECT-- diff --git a/ext/standard/tests/filters/filter_errors.inc b/ext/standard/tests/filters/filter_errors.inc index 8636fbe17f..18711844f8 100644 --- a/ext/standard/tests/filters/filter_errors.inc +++ b/ext/standard/tests/filters/filter_errors.inc @@ -1,36 +1,36 @@ <?php function filter_errors_skipif($needle) { - if (!function_exists('fnmatch')) { - die('skip fnmatch() not available'); - } - $filters = stream_get_filters(); - foreach($filters as $filter) { - if (fnmatch($filter, $needle)) return; - } - die("skip $needle not available"); + if (!function_exists('fnmatch')) { + die('skip fnmatch() not available'); + } + $filters = stream_get_filters(); + foreach($filters as $filter) { + if (fnmatch($filter, $needle)) return; + } + die("skip $needle not available"); } function filter_errors_test($filter, $data) { - echo "test filtering of buffered data\n"; + echo "test filtering of buffered data\n"; - $stream = fopen('php://memory', 'wb+'); + $stream = fopen('php://memory', 'wb+'); - fwrite($stream, ".\r\n$data"); - fseek($stream, 0, SEEK_SET); - stream_get_line($stream, 8192, "\r\n"); + fwrite($stream, ".\r\n$data"); + fseek($stream, 0, SEEK_SET); + stream_get_line($stream, 8192, "\r\n"); - $f = stream_filter_append($stream, $filter); + $f = stream_filter_append($stream, $filter); - echo "test filtering of non buffered data\n"; + echo "test filtering of non buffered data\n"; - $stream = fopen('php://memory', 'wb+'); + $stream = fopen('php://memory', 'wb+'); - fwrite($stream, "$data"); - fseek($stream, 0, SEEK_SET); + fwrite($stream, "$data"); + fseek($stream, 0, SEEK_SET); - stream_filter_append($stream, $filter); - stream_get_contents($stream); + stream_filter_append($stream, $filter); + stream_get_contents($stream); } diff --git a/ext/standard/tests/filters/filter_errors_user.phpt b/ext/standard/tests/filters/filter_errors_user.phpt index 9b911cf81f..a8547fe9ed 100644 --- a/ext/standard/tests/filters/filter_errors_user.phpt +++ b/ext/standard/tests/filters/filter_errors_user.phpt @@ -5,58 +5,58 @@ Filter errors: user filter require 'filter_errors.inc'; class test_filter0 extends php_user_filter { - function filter($in, $out, &$consumed, $closing) { - return PSFS_ERR_FATAL; - } + function filter($in, $out, &$consumed, $closing) { + return PSFS_ERR_FATAL; + } } class test_filter1 extends php_user_filter { - function filter($in, $out, &$consumed, $closing) { - $bucket = stream_bucket_make_writeable($in); - return PSFS_ERR_FATAL; - } + function filter($in, $out, &$consumed, $closing) { + $bucket = stream_bucket_make_writeable($in); + return PSFS_ERR_FATAL; + } } class test_filter2 extends php_user_filter { - function filter($in, $out, &$consumed, $closing) { - while ($bucket = stream_bucket_make_writeable($in)) { - $consumed += $bucket->datalen; - stream_bucket_append($out, $bucket); - } - return PSFS_ERR_FATAL; - } + function filter($in, $out, &$consumed, $closing) { + while ($bucket = stream_bucket_make_writeable($in)) { + $consumed += $bucket->datalen; + stream_bucket_append($out, $bucket); + } + return PSFS_ERR_FATAL; + } } class test_filter3 extends php_user_filter { - function filter($in, $out, &$consumed, $closing) { - if (!$closing) { - $bucket = stream_bucket_new($this->stream, "42"); - stream_bucket_append($out, $bucket); - } - return PSFS_ERR_FATAL; - } + function filter($in, $out, &$consumed, $closing) { + if (!$closing) { + $bucket = stream_bucket_new($this->stream, "42"); + stream_bucket_append($out, $bucket); + } + return PSFS_ERR_FATAL; + } } class test_filter4 extends php_user_filter { - function filter($in, $out, &$consumed, $closing) { - if (!$closing) { - $bucket = stream_bucket_new($this->stream, "42"); - } - return PSFS_ERR_FATAL; - } + function filter($in, $out, &$consumed, $closing) { + if (!$closing) { + $bucket = stream_bucket_new($this->stream, "42"); + } + return PSFS_ERR_FATAL; + } } for($i = 0; $i < 5; ++$i) { - echo "test_filter$i\n"; - var_dump(stream_filter_register("test_filter$i", "test_filter$i")); - filter_errors_test("test_filter$i", "42"); + echo "test_filter$i\n"; + var_dump(stream_filter_register("test_filter$i", "test_filter$i")); + filter_errors_test("test_filter$i", "42"); } echo "test append / read / remove\n"; for($i = 0; $i < 5; ++$i) { - echo "test_filter$i\n"; - $stream = fopen('php://memory', 'wb+'); - fwrite($stream, "42"); - fseek($stream, 0, SEEK_SET); - $f = stream_filter_append($stream, "test_filter$i"); - stream_get_contents($stream); - stream_filter_remove($f); + echo "test_filter$i\n"; + $stream = fopen('php://memory', 'wb+'); + fwrite($stream, "42"); + fseek($stream, 0, SEEK_SET); + $f = stream_filter_append($stream, "test_filter$i"); + stream_get_contents($stream); + stream_filter_remove($f); } echo "test append all / read / remove all\n"; @@ -65,12 +65,12 @@ fwrite($stream, "42"); fseek($stream, 0, SEEK_SET); $filters = array(); for($i = 0; $i < 5; ++$i) { - echo "test_filter$i\n"; - $filters[] = stream_filter_append($stream, "test_filter$i"); + echo "test_filter$i\n"; + $filters[] = stream_filter_append($stream, "test_filter$i"); } stream_get_contents($stream); foreach($filters as $filter) { - stream_filter_remove($filter); + stream_filter_remove($filter); } echo "test append all / read / close\n"; @@ -79,8 +79,8 @@ fwrite($stream, "42"); fseek($stream, 0, SEEK_SET); $filters = array(); for($i = 0; $i < 5; ++$i) { - echo "test_filter$i\n"; - $filters[] = stream_filter_append($stream, "test_filter$i"); + echo "test_filter$i\n"; + $filters[] = stream_filter_append($stream, "test_filter$i"); } stream_get_contents($stream); fclose($stream); diff --git a/ext/standard/tests/general_functions/001.phpt b/ext/standard/tests/general_functions/001.phpt index 307122e1cb..a43215c2c7 100644 --- a/ext/standard/tests/general_functions/001.phpt +++ b/ext/standard/tests/general_functions/001.phpt @@ -7,41 +7,41 @@ $agent = sprintf("%.5s", "James Bond, 007"); echo("sprintf string truncate test: "); if ($agent == "James") { - echo("passed\n"); + echo("passed\n"); } else { - echo("failed!\n"); + echo("failed!\n"); } echo("sprintf padding and align test: "); $test = sprintf("abc%04d %-20s%c", 20, "fisketur", 33); if ($test == "abc0020 fisketur !") { - echo("passed\n"); + echo("passed\n"); } else { - echo("failed!\n"); + echo("failed!\n"); } echo("sprintf octal and hex test: "); $test = sprintf("%4o %4x %4X %0"."8x", 128, 1024, 49151, 3457925); if ($test == " 200 400 BFFF 0034c385") { - echo("passed\n"); + echo("passed\n"); } else { - echo("failed!\n"); + echo("failed!\n"); } echo("sprintf octal binary test: "); $test = sprintf("%b", 3457925); if ($test == "1101001100001110000101") { - echo("passed\n"); + echo("passed\n"); } else { - echo("failed!\n"); + echo("failed!\n"); } echo("sprintf float test: "); $test = sprintf("%0"."06.2f", 10000/3.0); if ($test == "003333.33") { - echo("passed\n"); + echo("passed\n"); } else { - echo("failed!\n"); + echo("failed!\n"); } echo sprintf("%.2f\n", "99.00"); diff --git a/ext/standard/tests/general_functions/002.phpt b/ext/standard/tests/general_functions/002.phpt index 58528da13a..43c67ec07b 100644 --- a/ext/standard/tests/general_functions/002.phpt +++ b/ext/standard/tests/general_functions/002.phpt @@ -1,9 +1,9 @@ --TEST-- quoted_printable_decode() function test --FILE-- -<?php echo quoted_printable_decode("=FAwow-factor=C1=d0=D5=DD=C5=CE=CE=D9=C5=0A= -=20=D4=cf=D2=C7=CF=D7=D9=C5= -=20= +<?php echo quoted_printable_decode("=FAwow-factor=C1=d0=D5=DD=C5=CE=CE=D9=C5=0A= +=20=D4=cf=D2=C7=CF=D7=D9=C5= +=20= =D0= =D2=CF=C5=CB=D4=D9"); ?> --EXPECT-- diff --git a/ext/standard/tests/general_functions/003.phpt b/ext/standard/tests/general_functions/003.phpt index 0388cf95b0..573491b8a2 100644 --- a/ext/standard/tests/general_functions/003.phpt +++ b/ext/standard/tests/general_functions/003.phpt @@ -6,18 +6,18 @@ levenshtein() function test function test_me($title,$expect,$text1,$text2,$cost1=0,$cost2=0,$cost3=0) { if($cost1==0) - $result=levenshtein($text1,$text2); - else + $result=levenshtein($text1,$text2); + else $result=levenshtein($text1,$text2,$cost1,$cost2,$cost3); - if($result==$expect) return 0; + if($result==$expect) return 0; - echo "$title: result is $result instead of $expect "; - echo "for '$text1'/'$text2' "; - if($cost1) echo "($cost1:$cost2:$cost3)"; - echo "\n"; + echo "$title: result is $result instead of $expect "; + echo "for '$text1'/'$text2' "; + if($cost1) echo "($cost1:$cost2:$cost3)"; + echo "\n"; - return 1; + return 1; } $n=0; diff --git a/ext/standard/tests/general_functions/004.phpt b/ext/standard/tests/general_functions/004.phpt index fa83c7c220..80a7216939 100644 --- a/ext/standard/tests/general_functions/004.phpt +++ b/ext/standard/tests/general_functions/004.phpt @@ -5,7 +5,7 @@ fgetcsv() with tab delimited fields (BUG #8258) chdir(__DIR__); $fp=fopen("004.data","r"); while($a=fgetcsv($fp,100,"\t")) { - echo join(",",$a)."\n"; + echo join(",",$a)."\n"; } fclose($fp); ?> diff --git a/ext/standard/tests/general_functions/006.phpt b/ext/standard/tests/general_functions/006.phpt index 6852286c5e..80a8fd4168 100644 --- a/ext/standard/tests/general_functions/006.phpt +++ b/ext/standard/tests/general_functions/006.phpt @@ -1,9 +1,9 @@ --TEST-- quoted_printable_decode() function test with CR/LF --FILE-- -<?php echo quoted_printable_decode("=FAwow-factor=C1=D0=D5=DD=C5=CE=CE=D9=C5=0A= -=20=D4=CF=D2=C7=CF=D7=D9=C5= -=20= +<?php echo quoted_printable_decode("=FAwow-factor=C1=D0=D5=DD=C5=CE=CE=D9=C5=0A= +=20=D4=CF=D2=C7=CF=D7=D9=C5= +=20= =D0= =D2=CF=C5=CB=D4=D9"); ?> --EXPECT-- diff --git a/ext/standard/tests/general_functions/007.phpt b/ext/standard/tests/general_functions/007.phpt index 02fc6c6480..e5775bb742 100644 --- a/ext/standard/tests/general_functions/007.phpt +++ b/ext/standard/tests/general_functions/007.phpt @@ -3,8 +3,8 @@ MD5 / Base64 --FILE-- <?php function test($str) { - $res = md5(base64_decode(base64_encode($str)))."\n"; - return $res; + $res = md5(base64_decode(base64_encode($str)))."\n"; + return $res; } echo test(""); echo test("a"); diff --git a/ext/standard/tests/general_functions/009.phpt b/ext/standard/tests/general_functions/009.phpt index 39dc2189b3..254572f612 100644 --- a/ext/standard/tests/general_functions/009.phpt +++ b/ext/standard/tests/general_functions/009.phpt @@ -3,8 +3,8 @@ SHA1 --FILE-- <?php function test($str) { - $res = sha1($str)."\n"; - return $res; + $res = sha1($str)."\n"; + return $res; } echo test(""); echo test("a"); diff --git a/ext/standard/tests/general_functions/boolval.phpt b/ext/standard/tests/general_functions/boolval.phpt index 3c998520ff..fbe66264c3 100644 --- a/ext/standard/tests/general_functions/boolval.phpt +++ b/ext/standard/tests/general_functions/boolval.phpt @@ -2,18 +2,18 @@ Testing boolval() --FILE-- <?php - var_dump(boolval(false)); - var_dump(boolval(NULL)); - var_dump(boolval("")); - var_dump(boolval(0)); - var_dump(boolval(array())); + var_dump(boolval(false)); + var_dump(boolval(NULL)); + var_dump(boolval("")); + var_dump(boolval(0)); + var_dump(boolval(array())); - var_dump(boolval(true)); - var_dump(boolval("abc")); - var_dump(boolval(0.5)); - var_dump(boolval(100)); - var_dump(boolval(new stdClass())); - var_dump(boolval(STDIN)); + var_dump(boolval(true)); + var_dump(boolval("abc")); + var_dump(boolval(0.5)); + var_dump(boolval(100)); + var_dump(boolval(new stdClass())); + var_dump(boolval(STDIN)); ?> --EXPECT-- bool(false) diff --git a/ext/standard/tests/general_functions/bug25038.phpt b/ext/standard/tests/general_functions/bug25038.phpt index 5bd549fd0f..58acf1c977 100644 --- a/ext/standard/tests/general_functions/bug25038.phpt +++ b/ext/standard/tests/general_functions/bug25038.phpt @@ -9,19 +9,19 @@ function bar($x='no argument') } try { - bar('first try'); + bar('first try'); } catch (Exception $e) { - print $e->getMessage()."\n"; + print $e->getMessage()."\n"; } try { - call_user_func('bar','second try'); + call_user_func('bar','second try'); } catch (Exception $e) { - print $e->getMessage()."\n"; + print $e->getMessage()."\n"; } ?> diff --git a/ext/standard/tests/general_functions/bug29038.phpt b/ext/standard/tests/general_functions/bug29038.phpt index d0c87fb199..5502ecf61a 100644 --- a/ext/standard/tests/general_functions/bug29038.phpt +++ b/ext/standard/tests/general_functions/bug29038.phpt @@ -3,8 +3,8 @@ Bug #29038 (extract(), EXTR_PREFIX_SAME option prefixes empty strings) --FILE-- <?php function my_print_r($a) { - ksort($a); - print_r($a); + ksort($a); + print_r($a); } function f1() { $c = extract(array("" => 1),EXTR_PREFIX_SAME,"prefix"); diff --git a/ext/standard/tests/general_functions/bug32647.phpt b/ext/standard/tests/general_functions/bug32647.phpt index 92fa547820..4f5697a0d4 100644 --- a/ext/standard/tests/general_functions/bug32647.phpt +++ b/ext/standard/tests/general_functions/bug32647.phpt @@ -10,8 +10,8 @@ function foo() class bar { - function barfoo () - { echo "bar!\n"; } + function barfoo () + { echo "bar!\n"; } } unset($obj); diff --git a/ext/standard/tests/general_functions/bug35229.phpt b/ext/standard/tests/general_functions/bug35229.phpt index 8e8895dd59..c0b3614f6e 100644 --- a/ext/standard/tests/general_functions/bug35229.phpt +++ b/ext/standard/tests/general_functions/bug35229.phpt @@ -9,9 +9,9 @@ class test2 { } spl_autoload_register(function ($class) { - eval('class test1 extends test2 {}'); + eval('class test1 extends test2 {}'); - test1::use_stack( + test1::use_stack( 1,2,3,4,5,6,7,8,9,10, 11,12,13,14,15,16,17,18,19,20, 21,22,23,24,25,26,27,28,29,30 diff --git a/ext/standard/tests/general_functions/bug36011.phpt b/ext/standard/tests/general_functions/bug36011.phpt index 63e0015437..3fe4e774b4 100644 --- a/ext/standard/tests/general_functions/bug36011.phpt +++ b/ext/standard/tests/general_functions/bug36011.phpt @@ -5,25 +5,25 @@ Bug #36011 (Strict errormsg wrong for call_user_func() and the likes) class TestClass { - static function test() - { - echo __METHOD__ . "()\n"; - } - - function whee() - { - array_map(array('TestClass', 'test'), array('array_value')); - } - - function whee4() - { - call_user_func(array('TestClass', 'test')); - } - - static function whee5() - { - call_user_func(array('TestClass', 'test')); - } + static function test() + { + echo __METHOD__ . "()\n"; + } + + function whee() + { + array_map(array('TestClass', 'test'), array('array_value')); + } + + function whee4() + { + call_user_func(array('TestClass', 'test')); + } + + static function whee5() + { + call_user_func(array('TestClass', 'test')); + } } TestClass::test(); diff --git a/ext/standard/tests/general_functions/bug40398.phpt b/ext/standard/tests/general_functions/bug40398.phpt index b187c64efe..274faf8308 100644 --- a/ext/standard/tests/general_functions/bug40398.phpt +++ b/ext/standard/tests/general_functions/bug40398.phpt @@ -5,64 +5,64 @@ Bug #40398 (parent and self callback functions erroneously called statically) class Base { - function __construct($msg) - { - echo __METHOD__ . "($msg)\n"; - } + function __construct($msg) + { + echo __METHOD__ . "($msg)\n"; + } } class Derived_1 extends Base { - public function __construct() - { - $args = func_get_args(); - call_user_func_array(array($this, 'Base::__construct'), $args); - } + public function __construct() + { + $args = func_get_args(); + call_user_func_array(array($this, 'Base::__construct'), $args); + } } class Derived_2 extends Base { - public function __construct() - { - $args = func_get_args(); - call_user_func_array(array($this, 'parent::__construct'), $args); - } + public function __construct() + { + $args = func_get_args(); + call_user_func_array(array($this, 'parent::__construct'), $args); + } } class Derived_3 extends Base { - public function __construct() - { - $args = func_get_args(); - call_user_func_array('Base::__construct', $args); - } + public function __construct() + { + $args = func_get_args(); + call_user_func_array('Base::__construct', $args); + } } class Derived_4 extends Base { - public function __construct() - { - $args = func_get_args(); - call_user_func_array('parent::__construct', $args); - } + public function __construct() + { + $args = func_get_args(); + call_user_func_array('parent::__construct', $args); + } } class Derived_5 extends Base { - public function __construct() - { - $args = func_get_args(); - call_user_func_array(array('Base', '__construct'), $args); - } + public function __construct() + { + $args = func_get_args(); + call_user_func_array(array('Base', '__construct'), $args); + } } class Derived_6 extends Base { - public function __construct() - { - $args = func_get_args(); - call_user_func_array(array('parent', '__construct'), $args); - } + public function __construct() + { + $args = func_get_args(); + call_user_func_array(array('parent', '__construct'), $args); + } } new Derived_1('1'); diff --git a/ext/standard/tests/general_functions/bug41037.phpt b/ext/standard/tests/general_functions/bug41037.phpt index b9bb5856d8..c8d0a668d0 100644 --- a/ext/standard/tests/general_functions/bug41037.phpt +++ b/ext/standard/tests/general_functions/bug41037.phpt @@ -4,8 +4,8 @@ Bug #41037 (unregister_tick_function() inside the tick function crash PHP) <?php function a() { - echo "hello"; - unregister_tick_function('a'); + echo "hello"; + unregister_tick_function('a'); } declare (ticks=1) { diff --git a/ext/standard/tests/general_functions/bug44667.phpt b/ext/standard/tests/general_functions/bug44667.phpt index d4d7b94b4b..00c8224416 100644 --- a/ext/standard/tests/general_functions/bug44667.phpt +++ b/ext/standard/tests/general_functions/bug44667.phpt @@ -8,8 +8,8 @@ Bug #44667 (proc_open() does not handle pipes with the mode 'wb' correctly) $pipes = array(); $descriptor_spec = array( - 0 => array('pipe', 'rb'), - 1 => array('pipe', 'wb'), + 0 => array('pipe', 'rb'), + 1 => array('pipe', 'wb'), ); $proc = proc_open('cat', $descriptor_spec, $pipes); diff --git a/ext/standard/tests/general_functions/bug47857.phpt b/ext/standard/tests/general_functions/bug47857.phpt index c06673bc34..0d2b35b09f 100644 --- a/ext/standard/tests/general_functions/bug47857.phpt +++ b/ext/standard/tests/general_functions/bug47857.phpt @@ -3,9 +3,9 @@ Bug #47851 (is_callable throws fatal error) --FILE-- <?php class foo { - function bar() { - echo "ok\n"; - } + function bar() { + echo "ok\n"; + } } var_dump(is_callable(array('foo','bar'))); try { diff --git a/ext/standard/tests/general_functions/bug49847.phpt b/ext/standard/tests/general_functions/bug49847.phpt index a35477d00c..1a09c364d8 100644 --- a/ext/standard/tests/general_functions/bug49847.phpt +++ b/ext/standard/tests/general_functions/bug49847.phpt @@ -5,17 +5,17 @@ Bug #49847 (exec() fails on lines larger then 4095 bytes) $iswin = substr(PHP_OS, 0, 3) == "WIN"; if ($iswin) { - $f = __DIR__ . '\\bug49847.tmp'; - $s = str_repeat(' ', 4097); - $s .= '1'; - file_put_contents($f, $s); - exec('type ' . $f, $output); + $f = __DIR__ . '\\bug49847.tmp'; + $s = str_repeat(' ', 4097); + $s .= '1'; + file_put_contents($f, $s); + exec('type ' . $f, $output); } else { - exec("printf %4098d 1", $output); + exec("printf %4098d 1", $output); } var_dump($output); if ($iswin) { - unlink($f); + unlink($f); } ?> --EXPECTF-- diff --git a/ext/standard/tests/general_functions/bug71891.phpt b/ext/standard/tests/general_functions/bug71891.phpt index b1f7e200d8..4de58f2c29 100644 --- a/ext/standard/tests/general_functions/bug71891.phpt +++ b/ext/standard/tests/general_functions/bug71891.phpt @@ -4,10 +4,10 @@ Bug #71891 (header_register_callback() and register_shutdown_function()) <?php header_register_callback(function () { - echo 'header'; - register_shutdown_function(function () { - echo 'shutdown'; - }); + echo 'header'; + register_shutdown_function(function () { + echo 'shutdown'; + }); }); ?> --EXPECT-- diff --git a/ext/standard/tests/general_functions/bug72306.phpt b/ext/standard/tests/general_functions/bug72306.phpt index 05c25e6f1e..761a6454b3 100644 --- a/ext/standard/tests/general_functions/bug72306.phpt +++ b/ext/standard/tests/general_functions/bug72306.phpt @@ -3,8 +3,8 @@ Bug #72306 (Heap overflow through proc_open and $env parameter) --FILE-- <?php class moo { - function __construct() { $this->a = 0; } - function __toString() { return $this->a++ ? str_repeat("a", 0x8000) : "a"; } + function __construct() { $this->a = 0; } + function __toString() { return $this->a++ ? str_repeat("a", 0x8000) : "a"; } } $env = array('some_option' => new moo()); diff --git a/ext/standard/tests/general_functions/bug72920.phpt b/ext/standard/tests/general_functions/bug72920.phpt index d3508044fb..24a8724904 100644 --- a/ext/standard/tests/general_functions/bug72920.phpt +++ b/ext/standard/tests/general_functions/bug72920.phpt @@ -3,7 +3,7 @@ Bug #72920 (Accessing a private constant using constant() creates an exception A --FILE-- <?php class Foo { - private const C1 = "a"; + private const C1 = "a"; } try { diff --git a/ext/standard/tests/general_functions/call_user_func_array_variation_001.phpt b/ext/standard/tests/general_functions/call_user_func_array_variation_001.phpt index c05a329342..a5b61d9971 100644 --- a/ext/standard/tests/general_functions/call_user_func_array_variation_001.phpt +++ b/ext/standard/tests/general_functions/call_user_func_array_variation_001.phpt @@ -4,11 +4,11 @@ call_user_func_array() passes by reference if the array element is referenced, r <?php function by_val($arg) { - $arg = 'changed'; + $arg = 'changed'; } function by_ref(&$arg) { - $arg = 'changed'; + $arg = 'changed'; } echo "------ Calling by_val() with unreferenced argument ------\n"; diff --git a/ext/standard/tests/general_functions/call_user_func_return.phpt b/ext/standard/tests/general_functions/call_user_func_return.phpt index 1457ae2e36..4719587ffc 100644 --- a/ext/standard/tests/general_functions/call_user_func_return.phpt +++ b/ext/standard/tests/general_functions/call_user_func_return.phpt @@ -7,24 +7,24 @@ $t1 = 'test1'; function test1($arg1, $arg2) { - global $t1; - echo "$arg1 $arg2\n"; - return $t1; + global $t1; + echo "$arg1 $arg2\n"; + return $t1; } $t2 = 'test2'; function & test2($arg1, $arg2) { - global $t2; - echo "$arg1 $arg2\n"; - return $t2; + global $t2; + echo "$arg1 $arg2\n"; + return $t2; } function test($func) { - debug_zval_dump($func('Direct', 'Call')); - debug_zval_dump(call_user_func_array($func, array('User', 'Func'))); + debug_zval_dump($func('Direct', 'Call')); + debug_zval_dump(call_user_func_array($func, array('User', 'Func'))); } test('test1'); diff --git a/ext/standard/tests/general_functions/debug_zval_dump_o.phpt b/ext/standard/tests/general_functions/debug_zval_dump_o.phpt index 64352105db..ac4149f61c 100644 --- a/ext/standard/tests/general_functions/debug_zval_dump_o.phpt +++ b/ext/standard/tests/general_functions/debug_zval_dump_o.phpt @@ -29,13 +29,13 @@ class object_class { public $value4 = 30; private function foo1() { - echo "function foo1\n"; + echo "function foo1\n"; } protected function foo2() { - echo "function foo2\n"; + echo "function foo2\n"; } public function foo3() { - echo "function foo3\n"; + echo "function foo3\n"; } public $array_var = array( "key1" => 1, "key2 " => 3); diff --git a/ext/standard/tests/general_functions/escapeshellarg_variation1-win32.phpt b/ext/standard/tests/general_functions/escapeshellarg_variation1-win32.phpt index 1a3eadbb80..309eca316e 100644 --- a/ext/standard/tests/general_functions/escapeshellarg_variation1-win32.phpt +++ b/ext/standard/tests/general_functions/escapeshellarg_variation1-win32.phpt @@ -69,9 +69,9 @@ $inputs = array( // loop through each element of $inputs to check the behaviour of escapeshellarg() $iterator = 1; foreach($inputs as $input) { - echo "\n-- Iteration $iterator --\n"; - var_dump(escapeshellarg($input)); - $iterator++; + echo "\n-- Iteration $iterator --\n"; + var_dump(escapeshellarg($input)); + $iterator++; }; ?> --EXPECT-- diff --git a/ext/standard/tests/general_functions/escapeshellarg_variation1.phpt b/ext/standard/tests/general_functions/escapeshellarg_variation1.phpt index ba56db69ea..e2aec56c27 100644 --- a/ext/standard/tests/general_functions/escapeshellarg_variation1.phpt +++ b/ext/standard/tests/general_functions/escapeshellarg_variation1.phpt @@ -69,9 +69,9 @@ $inputs = array( // loop through each element of $inputs to check the behaviour of escapeshellarg() $iterator = 1; foreach($inputs as $input) { - echo "\n-- Iteration $iterator --\n"; - var_dump(escapeshellarg($input)); - $iterator++; + echo "\n-- Iteration $iterator --\n"; + var_dump(escapeshellarg($input)); + $iterator++; }; ?> --EXPECT-- diff --git a/ext/standard/tests/general_functions/escapeshellcmd-win32.phpt b/ext/standard/tests/general_functions/escapeshellcmd-win32.phpt index 5254e5d57a..3f014fdf81 100644 --- a/ext/standard/tests/general_functions/escapeshellcmd-win32.phpt +++ b/ext/standard/tests/general_functions/escapeshellcmd-win32.phpt @@ -10,21 +10,21 @@ if( substr(PHP_OS, 0, 3) != 'WIN' ) { <?php echo "*** Testing escapeshellcmd() basic operations ***\n"; $data = array( - '"abc', - "'abc", - '?<>', - '()[]{}$', - '%^', - '#&;`|*?', - '~<>\\', - '%NOENV%', - '!NOENV!' + '"abc', + "'abc", + '?<>', + '()[]{}$', + '%^', + '#&;`|*?', + '~<>\\', + '%NOENV%', + '!NOENV!' ); $count = 1; foreach ($data AS $value) { - echo "-- Test " . $count++ . " --\n"; - var_dump(escapeshellcmd($value)); + echo "-- Test " . $count++ . " --\n"; + var_dump(escapeshellcmd($value)); } echo "Done\n"; diff --git a/ext/standard/tests/general_functions/floatval.phpt b/ext/standard/tests/general_functions/floatval.phpt index f6f354509a..a409f92a75 100644 --- a/ext/standard/tests/general_functions/floatval.phpt +++ b/ext/standard/tests/general_functions/floatval.phpt @@ -13,23 +13,23 @@ $valid_floats = array( 1.0, -1.0, 1.234, - -1.234, + -1.234, 1.2e3, - -1.2e3, - 10.0000000000000000005, - 10.5e+5, + -1.2e3, + 10.0000000000000000005, + 10.5e+5, 1e5, - -1e5, + -1e5, 1e-5, - -1e-1, - 1e+5, - -1e+5, - 1E5, - -1E5, - 1E+5, - -1E+5, - .5e+7, - -.5e+7 + -1e-1, + 1e+5, + -1e+5, + 1E5, + -1E5, + 1E+5, + -1E+5, + .5e+7, + -.5e+7 ); /* loop to check that floatval() recognizes different @@ -65,12 +65,12 @@ $not_float_types = array ( $dfp, "0.0", // string "1.0", - "-1.3e3", - "bob-1.3e3", + "-1.3e3", + "bob-1.3e3", "10 Some dollars", - "10.2 Some Dollars", - "10.0 dollar" + 1, - "10.0 dollar" + 1.0, + "10.2 Some Dollars", + "10.0 dollar" + 1, + "10.0 dollar" + 1.0, "", true, NULL, diff --git a/ext/standard/tests/general_functions/floatval_basic.phpt b/ext/standard/tests/general_functions/floatval_basic.phpt index dc1c547731..d6a3b72a19 100644 --- a/ext/standard/tests/general_functions/floatval_basic.phpt +++ b/ext/standard/tests/general_functions/floatval_basic.phpt @@ -14,23 +14,23 @@ $valid_floats = array( "1.0" => 1.0, "-1.0" => -1.0, "1.234" => 1.234, - "-1.234" => -1.234, + "-1.234" => -1.234, "1.2e3" => 1.2e3, - "-1.2e3" => -1.2e3, - "10.0000000000000000005" => 10.0000000000000000005, - "10.5e+5" => 10.5e+5, + "-1.2e3" => -1.2e3, + "10.0000000000000000005" => 10.0000000000000000005, + "10.5e+5" => 10.5e+5, "1e5" => 1e5, - "-1e5" => -1e5, + "-1e5" => -1e5, "1e5" => 1e-5, - "-1e-1" => -1e-1, - "1e+5" => 1e+5, - "-1e+5" =>-1e+5, - "1E5" => 1E5, - "-1E5" => -1E5, - "1E+5" => 1E+5, - "-1E5" => -1E+5, - ".5e+7" => .5e+7, - "-.5e+7" =>-.5e+7 + "-1e-1" => -1e-1, + "1e+5" => 1e+5, + "-1e+5" =>-1e+5, + "1E5" => 1E5, + "-1E5" => -1E5, + "1E+5" => 1E+5, + "-1E5" => -1E+5, + ".5e+7" => .5e+7, + "-.5e+7" =>-.5e+7 ); /* loop to check that floatval() recognizes different diff --git a/ext/standard/tests/general_functions/floatval_variation1.phpt b/ext/standard/tests/general_functions/floatval_variation1.phpt index 098c4ad252..e688253e3f 100644 --- a/ext/standard/tests/general_functions/floatval_variation1.phpt +++ b/ext/standard/tests/general_functions/floatval_variation1.phpt @@ -22,12 +22,12 @@ $not_float_types = array ( "directory resource" => $dfp, "\"0.0\"" => "0.0", // string "\"1.0\"" => "1.0", - "\"-1.3e3\"" => "-1.3e3", - "\"bob-1.3e3\"" => "bob-1.3e3", + "\"-1.3e3\"" => "-1.3e3", + "\"bob-1.3e3\"" => "bob-1.3e3", "\"10 Some dollars\"" => "10 Some dollars", - "\"10.2 Some Dollars\"" => "10.2 Some Dollars", - "\"10.0 dollar\" + 1" => "10.0 dollar" + 1, - "\"10.0 dollar\" + 1.0" => "10.0 dollar" + 1.0, + "\"10.2 Some Dollars\"" => "10.2 Some Dollars", + "\"10.0 dollar\" + 1" => "10.0 dollar" + 1, + "\"10.0 dollar\" + 1.0" => "10.0 dollar" + 1.0, "\"\"" => "", "true" => true, "NULL" => NULL, diff --git a/ext/standard/tests/general_functions/get_defined_constants_basic.phpt b/ext/standard/tests/general_functions/get_defined_constants_basic.phpt index 2aee70e6d0..7876540e8a 100644 --- a/ext/standard/tests/general_functions/get_defined_constants_basic.phpt +++ b/ext/standard/tests/general_functions/get_defined_constants_basic.phpt @@ -22,9 +22,9 @@ $arr2 = get_defined_constants(); $n2 = count($arr2); if ($n2 == $n1 + 1 && array_key_exists("USER_CONSTANT", $arr2)) { - echo "TEST PASSED\n"; + echo "TEST PASSED\n"; } else { - echo "TEST FAILED\n"; + echo "TEST FAILED\n"; } ?> diff --git a/ext/standard/tests/general_functions/get_defined_vars_basic.phpt b/ext/standard/tests/general_functions/get_defined_vars_basic.phpt index 7f2b7a180e..19b59fea96 100644 --- a/ext/standard/tests/general_functions/get_defined_vars_basic.phpt +++ b/ext/standard/tests/general_functions/get_defined_vars_basic.phpt @@ -15,7 +15,7 @@ function f1() { $vars = get_defined_vars(); if (count($vars) != 0) { - echo "TEST FAILED\n"; + echo "TEST FAILED\n"; } echo "\n-- ..define some local variables --\n"; @@ -33,7 +33,7 @@ function f2() { $vars= get_defined_vars(); if (count($vars) != 0) { - echo "TEST FAILED\n"; + echo "TEST FAILED\n"; } echo "\n-- ...define some variables --\n"; diff --git a/ext/standard/tests/general_functions/get_include_path_basic.phpt b/ext/standard/tests/general_functions/get_include_path_basic.phpt index 809faf694d..bb7ccf542b 100644 --- a/ext/standard/tests/general_functions/get_include_path_basic.phpt +++ b/ext/standard/tests/general_functions/get_include_path_basic.phpt @@ -14,9 +14,9 @@ echo "*** Testing get_include_path()\n"; var_dump(get_include_path()); if (ini_get("include_path") == get_include_path()) { - echo "PASSED\n"; + echo "PASSED\n"; } else { - echo "FAILED\n"; + echo "FAILED\n"; } ?> diff --git a/ext/standard/tests/general_functions/getopt.phpt b/ext/standard/tests/general_functions/getopt.phpt index 67864e9a96..4424072d1a 100644 --- a/ext/standard/tests/general_functions/getopt.phpt +++ b/ext/standard/tests/general_functions/getopt.phpt @@ -7,7 +7,7 @@ register_argc_argv=On variables_order=GPS --FILE-- <?php - var_dump(getopt("d:m:j:vht")); + var_dump(getopt("d:m:j:vht")); ?> --EXPECT-- array(5) { diff --git a/ext/standard/tests/general_functions/getopt_002.phpt b/ext/standard/tests/general_functions/getopt_002.phpt index 1bf65e70ab..6ae2d3cb3d 100644 --- a/ext/standard/tests/general_functions/getopt_002.phpt +++ b/ext/standard/tests/general_functions/getopt_002.phpt @@ -7,7 +7,7 @@ register_argc_argv=On variables_order=GPS --FILE-- <?php - var_dump(getopt("2a:vcd1")); + var_dump(getopt("2a:vcd1")); ?> --EXPECT-- array(4) { diff --git a/ext/standard/tests/general_functions/getopt_003.phpt b/ext/standard/tests/general_functions/getopt_003.phpt index e1a5146065..e40de84674 100644 --- a/ext/standard/tests/general_functions/getopt_003.phpt +++ b/ext/standard/tests/general_functions/getopt_003.phpt @@ -7,7 +7,7 @@ register_argc_argv=On variables_order=GPS --FILE-- <?php - var_dump(getopt("2a:vcd1", array("another:", 12, 0, 1, "v"))); + var_dump(getopt("2a:vcd1", array("another:", 12, 0, 1, "v"))); ?> --EXPECT-- array(7) { diff --git a/ext/standard/tests/general_functions/getopt_004.phpt b/ext/standard/tests/general_functions/getopt_004.phpt index ac0aafe27b..5e8e810d38 100644 --- a/ext/standard/tests/general_functions/getopt_004.phpt +++ b/ext/standard/tests/general_functions/getopt_004.phpt @@ -7,7 +7,7 @@ register_argc_argv=On variables_order=GPS --FILE-- <?php - var_dump(getopt("v::", array("v::"))); + var_dump(getopt("v::", array("v::"))); ?> --EXPECT-- array(1) { diff --git a/ext/standard/tests/general_functions/getopt_005.phpt b/ext/standard/tests/general_functions/getopt_005.phpt index 3fa1791eab..d75c4709ea 100644 --- a/ext/standard/tests/general_functions/getopt_005.phpt +++ b/ext/standard/tests/general_functions/getopt_005.phpt @@ -7,7 +7,7 @@ register_argc_argv=On variables_order=GPS --FILE-- <?php - var_dump(getopt("a:", array("arg:"))); + var_dump(getopt("a:", array("arg:"))); ?> --EXPECT-- array(2) { diff --git a/ext/standard/tests/general_functions/getrusage_basic.phpt b/ext/standard/tests/general_functions/getrusage_basic.phpt index 7aaacd51a0..b057b57fae 100644 --- a/ext/standard/tests/general_functions/getrusage_basic.phpt +++ b/ext/standard/tests/general_functions/getrusage_basic.phpt @@ -15,7 +15,7 @@ echo "Simple testcase for getrusage() function\n"; $dat = getrusage(); if (!is_array($dat)) { - echo "TEST FAILED : getrusage should return an array\n"; + echo "TEST FAILED : getrusage should return an array\n"; } // echo the fields which are common to all platforms diff --git a/ext/standard/tests/general_functions/getservbyname_basic.phpt b/ext/standard/tests/general_functions/getservbyname_basic.phpt index adaa7afb43..edc210fc39 100644 --- a/ext/standard/tests/general_functions/getservbyname_basic.phpt +++ b/ext/standard/tests/general_functions/getservbyname_basic.phpt @@ -8,12 +8,12 @@ Simone Gentili (sensorario@gmail.com) --FILE-- <?php - $services = array('http', 'ftp', 'ssh', 'telnet', 'imap', 'smtp', 'nicname', 'gopher', 'finger', 'pop3', 'www'); + $services = array('http', 'ftp', 'ssh', 'telnet', 'imap', 'smtp', 'nicname', 'gopher', 'finger', 'pop3', 'www'); - foreach ($services as $service) { - $port = getservbyname($service, 'tcp'); - var_dump($port); - } + foreach ($services as $service) { + $port = getservbyname($service, 'tcp'); + var_dump($port); + } ?> diff --git a/ext/standard/tests/general_functions/getservbyport_basic.phpt b/ext/standard/tests/general_functions/getservbyport_basic.phpt index b9e0f83c98..cc02a4508e 100644 --- a/ext/standard/tests/general_functions/getservbyport_basic.phpt +++ b/ext/standard/tests/general_functions/getservbyport_basic.phpt @@ -7,21 +7,21 @@ Michele Orselli (mo@ideato.it) Simone Gentili (sensorario@gmail.com) --FILE-- <?php - if (file_exists("/etc/services")) { - $file = "/etc/services"; - } - elseif(substr(PHP_OS,0,3) == "WIN") $file = "C:/WINDOWS/system32/drivers/etc/services"; - else die(PHP_OS. " unsupported"); + if (file_exists("/etc/services")) { + $file = "/etc/services"; + } + elseif(substr(PHP_OS,0,3) == "WIN") $file = "C:/WINDOWS/system32/drivers/etc/services"; + else die(PHP_OS. " unsupported"); - if(file_exists($file)){ - $services = file_get_contents($file); + if(file_exists($file)){ + $services = file_get_contents($file); $service = getservbyport( 80, "tcp" ); if(preg_match("/$service\s+80\/tcp/", $services)) { - echo "PASS\n"; - } - }else{ - echo "Services file not found in expected location\n"; - } + echo "PASS\n"; + } + }else{ + echo "Services file not found in expected location\n"; + } ?> --EXPECT-- PASS diff --git a/ext/standard/tests/general_functions/getservbyport_variation1.phpt b/ext/standard/tests/general_functions/getservbyport_variation1.phpt index f387161bf4..349fe16a94 100644 --- a/ext/standard/tests/general_functions/getservbyport_variation1.phpt +++ b/ext/standard/tests/general_functions/getservbyport_variation1.phpt @@ -9,11 +9,11 @@ Michele Orselli (mo@ideato.it) Simone Gentili (sensorario@gmail.com) --FILE-- <?php - var_dump(getservbyport( -1, "tcp" )); - var_dump(getservbyport( 80, "ppp" )); - var_dump(getservbyport( null, null)); - var_dump(getservbyport( 2, 2)); - var_dump(getservbyport( "80", "tcp")); + var_dump(getservbyport( -1, "tcp" )); + var_dump(getservbyport( 80, "ppp" )); + var_dump(getservbyport( null, null)); + var_dump(getservbyport( 2, 2)); + var_dump(getservbyport( "80", "tcp")); ?> --EXPECTF-- diff --git a/ext/standard/tests/general_functions/intval_variation1.phpt b/ext/standard/tests/general_functions/intval_variation1.phpt index 470fa03630..c968b39a90 100644 --- a/ext/standard/tests/general_functions/intval_variation1.phpt +++ b/ext/standard/tests/general_functions/intval_variation1.phpt @@ -12,10 +12,10 @@ echo "*** Testing intval() : usage variation ***\n"; // Define error handler function test_error_handler($err_no, $err_msg, $filename, $linenum) { - if (error_reporting() & $err_no) { - // report non-silenced errors - echo "Error: $err_no - $err_msg, $filename($linenum)\n"; - } + if (error_reporting() & $err_no) { + // report non-silenced errors + echo "Error: $err_no - $err_msg, $filename($linenum)\n"; + } } set_error_handler('test_error_handler'); @@ -29,9 +29,9 @@ unset ($unset_var); // define some classes class classWithToString { - public function __toString() { - return "Class A object"; - } + public function __toString() { + return "Class A object"; + } } class classWithoutToString diff --git a/ext/standard/tests/general_functions/is_resource.phpt b/ext/standard/tests/general_functions/is_resource.phpt index 2717e3fa43..ff6f1fd422 100644 --- a/ext/standard/tests/general_functions/is_resource.phpt +++ b/ext/standard/tests/general_functions/is_resource.phpt @@ -2,9 +2,9 @@ Bug #27822 (is_resource() returns TRUE for closed resources) --FILE-- <?php - $f = fopen(__FILE__, 'r'); - fclose($f); - var_dump(is_resource($f)); + $f = fopen(__FILE__, 'r'); + fclose($f); + var_dump(is_resource($f)); ?> --EXPECT-- bool(false) diff --git a/ext/standard/tests/general_functions/is_resource_basic.phpt b/ext/standard/tests/general_functions/is_resource_basic.phpt index f8e9ff6369..06988850ee 100644 --- a/ext/standard/tests/general_functions/is_resource_basic.phpt +++ b/ext/standard/tests/general_functions/is_resource_basic.phpt @@ -11,39 +11,39 @@ echo "*** Testing is_resource() : basic functionality ***\n"; class Hello { public function SayHello($arg) { - echo "Hello\n"; + echo "Hello\n"; } } $vars = array( - false, - true, - 10, - 10.5, - "Helo World", - array(1,2,3,4,5), - NULL, - new Hello()); + false, + true, + 10, + 10.5, + "Helo World", + array(1,2,3,4,5), + NULL, + new Hello()); $types = array( - "bool=false", - "bool=true", - "integer", - "double", - "string", - "array", - "NULL", - "object"); + "bool=false", + "bool=true", + "integer", + "double", + "string", + "array", + "NULL", + "object"); echo "\nNon-resource type cases\n"; for ($i=0; $i < count($vars); $i++) { - if (is_resource($vars[$i])) { - echo $types[$i]. " test returns TRUE\n"; - } else { - echo $types[$i]. " test returns FALSE\n"; - } + if (is_resource($vars[$i])) { + echo $types[$i]. " test returns TRUE\n"; + } else { + echo $types[$i]. " test returns FALSE\n"; + } } $res = fopen(__FILE__, "r"); @@ -51,9 +51,9 @@ echo "\nResource type..var_dump after file open returns\n"; var_dump($res); echo "Resource type..after file open is_resource() returns"; if (is_resource($res)) { - echo " TRUE\n"; + echo " TRUE\n"; } else { - echo " FALSE\n"; + echo " FALSE\n"; } fclose($res); @@ -61,9 +61,9 @@ echo "\nResource type..var_dump after file close returns\n"; var_dump($res); echo "Resource type..after file close is_resource() returns"; if (is_resource($res)) { - echo " TRUE\n"; + echo " TRUE\n"; } else { - echo " FALSE\n"; + echo " FALSE\n"; } diff --git a/ext/standard/tests/general_functions/is_string.phpt b/ext/standard/tests/general_functions/is_string.phpt index a062cc17e1..7760f79831 100644 --- a/ext/standard/tests/general_functions/is_string.phpt +++ b/ext/standard/tests/general_functions/is_string.phpt @@ -17,7 +17,7 @@ EOT; /* heredoc string with only numerics */ $heredoc_numeric_string = <<<EOT 123456 3993 -4849 string +4849 string EOT; /* null heardoc string */ $heredoc_empty_string = <<<EOT diff --git a/ext/standard/tests/general_functions/ob_get_length_basic.phpt b/ext/standard/tests/general_functions/ob_get_length_basic.phpt index 12e0a72026..46d5d2d0f6 100644 --- a/ext/standard/tests/general_functions/ob_get_length_basic.phpt +++ b/ext/standard/tests/general_functions/ob_get_length_basic.phpt @@ -12,11 +12,11 @@ output_buffering=0 function dump_string_length( $string ) { - ob_start(); - echo $string; - $len = ob_get_length(); - ob_end_clean(); - var_dump( $len ); + ob_start(); + echo $string; + $len = ob_get_length(); + ob_end_clean(); + var_dump( $len ); } echo "*** Testing ob_get_length() : basic functionality ***\n"; diff --git a/ext/standard/tests/general_functions/output_add_rewrite_var_basic1.phpt b/ext/standard/tests/general_functions/output_add_rewrite_var_basic1.phpt index 58b6f19f5c..980ae129ef 100644 --- a/ext/standard/tests/general_functions/output_add_rewrite_var_basic1.phpt +++ b/ext/standard/tests/general_functions/output_add_rewrite_var_basic1.phpt @@ -7,7 +7,7 @@ session.trans_sid_tags="a=href,area=href,frame=src,form=" url_rewriter.tags="a=href,area=href,frame=src,form=" --FILE-- <?php - ob_start(); + ob_start(); // Common setting ini_set('url_rewriter.hosts', 'php.net,www.php.net'); ini_set('session.trans_sid_hosts', 'php.net,www.php.net'); diff --git a/ext/standard/tests/general_functions/output_add_rewrite_var_basic2.phpt b/ext/standard/tests/general_functions/output_add_rewrite_var_basic2.phpt index 6b0c4e85a9..e888932a60 100644 --- a/ext/standard/tests/general_functions/output_add_rewrite_var_basic2.phpt +++ b/ext/standard/tests/general_functions/output_add_rewrite_var_basic2.phpt @@ -7,7 +7,7 @@ session.trans_sid_tags="a=href,area=href,frame=src,form=" url_rewriter.tags="a=href,area=href,frame=src,form=" --FILE-- <?php - ob_start(); + ob_start(); // Common setting ini_set('url_rewriter.hosts', 'php.net,www.php.net'); ini_set('session.trans_sid_hosts', 'php.net,www.php.net'); diff --git a/ext/standard/tests/general_functions/output_add_rewrite_var_basic3.phpt b/ext/standard/tests/general_functions/output_add_rewrite_var_basic3.phpt index 9e35f967f0..0cf10f7249 100644 --- a/ext/standard/tests/general_functions/output_add_rewrite_var_basic3.phpt +++ b/ext/standard/tests/general_functions/output_add_rewrite_var_basic3.phpt @@ -7,7 +7,7 @@ session.trans_sid_tags="a=href,area=href,frame=src,form=" url_rewriter.tags="a=href,area=href,frame=src,form=" --FILE-- <?php - ob_start(); + ob_start(); // Common setting ini_set('url_rewriter.hosts', 'example.com'); ini_set('session.use_only_cookies', 0); diff --git a/ext/standard/tests/general_functions/output_add_rewrite_var_basic4.phpt b/ext/standard/tests/general_functions/output_add_rewrite_var_basic4.phpt index 2dda4e7896..332f7cfdc2 100644 --- a/ext/standard/tests/general_functions/output_add_rewrite_var_basic4.phpt +++ b/ext/standard/tests/general_functions/output_add_rewrite_var_basic4.phpt @@ -7,7 +7,7 @@ session.trans_sid_tags="a=href,area=href,frame=src,form=" url_rewriter.tags="a=href,area=href,frame=src,form=" --FILE-- <?php - ob_start(); + ob_start(); // Common setting ini_set('url_rewriter.hosts', 'example.com'); ini_set('session.use_only_cookies', 1); diff --git a/ext/standard/tests/general_functions/parse_ini_string_001.phpt b/ext/standard/tests/general_functions/parse_ini_string_001.phpt index 1621fe9f16..de1daa7637 100644 --- a/ext/standard/tests/general_functions/parse_ini_string_001.phpt +++ b/ext/standard/tests/general_functions/parse_ini_string_001.phpt @@ -23,7 +23,7 @@ PHP_CONSTANT = 1.2345678 HELLO = HELLO [date] -date = +date = time = [paths] @@ -62,7 +62,7 @@ Non_alpha11 = / Non_alpha12 = \ ;These chars have a special meaning when used in the value, ; hence parser throws an error -;Non_alpha13 = & +;Non_alpha13 = & ;Non_alpha14 = ^ ;Non_alpha15 = {} ;Non_alpha16 = | @@ -170,7 +170,7 @@ Key16 = Null Key17 = nuLL Key18 = null -[ReservedKeys_as_Keys] +[ReservedKeys_as_Keys] ; Expected:error, reserved key words must not be used as keys for ini file ;YES = 1 ;Yes = 2 diff --git a/ext/standard/tests/general_functions/proc_nice_basic-win.phpt b/ext/standard/tests/general_functions/proc_nice_basic-win.phpt index 37f8e17af2..6bf3b2c0a6 100644 --- a/ext/standard/tests/general_functions/proc_nice_basic-win.phpt +++ b/ext/standard/tests/general_functions/proc_nice_basic-win.phpt @@ -15,71 +15,71 @@ if (getenv('SKIP_SLOW_TESTS')) { --FILE-- <?php function get_priority_from_wmic() { - static $bin, $pid; + static $bin, $pid; - if (!$bin) { - $t = explode('\\', PHP_BINARY); + if (!$bin) { + $t = explode('\\', PHP_BINARY); - $bin = end($t); - $pid = getmypid(); - } + $bin = end($t); + $pid = getmypid(); + } - $t = ''; - $p = popen('wmic process where name="' . $bin . '"', 'r'); + $t = ''; + $p = popen('wmic process where name="' . $bin . '"', 'r'); - if (!$p) { - return false; - } + if (!$p) { + return false; + } - while(!feof($p)) { - $t .= fread($p, 1024); - } + while(!feof($p)) { + $t .= fread($p, 1024); + } - pclose($p); + pclose($p); - $t = explode(PHP_EOL, $t); + $t = explode(PHP_EOL, $t); - $f = false; - $m = [ - strpos($t[0], ' ProcessId' ), - strpos($t[0], ' Priority ') - ]; + $f = false; + $m = [ + strpos($t[0], ' ProcessId' ), + strpos($t[0], ' Priority ') + ]; - foreach ($t as $n => $l) { - if (!$n || empty($l)) { - continue; - } + foreach ($t as $n => $l) { + if (!$n || empty($l)) { + continue; + } - $d = []; + $d = []; - foreach ($m as $c) { - $d[] = (int) substr($l, $c + 1, strpos($l, ' ', $c + 2) - ($c + 1)); - } + foreach ($m as $c) { + $d[] = (int) substr($l, $c + 1, strpos($l, ' ', $c + 2) - ($c + 1)); + } - if ($d[0] === $pid) { - return $d[1]; - } - } + if ($d[0] === $pid) { + return $d[1]; + } + } - return false; + return false; } $p = [ - /* '<verbose name>' => ['<wmic value>', '<proc_nice value>'] */ + /* '<verbose name>' => ['<wmic value>', '<proc_nice value>'] */ - 'Idle' => [4, 10], - 'Below normal' => [6, 5], - 'Normal' => [8, 0], - 'Above normal' => [10, -5], - 'High priority' => [13, -10] - ]; + 'Idle' => [4, 10], + 'Below normal' => [6, 5], + 'Normal' => [8, 0], + 'Above normal' => [10, -5], + 'High priority' => [13, -10] + ]; foreach ($p as $test => $data) { - printf('Testing \'%s\' (%d): ', $test, $data[1]); + printf('Testing \'%s\' (%d): ', $test, $data[1]); - proc_nice($data[1]); + proc_nice($data[1]); - print (($wp = get_priority_from_wmic()) === $data[0] ? 'Passed' : 'Failed (' . $wp . ')') . PHP_EOL; + print (($wp = get_priority_from_wmic()) === $data[0] ? 'Passed' : 'Failed (' . $wp . ')') . PHP_EOL; } ?> --EXPECT-- diff --git a/ext/standard/tests/general_functions/proc_nice_basic.phpt b/ext/standard/tests/general_functions/proc_nice_basic.phpt index d14a5f62a9..687152ee10 100644 --- a/ext/standard/tests/general_functions/proc_nice_basic.phpt +++ b/ext/standard/tests/general_functions/proc_nice_basic.phpt @@ -12,21 +12,21 @@ if(substr(strtoupper(PHP_OS), 0, 3) == 'WIN') die('skip. not for Windows'); ?> --FILE-- <?php - function getNice($id) - { - $res = shell_exec('ps -p ' . $id .' -o "pid,nice"'); - preg_match('/^\s*\w+\s+\w+\s*(\d+)\s+(\d+)/m', $res, $matches); - if (count($matches) > 2) - return $matches[2]; - else - return -1; - } - $delta = 10; - $pid = getmypid(); - $niceBefore = getNice($pid); - proc_nice($delta); - $niceAfter = getNice($pid); - var_dump($niceBefore == ($niceAfter - $delta)); + function getNice($id) + { + $res = shell_exec('ps -p ' . $id .' -o "pid,nice"'); + preg_match('/^\s*\w+\s+\w+\s*(\d+)\s+(\d+)/m', $res, $matches); + if (count($matches) > 2) + return $matches[2]; + else + return -1; + } + $delta = 10; + $pid = getmypid(); + $niceBefore = getNice($pid); + proc_nice($delta); + $niceAfter = getNice($pid); + var_dump($niceBefore == ($niceAfter - $delta)); ?> --EXPECT-- bool(true) diff --git a/ext/standard/tests/general_functions/proc_open-mb0.phpt b/ext/standard/tests/general_functions/proc_open-mb0.phpt index 672a8cd357..c97ebda970 100644 --- a/ext/standard/tests/general_functions/proc_open-mb0.phpt +++ b/ext/standard/tests/general_functions/proc_open-mb0.phpt @@ -13,24 +13,24 @@ $f = __DIR__ . DIRECTORY_SEPARATOR . "proc_only_mb0.php"; file_put_contents($f,'<?php var_dump($argv); ?>'); $ds = array( - 0 => array("pipe", "r"), - 1 => array("pipe", "w"), - 2 => array("pipe", "w") - ); + 0 => array("pipe", "r"), + 1 => array("pipe", "w"), + 2 => array("pipe", "w") + ); $p = proc_open( - "$php -n $f テストマルãƒãƒã‚¤ãƒˆãƒ»ãƒ‘ス füße карамба", - $ds, - $pipes, - NULL, - NULL, - array("bypass_shell" => true) - ); + "$php -n $f テストマルãƒãƒã‚¤ãƒˆãƒ»ãƒ‘ス füße карамба", + $ds, + $pipes, + NULL, + NULL, + array("bypass_shell" => true) + ); $out = ""; while (!feof($pipes[1])) { - $out .= fread($pipes[1], 1024); + $out .= fread($pipes[1], 1024); } proc_close($p); diff --git a/ext/standard/tests/general_functions/proc_open-mb1.phpt b/ext/standard/tests/general_functions/proc_open-mb1.phpt index af46346fbb..8a735cf306 100644 --- a/ext/standard/tests/general_functions/proc_open-mb1.phpt +++ b/ext/standard/tests/general_functions/proc_open-mb1.phpt @@ -13,21 +13,21 @@ $f = __DIR__ . DIRECTORY_SEPARATOR . "proc_only_mb1.php"; file_put_contents($f,'<?php var_dump($argv); ?>'); $ds = array( - 0 => array("pipe", "r"), - 1 => array("pipe", "w"), - 2 => array("pipe", "w") - ); + 0 => array("pipe", "r"), + 1 => array("pipe", "w"), + 2 => array("pipe", "w") + ); $p = proc_open( - "$php -n $f テストマルãƒãƒã‚¤ãƒˆãƒ»ãƒ‘ス füße карамба", - $ds, - $pipes - ); + "$php -n $f テストマルãƒãƒã‚¤ãƒˆãƒ»ãƒ‘ス füße карамба", + $ds, + $pipes + ); $out = ""; while (!feof($pipes[1])) { - $out .= fread($pipes[1], 1024); + $out .= fread($pipes[1], 1024); } proc_close($p); diff --git a/ext/standard/tests/general_functions/proc_open.phpt b/ext/standard/tests/general_functions/proc_open.phpt index 4d0a21d165..cf0bffffb5 100644 --- a/ext/standard/tests/general_functions/proc_open.phpt +++ b/ext/standard/tests/general_functions/proc_open.phpt @@ -8,16 +8,16 @@ if (!function_exists("proc_open")) echo "skip proc_open() is not available"; --FILE-- <?php $ds = array( - 0 => array("pipe", "r"), - 1 => array("pipe", "w"), - 2 => array("pipe", "w") - ); + 0 => array("pipe", "r"), + 1 => array("pipe", "w"), + 2 => array("pipe", "w") + ); $cat = proc_open( - "/bin/cat", - $ds, - $pipes - ); + "/bin/cat", + $ds, + $pipes + ); proc_close($cat); diff --git a/ext/standard/tests/general_functions/proc_open02.phpt b/ext/standard/tests/general_functions/proc_open02.phpt index d5d878ed24..a81ce5934f 100644 --- a/ext/standard/tests/general_functions/proc_open02.phpt +++ b/ext/standard/tests/general_functions/proc_open02.phpt @@ -10,9 +10,9 @@ if (getenv('SKIP_SLOW_TESTS')) echo 'skip slow test'; $ds = array(array('pipe', 'r')); $cat = proc_open( - '/bin/sleep 2', - $ds, - $pipes + '/bin/sleep 2', + $ds, + $pipes ); usleep(20000); // let the OS run the sleep process before sending the signal diff --git a/ext/standard/tests/general_functions/proc_open_pipes1.phpt b/ext/standard/tests/general_functions/proc_open_pipes1.phpt index dd0550f7fd..076b8c941e 100644 --- a/ext/standard/tests/general_functions/proc_open_pipes1.phpt +++ b/ext/standard/tests/general_functions/proc_open_pipes1.phpt @@ -4,7 +4,7 @@ proc_open() with > 16 pipes <?php for ($i = 3; $i<= 30; $i++) { - $spec[$i] = array('pipe', 'w'); + $spec[$i] = array('pipe', 'w'); } $php = getenv("TEST_PHP_EXECUTABLE"); diff --git a/ext/standard/tests/general_functions/proc_open_pipes3.phpt b/ext/standard/tests/general_functions/proc_open_pipes3.phpt index 0cb9f03eb8..848850b327 100644 --- a/ext/standard/tests/general_functions/proc_open_pipes3.phpt +++ b/ext/standard/tests/general_functions/proc_open_pipes3.phpt @@ -4,7 +4,7 @@ proc_open() with invalid pipes <?php for ($i = 3; $i<= 5; $i++) { - $spec[$i] = array('pipe', 'w'); + $spec[$i] = array('pipe', 'w'); } $php = getenv("TEST_PHP_EXECUTABLE"); diff --git a/ext/standard/tests/general_functions/sleep_basic.phpt b/ext/standard/tests/general_functions/sleep_basic.phpt index 3c7bcdfc09..4371cc99ed 100644 --- a/ext/standard/tests/general_functions/sleep_basic.phpt +++ b/ext/standard/tests/general_functions/sleep_basic.phpt @@ -32,9 +32,9 @@ echo "Thread slept for " . $time . " seconds\n"; echo "Return value: " . $result . "\n"; if ($time >= $sleeplow) { - echo "TEST PASSED\n"; + echo "TEST PASSED\n"; } else { - echo "TEST FAILED - time is ${time} secs and sleep was ${sleeptime} secs\n"; + echo "TEST FAILED - time is ${time} secs and sleep was ${sleeptime} secs\n"; } ?> --EXPECTF-- diff --git a/ext/standard/tests/general_functions/type.phpt b/ext/standard/tests/general_functions/type.phpt index 342b353baf..a32e4b44a1 100644 --- a/ext/standard/tests/general_functions/type.phpt +++ b/ext/standard/tests/general_functions/type.phpt @@ -4,7 +4,7 @@ gettype(), settype() and friends <?php function foo($errno, $errstr, $errfile, $errline) { - var_dump($errstr); + var_dump($errstr); } set_error_handler("foo"); @@ -17,43 +17,43 @@ $var1 = "another string"; $var2 = array(2,3,4); $array = array( - array(1,2,3), - $var1, - $var2, - 1, - 2.0, - NULL, - false, - "some string", - $fp, - $fp1, - new stdclass, + array(1,2,3), + $var1, + $var2, + 1, + 2.0, + NULL, + false, + "some string", + $fp, + $fp1, + new stdclass, ); $types = array( - "null", - "integer", - "double", - "boolean", - "resource", - "array", - "object", - "string" - ); + "null", + "integer", + "double", + "boolean", + "resource", + "array", + "object", + "string" + ); foreach ($array as $var) { - var_dump(gettype($var)); + var_dump(gettype($var)); } foreach ($types as $type) { - foreach ($array as $var) { - try { - var_dump(settype($var, $type)); - } catch (Error $e) { - echo "Error: ", $e->getMessage(), "\n"; - } - var_dump($var); - } + foreach ($array as $var) { + try { + var_dump(settype($var, $type)); + } catch (Error $e) { + echo "Error: ", $e->getMessage(), "\n"; + } + var_dump($var); + } } echo "Done\n"; diff --git a/ext/standard/tests/general_functions/uniqid_basic.phpt b/ext/standard/tests/general_functions/uniqid_basic.phpt index 66cfdf8f97..6bfc478fad 100644 --- a/ext/standard/tests/general_functions/uniqid_basic.phpt +++ b/ext/standard/tests/general_functions/uniqid_basic.phpt @@ -18,19 +18,19 @@ echo "uniqid() with a prefix\n"; // Use a fixed prefix so we can ensure length of o/p id is fixed $prefix = array ( - 99999, - "99999", - 10.5e2, - null, - true, - false - ); + 99999, + "99999", + 10.5e2, + null, + true, + false + ); for ($i = 0; $i < count($prefix); $i++) { - var_dump(uniqid($prefix[$i])); - var_dump(uniqid($prefix[$i], true)); - var_dump(uniqid($prefix[$i], false)); - echo "\n"; + var_dump(uniqid($prefix[$i])); + var_dump(uniqid($prefix[$i], true)); + var_dump(uniqid($prefix[$i], false)); + echo "\n"; } ?> diff --git a/ext/standard/tests/general_functions/usleep_basic.phpt b/ext/standard/tests/general_functions/usleep_basic.phpt index d057d47c11..c2af61f8a2 100644 --- a/ext/standard/tests/general_functions/usleep_basic.phpt +++ b/ext/standard/tests/general_functions/usleep_basic.phpt @@ -30,9 +30,9 @@ $time = ($time_end - $time_start) * 1000 * 1000; $summary = "Thread slept for " . $time . " micro-seconds\n"; if ($time >= $sleeplow) { - echo "TEST PASSED: $summary"; + echo "TEST PASSED: $summary"; } else { - echo "TEST FAILED: $summary"; + echo "TEST FAILED: $summary"; } ?> --EXPECTF-- diff --git a/ext/standard/tests/general_functions/var_export-locale.phpt b/ext/standard/tests/general_functions/var_export-locale.phpt index 3512006624..bdc61d9928 100644 --- a/ext/standard/tests/general_functions/var_export-locale.phpt +++ b/ext/standard/tests/general_functions/var_export-locale.phpt @@ -58,12 +58,12 @@ $counter++; echo "*** Testing var_export() with valid boolean values ***\n"; // different valid boolean values $valid_bool = array( - 1, - TRUE, + 1, + TRUE, true, 0, - FALSE, - false + FALSE, + false ); $counter = 1; /* Loop to check for above boolean values with var_export() */ diff --git a/ext/standard/tests/general_functions/var_export-locale_32.phpt b/ext/standard/tests/general_functions/var_export-locale_32.phpt index baaddcefae..d64fa3b8d7 100644 --- a/ext/standard/tests/general_functions/var_export-locale_32.phpt +++ b/ext/standard/tests/general_functions/var_export-locale_32.phpt @@ -58,12 +58,12 @@ $counter++; echo "*** Testing var_export() with valid boolean values ***\n"; // different valid boolean values $valid_bool = array( - 1, - TRUE, + 1, + TRUE, true, 0, - FALSE, - false + FALSE, + false ); $counter = 1; /* Loop to check for above boolean values with var_export() */ diff --git a/ext/standard/tests/general_functions/var_export_basic1.phpt b/ext/standard/tests/general_functions/var_export_basic1.phpt index f97fab2396..27c56a7b8f 100644 --- a/ext/standard/tests/general_functions/var_export_basic1.phpt +++ b/ext/standard/tests/general_functions/var_export_basic1.phpt @@ -40,12 +40,12 @@ $valid_ints = array( /* Loop to check for above integer values with var_export() */ echo "\n*** Output for integer values ***\n"; foreach($valid_ints as $key => $int_value) { - echo "\n-- Iteration: $key --\n"; - var_export( $int_value ); - echo "\n"; - var_export( $int_value, FALSE); - echo "\n"; - var_dump( var_export( $int_value, TRUE) ); + echo "\n-- Iteration: $key --\n"; + var_export( $int_value ); + echo "\n"; + var_export( $int_value, FALSE); + echo "\n"; + var_dump( var_export( $int_value, TRUE) ); } ?> diff --git a/ext/standard/tests/general_functions/var_export_basic1_32.phpt b/ext/standard/tests/general_functions/var_export_basic1_32.phpt index 7473fbd8a3..0eb6ce889f 100644 --- a/ext/standard/tests/general_functions/var_export_basic1_32.phpt +++ b/ext/standard/tests/general_functions/var_export_basic1_32.phpt @@ -40,12 +40,12 @@ $valid_ints = array( /* Loop to check for above integer values with var_export() */ echo "\n*** Output for integer values ***\n"; foreach($valid_ints as $key => $int_value) { - echo "\n-- Iteration: $key --\n"; - var_export( $int_value ); - echo "\n"; - var_export( $int_value, FALSE); - echo "\n"; - var_dump( var_export( $int_value, TRUE) ); + echo "\n-- Iteration: $key --\n"; + var_export( $int_value ); + echo "\n"; + var_export( $int_value, FALSE); + echo "\n"; + var_dump( var_export( $int_value, TRUE) ); } ?> diff --git a/ext/standard/tests/general_functions/var_export_basic2.phpt b/ext/standard/tests/general_functions/var_export_basic2.phpt index 87e92f20fd..1698a28001 100644 --- a/ext/standard/tests/general_functions/var_export_basic2.phpt +++ b/ext/standard/tests/general_functions/var_export_basic2.phpt @@ -12,24 +12,24 @@ Test var_export() function with valid boolean values echo "*** Testing var_export() with valid boolean values ***\n"; // different valid boolean values $valid_bool = array( - "1" => 1, - "TRUE" => TRUE, + "1" => 1, + "TRUE" => TRUE, "true" => true, "0" => 0, - "FALSE" => FALSE, - "false" => false + "FALSE" => FALSE, + "false" => false ); /* Loop to check for above boolean values with var_export() */ echo "\n*** Output for boolean values ***\n"; foreach($valid_bool as $key => $bool_value) { - echo "\n-- Iteration: $key --\n"; - var_export( $bool_value ); - echo "\n"; - var_export( $bool_value, FALSE); - echo "\n"; - var_dump( var_export( $bool_value, TRUE) ); - echo "\n"; + echo "\n-- Iteration: $key --\n"; + var_export( $bool_value ); + echo "\n"; + var_export( $bool_value, FALSE); + echo "\n"; + var_dump( var_export( $bool_value, TRUE) ); + echo "\n"; } ?> --EXPECT-- diff --git a/ext/standard/tests/general_functions/var_export_basic3.phpt b/ext/standard/tests/general_functions/var_export_basic3.phpt index 38618faea9..92d5bbbe76 100644 --- a/ext/standard/tests/general_functions/var_export_basic3.phpt +++ b/ext/standard/tests/general_functions/var_export_basic3.phpt @@ -13,37 +13,37 @@ serialize_precision=17 echo "*** Testing var_export() with valid float values ***\n"; // different valid float values $valid_floats = array( - "-2147483649" => (float)-2147483649, // float value - "2147483648" => (float)2147483648, // float value - "-0x80000001" => (float)-0x80000001, // float value, beyond max negative int - "0x800000001" => (float)0x800000001, // float value, beyond max positive int - "020000000001" => (float)020000000001, // float value, beyond max positive int - "-020000000001" => (float)-020000000001, // float value, beyond max negative int - "0.0" => 0.0, - "-0.1" => -0.1, - "10.0000000000000000005" => 10.0000000000000000005, - "10.5e+5" => 10.5e+5, - "1e5" => 1e5, - "1e-5" => 1e-5, - "1e+5" => 1e+5, - "1E5" => 1E5, - "1E+5" => 1E+5, - "1E-5" => 1E-5, - ".5e+7" => .5e+7, - ".6e-19" => .6e-19, - ".05E+44" => .05E+44, - ".0034E-30" => .0034E-30 + "-2147483649" => (float)-2147483649, // float value + "2147483648" => (float)2147483648, // float value + "-0x80000001" => (float)-0x80000001, // float value, beyond max negative int + "0x800000001" => (float)0x800000001, // float value, beyond max positive int + "020000000001" => (float)020000000001, // float value, beyond max positive int + "-020000000001" => (float)-020000000001, // float value, beyond max negative int + "0.0" => 0.0, + "-0.1" => -0.1, + "10.0000000000000000005" => 10.0000000000000000005, + "10.5e+5" => 10.5e+5, + "1e5" => 1e5, + "1e-5" => 1e-5, + "1e+5" => 1e+5, + "1E5" => 1E5, + "1E+5" => 1E+5, + "1E-5" => 1E-5, + ".5e+7" => .5e+7, + ".6e-19" => .6e-19, + ".05E+44" => .05E+44, + ".0034E-30" => .0034E-30 ); /* Loop to check for above float values with var_export() */ echo "\n*** Output for float values ***\n"; foreach($valid_floats as $key => $float_value) { - echo "\n-- Iteration: $key --\n"; - var_export( $float_value ); - echo "\n"; - var_export( $float_value, FALSE); - echo "\n"; - var_dump( var_export( $float_value, TRUE) ); - echo "\n"; + echo "\n-- Iteration: $key --\n"; + var_export( $float_value ); + echo "\n"; + var_export( $float_value, FALSE); + echo "\n"; + var_dump( var_export( $float_value, TRUE) ); + echo "\n"; } ?> diff --git a/ext/standard/tests/general_functions/var_export_basic4.phpt b/ext/standard/tests/general_functions/var_export_basic4.phpt index c1b7b8cb5b..789140d255 100644 --- a/ext/standard/tests/general_functions/var_export_basic4.phpt +++ b/ext/standard/tests/general_functions/var_export_basic4.phpt @@ -33,13 +33,13 @@ $valid_strings = array( /* Loop to check for above strings with var_export() */ echo "\n*** Output for strings ***\n"; foreach($valid_strings as $key => $str) { - echo "\n-- Iteration: $key --\n"; - var_export( $str ); - echo "\n"; - var_export( $str, FALSE); - echo "\n"; - var_dump( var_export( $str, TRUE) ); - echo "\n"; + echo "\n-- Iteration: $key --\n"; + var_export( $str ); + echo "\n"; + var_export( $str, FALSE); + echo "\n"; + var_dump( var_export( $str, TRUE) ); + echo "\n"; } ?> diff --git a/ext/standard/tests/general_functions/var_export_basic5.phpt b/ext/standard/tests/general_functions/var_export_basic5.phpt index 989197a23d..731e84ff99 100644 --- a/ext/standard/tests/general_functions/var_export_basic5.phpt +++ b/ext/standard/tests/general_functions/var_export_basic5.phpt @@ -34,13 +34,13 @@ $valid_arrays = array( /* Loop to check for above arrays with var_export() */ echo "\n*** Output for arrays ***\n"; foreach($valid_arrays as $key => $arr) { - echo "\n--Iteration: $key --\n"; - var_export( $arr ); - echo "\n"; - var_export( $arr, FALSE); - echo "\n"; - var_dump( var_export( $arr, TRUE) ); - echo "\n"; + echo "\n--Iteration: $key --\n"; + var_export( $arr ); + echo "\n"; + var_export( $arr, FALSE); + echo "\n"; + var_dump( var_export( $arr, TRUE) ); + echo "\n"; } ?> --EXPECT-- diff --git a/ext/standard/tests/general_functions/var_export_basic6.phpt b/ext/standard/tests/general_functions/var_export_basic6.phpt index a120f2fd1a..4d09f0a794 100644 --- a/ext/standard/tests/general_functions/var_export_basic6.phpt +++ b/ext/standard/tests/general_functions/var_export_basic6.phpt @@ -92,13 +92,13 @@ $valid_objects = array( /* Loop to check for above objects with var_export() */ echo "\n*** Output for objects ***\n"; foreach($valid_objects as $key => $obj) { - echo "\n-- Iteration: $key --\n"; - var_export( $obj ); - echo "\n"; - var_export( $obj, FALSE); - echo "\n"; - var_dump( var_export( $obj, TRUE) ); - echo "\n"; + echo "\n-- Iteration: $key --\n"; + var_export( $obj ); + echo "\n"; + var_export( $obj, FALSE); + echo "\n"; + var_dump( var_export( $obj, TRUE) ); + echo "\n"; } ?> --EXPECT-- diff --git a/ext/standard/tests/general_functions/var_export_basic7.phpt b/ext/standard/tests/general_functions/var_export_basic7.phpt index 928721b926..f9a68f0f13 100644 --- a/ext/standard/tests/general_functions/var_export_basic7.phpt +++ b/ext/standard/tests/general_functions/var_export_basic7.phpt @@ -24,13 +24,13 @@ $valid_nulls = array( /* Loop to check for above null values with var_export() */ echo "\n*** Output for null values ***\n"; foreach($valid_nulls as $key => $null_value) { - echo "\n-- Iteration: $key --\n"; - var_export( $null_value ); - echo "\n"; - var_export( $null_value, FALSE); - echo "\n"; - var_dump( var_export( $null_value, true) ); - echo "\n"; + echo "\n-- Iteration: $key --\n"; + var_export( $null_value ); + echo "\n"; + var_export( $null_value, FALSE); + echo "\n"; + var_dump( var_export( $null_value, true) ); + echo "\n"; } ?> --EXPECT-- diff --git a/ext/standard/tests/general_functions/var_export_basic9.phpt b/ext/standard/tests/general_functions/var_export_basic9.phpt index fd78c18c8e..26815bec1b 100644 --- a/ext/standard/tests/general_functions/var_export_basic9.phpt +++ b/ext/standard/tests/general_functions/var_export_basic9.phpt @@ -2,9 +2,9 @@ Bug #55082: var_export() doesn't escape properties properly --FILE-- <?php - $x = new stdClass(); - $x->{'\'\\'} = 7; - echo var_export($x); + $x = new stdClass(); + $x->{'\'\\'} = 7; + echo var_export($x); --EXPECT-- (object) array( '\'\\' => 7, diff --git a/ext/standard/tests/hrtime/hrtime.phpt b/ext/standard/tests/hrtime/hrtime.phpt index bac127bf44..9cd31435b8 100644 --- a/ext/standard/tests/hrtime/hrtime.phpt +++ b/ext/standard/tests/hrtime/hrtime.phpt @@ -16,9 +16,9 @@ $d1 = $h1 - $h0; $d = abs($d0 - $d1)/$d1; if ($d > 0.05) { - print "FAIL, $d"; + print "FAIL, $d"; } else { - print "OK, $d"; + print "OK, $d"; } ?> diff --git a/ext/standard/tests/http/bug38802.phpt b/ext/standard/tests/http/bug38802.phpt index 53a607655d..77fa16b5e4 100644 --- a/ext/standard/tests/http/bug38802.phpt +++ b/ext/standard/tests/http/bug38802.phpt @@ -10,31 +10,31 @@ require 'server.inc'; function do_test($context_options) { - $context = stream_context_create(array('http' => $context_options)); + $context = stream_context_create(array('http' => $context_options)); - $responses = array( - "data://text/plain,HTTP/1.0 302 Moved Temporarily\r\nLocation: http://127.0.0.1:12342/foo/bar2\r\n\r\n1", - "data://text/plain,HTTP/1.0 301 Moved Permanently\r\nLocation: http://127.0.0.1:12342/foo/bar3\r\n\r\n", - "data://text/plain,HTTP/1.0 302 Moved Temporarily\r\nLocation: http://127.0.0.1:12342/foo/bar4\r\n\r\n3", - "data://text/plain,HTTP/1.0 200 OK\r\n\r\ndone.", - ); + $responses = array( + "data://text/plain,HTTP/1.0 302 Moved Temporarily\r\nLocation: http://127.0.0.1:12342/foo/bar2\r\n\r\n1", + "data://text/plain,HTTP/1.0 301 Moved Permanently\r\nLocation: http://127.0.0.1:12342/foo/bar3\r\n\r\n", + "data://text/plain,HTTP/1.0 302 Moved Temporarily\r\nLocation: http://127.0.0.1:12342/foo/bar4\r\n\r\n3", + "data://text/plain,HTTP/1.0 200 OK\r\n\r\ndone.", + ); - $pid = http_server("tcp://127.0.0.1:12342", $responses, $output); + $pid = http_server("tcp://127.0.0.1:12342", $responses, $output); - $fd = fopen('http://127.0.0.1:12342/foo/bar', 'rb', false, $context); - var_dump($fd); + $fd = fopen('http://127.0.0.1:12342/foo/bar', 'rb', false, $context); + var_dump($fd); - if ($fd) { - $meta_data = stream_get_meta_data($fd); - var_dump($meta_data['wrapper_data']); + if ($fd) { + $meta_data = stream_get_meta_data($fd); + var_dump($meta_data['wrapper_data']); - var_dump(stream_get_contents($fd)); - } + var_dump(stream_get_contents($fd)); + } - fseek($output, 0, SEEK_SET); - var_dump(stream_get_contents($output)); + fseek($output, 0, SEEK_SET); + var_dump(stream_get_contents($output)); - http_server_kill($pid); + http_server_kill($pid); } echo "-- Test: follow all redirections --\n"; diff --git a/ext/standard/tests/http/bug43510.phpt b/ext/standard/tests/http/bug43510.phpt index d973612372..45ba4fb20f 100644 --- a/ext/standard/tests/http/bug43510.phpt +++ b/ext/standard/tests/http/bug43510.phpt @@ -9,17 +9,17 @@ allow_url_fopen=1 require 'server.inc'; $responses = array( - "data://text/plain,HTTP/1.0 200 OK\r\n\r\n", - "data://text/plain,HTTP/1.0 200 OK\r\n\r\n", + "data://text/plain,HTTP/1.0 200 OK\r\n\r\n", + "data://text/plain,HTTP/1.0 200 OK\r\n\r\n", ); $pid = http_server("tcp://127.0.0.1:12342", $responses, $output); foreach(array('r', 'rb') as $mode) { - $fd = fopen('http://127.0.0.1:12342/', $mode, false); - $meta = stream_get_meta_data($fd); - var_dump($meta['mode']); - fclose($fd); + $fd = fopen('http://127.0.0.1:12342/', $mode, false); + $meta = stream_get_meta_data($fd); + var_dump($meta['mode']); + fclose($fd); } http_server_kill($pid); diff --git a/ext/standard/tests/http/bug47021.phpt b/ext/standard/tests/http/bug47021.phpt index f3db3e1be2..b3acd1bc3a 100644 --- a/ext/standard/tests/http/bug47021.phpt +++ b/ext/standard/tests/http/bug47021.phpt @@ -13,7 +13,7 @@ function stream_notification_callback($notification_code, $severity, $message, $ switch($notification_code) { case STREAM_NOTIFY_MIME_TYPE_IS: echo "Type='$message'\n"; - break; + break; case STREAM_NOTIFY_FILE_SIZE_IS: echo "Size=$bytes_max\n"; break; diff --git a/ext/standard/tests/http/bug48929.phpt b/ext/standard/tests/http/bug48929.phpt index b31ed292be..9a769d8674 100644 --- a/ext/standard/tests/http/bug48929.phpt +++ b/ext/standard/tests/http/bug48929.phpt @@ -10,24 +10,24 @@ require 'server.inc'; function do_test($context_options) { - $context = stream_context_create(array('http' => $context_options)); + $context = stream_context_create(array('http' => $context_options)); - $responses = array( - "data://text/plain,HTTP/1.0 200 OK\r\n\r\n", - ); + $responses = array( + "data://text/plain,HTTP/1.0 200 OK\r\n\r\n", + ); - $pid = http_server("tcp://127.0.0.1:12342", $responses, $output); + $pid = http_server("tcp://127.0.0.1:12342", $responses, $output); - foreach($responses as $r) { + foreach($responses as $r) { - $fd = fopen('http://127.0.0.1:12342/', 'rb', false, $context); + $fd = fopen('http://127.0.0.1:12342/', 'rb', false, $context); - fseek($output, 0, SEEK_SET); - var_dump(stream_get_contents($output)); - fseek($output, 0, SEEK_SET); - } + fseek($output, 0, SEEK_SET); + var_dump(stream_get_contents($output)); + fseek($output, 0, SEEK_SET); + } - http_server_kill($pid); + http_server_kill($pid); } echo "-- Test: requests with 'header' as array --\n"; diff --git a/ext/standard/tests/http/bug53198.phpt b/ext/standard/tests/http/bug53198.phpt index 2585c3df6e..add07c3f47 100644 --- a/ext/standard/tests/http/bug53198.phpt +++ b/ext/standard/tests/http/bug53198.phpt @@ -11,22 +11,22 @@ require 'server.inc'; function do_test() { - $responses = array( - "data://text/plain,HTTP/1.0 200 OK\r\n\r\n", - ); + $responses = array( + "data://text/plain,HTTP/1.0 200 OK\r\n\r\n", + ); - $pid = http_server("tcp://127.0.0.1:12342", $responses, $output); + $pid = http_server("tcp://127.0.0.1:12342", $responses, $output); - foreach($responses as $r) { + foreach($responses as $r) { - $fd = fopen('http://127.0.0.1:12342/', 'rb', false); + $fd = fopen('http://127.0.0.1:12342/', 'rb', false); - fseek($output, 0, SEEK_SET); - var_dump(stream_get_contents($output)); - fseek($output, 0, SEEK_SET); - } + fseek($output, 0, SEEK_SET); + var_dump(stream_get_contents($output)); + fseek($output, 0, SEEK_SET); + } - http_server_kill($pid); + http_server_kill($pid); } diff --git a/ext/standard/tests/http/bug60570.phpt b/ext/standard/tests/http/bug60570.phpt index b72011d5e2..3c16d78033 100644 --- a/ext/standard/tests/http/bug60570.phpt +++ b/ext/standard/tests/http/bug60570.phpt @@ -10,30 +10,30 @@ require 'server.inc'; function do_test() { - $responses = array( - "data://text/plain,HTTP/1.0 404 Not Found\r\n\r\n", - "data://text/plain,HTTP/1.0 404 Not Found\r\n\r\n", - "data://text/plain,HTTP/1.0 404 Not Found\r\n\r\n" - ); + $responses = array( + "data://text/plain,HTTP/1.0 404 Not Found\r\n\r\n", + "data://text/plain,HTTP/1.0 404 Not Found\r\n\r\n", + "data://text/plain,HTTP/1.0 404 Not Found\r\n\r\n" + ); - $pid = http_server("tcp://127.0.0.1:12342", $responses, $output); + $pid = http_server("tcp://127.0.0.1:12342", $responses, $output); - $a = $b = count(get_resources()); + $a = $b = count(get_resources()); - $i = 3; - while ($i--) { - $context = stream_context_create(array('http'=>array('timeout'=>1))); - file_get_contents('http://127.0.0.1:12342/', 0, $context); - unset($context); + $i = 3; + while ($i--) { + $context = stream_context_create(array('http'=>array('timeout'=>1))); + file_get_contents('http://127.0.0.1:12342/', 0, $context); + unset($context); - $b = $a; - $a = count(get_resources()); - } + $b = $a; + $a = count(get_resources()); + } - http_server_kill($pid); + http_server_kill($pid); - echo "leak? penultimate iteration: $b, last one: $a\n"; - var_dump($a == $b); + echo "leak? penultimate iteration: $b, last one: $a\n"; + var_dump($a == $b); } do_test(); diff --git a/ext/standard/tests/http/bug61548.phpt b/ext/standard/tests/http/bug61548.phpt index 38b2bbf086..04ea55341b 100644 --- a/ext/standard/tests/http/bug61548.phpt +++ b/ext/standard/tests/http/bug61548.phpt @@ -11,8 +11,8 @@ require 'server.inc'; function do_test($header) { $options = [ 'http' => [ - 'method' => 'POST', - 'header' => $header, + 'method' => 'POST', + 'header' => $header, 'follow_location' => true, ], ]; @@ -20,9 +20,9 @@ function do_test($header) { $ctx = stream_context_create($options); $responses = [ - "data://text/plain,HTTP/1.1 201\r\nLocation: /foo\r\n\r\n", - "data://text/plain,HTTP/1.1 200\r\nConnection: close\r\n\r\n", - ]; + "data://text/plain,HTTP/1.1 201\r\nLocation: /foo\r\n\r\n", + "data://text/plain,HTTP/1.1 200\r\nConnection: close\r\n\r\n", + ]; $pid = http_server('tcp://127.0.0.1:12342', $responses, $output); $fd = fopen('http://127.0.0.1:12342/', 'rb', false, $ctx); diff --git a/ext/standard/tests/http/bug69337.phpt b/ext/standard/tests/http/bug69337.phpt index c9c2a199dd..7136ff474d 100644 --- a/ext/standard/tests/http/bug69337.phpt +++ b/ext/standard/tests/http/bug69337.phpt @@ -10,8 +10,8 @@ require 'server.inc'; function stream_notification_callback($notification_code, $severity, $message, $message_code, $bytes_transferred, $bytes_max) { - if($notification_code == STREAM_NOTIFY_REDIRECTED) { - // $http_response_header is now a string, but will be used as an array + if($notification_code == STREAM_NOTIFY_REDIRECTED) { + // $http_response_header is now a string, but will be used as an array // by php_stream_url_wrap_http_ex() later on $GLOBALS['http_response_header'] = "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\0\0\0\0"; } @@ -21,8 +21,8 @@ $ctx = stream_context_create(); stream_context_set_params($ctx, array("notification" => "stream_notification_callback")); $responses = array( - "data://text/plain,HTTP/1.0 302 Found\r\nLocation: http://127.0.0.1:22345/try-again\r\n\r\n", - "data://text/plain,HTTP/1.0 404 Not Found\r\n\r\n", + "data://text/plain,HTTP/1.0 302 Found\r\nLocation: http://127.0.0.1:22345/try-again\r\n\r\n", + "data://text/plain,HTTP/1.0 404 Not Found\r\n\r\n", ); $pid = http_server("tcp://127.0.0.1:22345", $responses, $output); diff --git a/ext/standard/tests/http/bug75535.phpt b/ext/standard/tests/http/bug75535.phpt index 57a75a3ee5..236a96820c 100644 --- a/ext/standard/tests/http/bug75535.phpt +++ b/ext/standard/tests/http/bug75535.phpt @@ -9,7 +9,7 @@ allow_url_fopen=1 require 'server.inc'; $responses = array( - "data://text/plain,HTTP/1.0 200 Ok\r\nContent-Length\r\n", + "data://text/plain,HTTP/1.0 200 Ok\r\nContent-Length\r\n", ); $pid = http_server("tcp://127.0.0.1:22351", $responses, $output); diff --git a/ext/standard/tests/http/bug75981.phpt b/ext/standard/tests/http/bug75981.phpt index d415de66b9..52a560cfbc 100644 --- a/ext/standard/tests/http/bug75981.phpt +++ b/ext/standard/tests/http/bug75981.phpt @@ -18,7 +18,7 @@ $options = [ $ctx = stream_context_create($options); $responses = [ - "data://text/plain,000000000100\xA\xA" + "data://text/plain,000000000100\xA\xA" ]; $pid = http_server('tcp://127.0.0.1:12342', $responses); diff --git a/ext/standard/tests/http/http_response_header_01.phpt b/ext/standard/tests/http/http_response_header_01.phpt index 9772c09b02..05037f24b1 100644 --- a/ext/standard/tests/http/http_response_header_01.phpt +++ b/ext/standard/tests/http/http_response_header_01.phpt @@ -9,7 +9,7 @@ allow_url_fopen=1 require 'server.inc'; $responses = array( - "data://text/plain,HTTP/1.0 200 Ok\r\nSome: Header\r\nSome: Header\r\n\r\nBody", + "data://text/plain,HTTP/1.0 200 Ok\r\nSome: Header\r\nSome: Header\r\n\r\nBody", ); $pid = http_server("tcp://127.0.0.1:22346", $responses, $output); diff --git a/ext/standard/tests/http/http_response_header_02.phpt b/ext/standard/tests/http/http_response_header_02.phpt index 0868672b01..873a8621a5 100644 --- a/ext/standard/tests/http/http_response_header_02.phpt +++ b/ext/standard/tests/http/http_response_header_02.phpt @@ -9,7 +9,7 @@ allow_url_fopen=1 require 'server.inc'; $responses = array( - "data://text/plain,HTTP/1.0 302 Found\r\n" + "data://text/plain,HTTP/1.0 302 Found\r\n" . "Some: Header\r\nLocation: http://127.0.0.1:22347/try-again\r\n\r\n", "data://test/plain,HTTP/1.0 200 Ok\r\nSome: Header\r\n\r\nBody", ); diff --git a/ext/standard/tests/http/http_response_header_03.phpt b/ext/standard/tests/http/http_response_header_03.phpt index 1b743259ad..832382de23 100644 --- a/ext/standard/tests/http/http_response_header_03.phpt +++ b/ext/standard/tests/http/http_response_header_03.phpt @@ -9,7 +9,7 @@ allow_url_fopen=1 require 'server.inc'; $responses = array( - "data://text/plain,HTTP/1.0 302 Found\r\n" + "data://text/plain,HTTP/1.0 302 Found\r\n" . "Some: Header\r\nLocation: http://127.0.0.1:22348/try-again\r\n\r\n", "data://test/plain,HTTP/1.0 404 Not Found\r\nSome: Header\r\n\r\nBody", ); diff --git a/ext/standard/tests/http/http_response_header_04.phpt b/ext/standard/tests/http/http_response_header_04.phpt index 0d518327aa..89a4d466fd 100644 --- a/ext/standard/tests/http/http_response_header_04.phpt +++ b/ext/standard/tests/http/http_response_header_04.phpt @@ -9,7 +9,7 @@ allow_url_fopen=1 require 'server.inc'; $responses = array( - "data://text/plain,HTTP/1.0 200 Ok\r\nSome: Header \r\n\r\nBody", + "data://text/plain,HTTP/1.0 200 Ok\r\nSome: Header \r\n\r\nBody", ); $pid = http_server("tcp://127.0.0.1:22349", $responses, $output); diff --git a/ext/standard/tests/http/http_response_header_05.phpt b/ext/standard/tests/http/http_response_header_05.phpt index 97c275413d..372de1163d 100644 --- a/ext/standard/tests/http/http_response_header_05.phpt +++ b/ext/standard/tests/http/http_response_header_05.phpt @@ -9,7 +9,7 @@ allow_url_fopen=1 require 'server.inc'; $responses = array( - "data://text/plain,HTTP/1.0 200 Ok\r\n \r\n\r\nBody", + "data://text/plain,HTTP/1.0 200 Ok\r\n \r\n\r\nBody", ); $pid = http_server("tcp://127.0.0.1:22350", $responses, $output); diff --git a/ext/standard/tests/http/ignore_errors.phpt b/ext/standard/tests/http/ignore_errors.phpt index 176d6dd2ce..38a1cf6985 100644 --- a/ext/standard/tests/http/ignore_errors.phpt +++ b/ext/standard/tests/http/ignore_errors.phpt @@ -10,33 +10,33 @@ require 'server.inc'; function do_test($context_options) { - $context = stream_context_create(array('http' => $context_options)); + $context = stream_context_create(array('http' => $context_options)); - $responses = array( - "data://text/plain,HTTP/1.0 200 Ok\r\nX-Foo: bar\r\n\r\n1", - "data://text/plain,HTTP/1.0 404 Not found\r\nX-bar: baz\r\n\r\n2", - ); + $responses = array( + "data://text/plain,HTTP/1.0 200 Ok\r\nX-Foo: bar\r\n\r\n1", + "data://text/plain,HTTP/1.0 404 Not found\r\nX-bar: baz\r\n\r\n2", + ); - $pid = http_server("tcp://127.0.0.1:12342", $responses, $output); + $pid = http_server("tcp://127.0.0.1:12342", $responses, $output); - foreach($responses as $r) { + foreach($responses as $r) { - $fd = fopen('http://127.0.0.1:12342/foo/bar', 'rb', false, $context); - var_dump($fd); + $fd = fopen('http://127.0.0.1:12342/foo/bar', 'rb', false, $context); + var_dump($fd); - if ($fd) { - $meta_data = stream_get_meta_data($fd); - var_dump($meta_data['wrapper_data']); + if ($fd) { + $meta_data = stream_get_meta_data($fd); + var_dump($meta_data['wrapper_data']); - var_dump(stream_get_contents($fd)); - } + var_dump(stream_get_contents($fd)); + } - fseek($output, 0, SEEK_SET); - var_dump(stream_get_contents($output)); - fseek($output, 0, SEEK_SET); - } + fseek($output, 0, SEEK_SET); + var_dump(stream_get_contents($output)); + fseek($output, 0, SEEK_SET); + } - http_server_kill($pid); + http_server_kill($pid); } echo "-- Test: requests without ignore_errors --\n"; diff --git a/ext/standard/tests/http/server.inc b/ext/standard/tests/http/server.inc index e580674928..81cc131a8a 100644 --- a/ext/standard/tests/http/server.inc +++ b/ext/standard/tests/http/server.inc @@ -2,34 +2,34 @@ function http_server_skipif($socket_string) { - if (!function_exists('pcntl_fork')) die('skip pcntl_fork() not available'); - if (!function_exists('posix_kill')) die('skip posix_kill() not available'); - if (!stream_socket_server($socket_string)) die('skip stream_socket_server() failed'); + if (!function_exists('pcntl_fork')) die('skip pcntl_fork() not available'); + if (!function_exists('posix_kill')) die('skip posix_kill() not available'); + if (!stream_socket_server($socket_string)) die('skip stream_socket_server() failed'); } function http_server_init($socket_string, &$output = null) { - pcntl_alarm(60); - - $server = stream_socket_server($socket_string, $errno, $errstr); - if (!$server) { - return false; - } - - if ($output === null) { - $output = tmpfile(); - if ($output === false) { - return false; - } - } - - $pid = pcntl_fork(); - if ($pid == -1) { - die('could not fork'); - } else if ($pid) { - return $pid; - } - - return $server; + pcntl_alarm(60); + + $server = stream_socket_server($socket_string, $errno, $errstr); + if (!$server) { + return false; + } + + if ($output === null) { + $output = tmpfile(); + if ($output === false) { + return false; + } + } + + $pid = pcntl_fork(); + if ($pid == -1) { + die('could not fork'); + } else if ($pid) { + return $pid; + } + + return $server; } /* Minimal HTTP server with predefined responses. @@ -40,79 +40,79 @@ function http_server_init($socket_string, &$output = null) { */ function http_server($socket_string, array $files, &$output = null) { - if (!is_resource($server = http_server_init($socket_string, $output))) { - return $server; - } + if (!is_resource($server = http_server_init($socket_string, $output))) { + return $server; + } - foreach($files as $file) { + foreach($files as $file) { - $sock = stream_socket_accept($server); - if (!$sock) { - exit(1); - } + $sock = stream_socket_accept($server); + if (!$sock) { + exit(1); + } - // read headers + // read headers - $content_length = 0; + $content_length = 0; - stream_set_blocking($sock, 0); - while (!feof($sock)) { + stream_set_blocking($sock, 0); + while (!feof($sock)) { - list($r, $w, $e) = array(array($sock), null, null); - if (!stream_select($r, $w, $e, 1)) continue; + list($r, $w, $e) = array(array($sock), null, null); + if (!stream_select($r, $w, $e, 1)) continue; - $line = stream_get_line($sock, 8192, "\r\n"); - if ($line === '') { - fwrite($output, "\r\n"); - break; - } else if ($line !== false) { - fwrite($output, "$line\r\n"); + $line = stream_get_line($sock, 8192, "\r\n"); + if ($line === '') { + fwrite($output, "\r\n"); + break; + } else if ($line !== false) { + fwrite($output, "$line\r\n"); - if (preg_match('#^Content-Length\s*:\s*([[:digit:]]+)\s*$#i', $line, $matches)) { - $content_length = (int) $matches[1]; - } - } - } - stream_set_blocking($sock, 1); + if (preg_match('#^Content-Length\s*:\s*([[:digit:]]+)\s*$#i', $line, $matches)) { + $content_length = (int) $matches[1]; + } + } + } + stream_set_blocking($sock, 1); - // read content + // read content - if ($content_length > 0) { - stream_copy_to_stream($sock, $output, $content_length); - } + if ($content_length > 0) { + stream_copy_to_stream($sock, $output, $content_length); + } - // send response + // send response - $fd = fopen($file, 'rb'); - stream_copy_to_stream($fd, $sock); + $fd = fopen($file, 'rb'); + stream_copy_to_stream($fd, $sock); - fclose($sock); - } + fclose($sock); + } - exit(0); + exit(0); } function http_server_sleep($socket_string, $micro_seconds = 500000) { - if (!is_resource($server = http_server_init($socket_string, $output))) { - return $server; - } + if (!is_resource($server = http_server_init($socket_string, $output))) { + return $server; + } - $sock = stream_socket_accept($server); - if (!$sock) { - exit(1); - } + $sock = stream_socket_accept($server); + if (!$sock) { + exit(1); + } - usleep($micro_seconds); + usleep($micro_seconds); - fclose($sock); + fclose($sock); - exit(0); + exit(0); } function http_server_kill($pid) { - posix_kill($pid, SIGTERM); - pcntl_waitpid($pid, $status); + posix_kill($pid, SIGTERM); + pcntl_waitpid($pid, $status); } ?> diff --git a/ext/standard/tests/image/getimagesize.phpt b/ext/standard/tests/image/getimagesize.phpt index db8213b7dc..ed32ac7c0e 100644 --- a/ext/standard/tests/image/getimagesize.phpt +++ b/ext/standard/tests/image/getimagesize.phpt @@ -6,21 +6,21 @@ GetImageSize() ?> --FILE-- <?php - // Note: SWC requires zlib - $dir = opendir(__DIR__) or die('cannot open directory: '.__DIR__); - $result = array(); - $files = array(); - while (($file = readdir($dir)) !== FALSE) { - if (preg_match('/^test.+pix\./',$file) && $file != "test13pix.swf") { - $files[] = $file; - } - } - closedir($dir); - sort($files); - foreach($files as $file) { - $result[$file] = getimagesize(__DIR__."/$file"); - } - var_dump($result); + // Note: SWC requires zlib + $dir = opendir(__DIR__) or die('cannot open directory: '.__DIR__); + $result = array(); + $files = array(); + while (($file = readdir($dir)) !== FALSE) { + if (preg_match('/^test.+pix\./',$file) && $file != "test13pix.swf") { + $files[] = $file; + } + } + closedir($dir); + sort($files); + foreach($files as $file) { + $result[$file] = getimagesize(__DIR__."/$file"); + } + var_dump($result); ?> --EXPECT-- array(16) { diff --git a/ext/standard/tests/image/getimagesize_246x247.phpt b/ext/standard/tests/image/getimagesize_246x247.phpt index 5908671f1c..0e1290fcf2 100644 --- a/ext/standard/tests/image/getimagesize_246x247.phpt +++ b/ext/standard/tests/image/getimagesize_246x247.phpt @@ -6,21 +6,21 @@ GetImageSize() with 246x247 pixels ?> --FILE-- <?php - // Note: SWC requires zlib - $dir = opendir(__DIR__) or die('cannot open directory: '.__DIR__); - $result = array(); - $files = array(); - while (($file = readdir($dir)) !== FALSE) { - if (preg_match('/^246x247\./',$file)) { - $files[] = $file; - } - } - closedir($dir); - sort($files); - foreach($files as $file) { - $result[$file] = getimagesize(__DIR__."/$file"); - } - var_dump($result); + // Note: SWC requires zlib + $dir = opendir(__DIR__) or die('cannot open directory: '.__DIR__); + $result = array(); + $files = array(); + while (($file = readdir($dir)) !== FALSE) { + if (preg_match('/^246x247\./',$file)) { + $files[] = $file; + } + } + closedir($dir); + sort($files); + foreach($files as $file) { + $result[$file] = getimagesize(__DIR__."/$file"); + } + var_dump($result); ?> --EXPECT-- array(1) { diff --git a/ext/standard/tests/image/getimagesize_384x385.phpt b/ext/standard/tests/image/getimagesize_384x385.phpt index 9ed1104220..cef9d73b3f 100644 --- a/ext/standard/tests/image/getimagesize_384x385.phpt +++ b/ext/standard/tests/image/getimagesize_384x385.phpt @@ -6,21 +6,21 @@ GetImageSize() with 384x385 pixels ?> --FILE-- <?php - // Note: SWC requires zlib - $dir = opendir(__DIR__) or die('cannot open directory: '.__DIR__); - $result = array(); - $files = array(); - while (($file = readdir($dir)) !== FALSE) { - if (preg_match('/^384x385\./',$file)) { - $files[] = $file; - } - } - closedir($dir); - sort($files); - foreach($files as $file) { - $result[$file] = getimagesize(__DIR__."/$file"); - } - var_dump($result); + // Note: SWC requires zlib + $dir = opendir(__DIR__) or die('cannot open directory: '.__DIR__); + $result = array(); + $files = array(); + while (($file = readdir($dir)) !== FALSE) { + if (preg_match('/^384x385\./',$file)) { + $files[] = $file; + } + } + closedir($dir); + sort($files); + foreach($files as $file) { + $result[$file] = getimagesize(__DIR__."/$file"); + } + var_dump($result); ?> --EXPECT-- array(1) { diff --git a/ext/standard/tests/image/getimagesize_jpgapp.phpt b/ext/standard/tests/image/getimagesize_jpgapp.phpt index 74fd4e57d7..b4c6413a08 100644 --- a/ext/standard/tests/image/getimagesize_jpgapp.phpt +++ b/ext/standard/tests/image/getimagesize_jpgapp.phpt @@ -19,7 +19,7 @@ $arr['APP1'] = "and this too"; getimagesize( __DIR__."/testAPP.jpg", $arr); foreach ($arr as $key => $value) { - echo "$key - length: ". strlen($value) ."; md5: " . md5($value) . "\n" ; + echo "$key - length: ". strlen($value) ."; md5: " . md5($value) . "\n" ; } ?> diff --git a/ext/standard/tests/image/getimagesize_swc.phpt b/ext/standard/tests/image/getimagesize_swc.phpt index 5e79a5d0a2..bba67d4f09 100644 --- a/ext/standard/tests/image/getimagesize_swc.phpt +++ b/ext/standard/tests/image/getimagesize_swc.phpt @@ -8,7 +8,7 @@ GetImageSize() for compressed swf files ?> --FILE-- <?php - var_dump(getimagesize(__DIR__ . "/test13pix.swf")); + var_dump(getimagesize(__DIR__ . "/test13pix.swf")); ?> --EXPECT-- array(5) { diff --git a/ext/standard/tests/image/getimagesize_variation2.phpt b/ext/standard/tests/image/getimagesize_variation2.phpt index 6419881abc..7799303c62 100644 --- a/ext/standard/tests/image/getimagesize_variation2.phpt +++ b/ext/standard/tests/image/getimagesize_variation2.phpt @@ -9,7 +9,7 @@ Test getimagesize() function : usage variations - unexpected type for arg 2 */ function test_error_handler($err_no, $err_msg, $filename, $linenum) { - echo "Error: $err_no - $err_msg\n"; + echo "Error: $err_no - $err_msg\n"; } set_error_handler('test_error_handler'); diff --git a/ext/standard/tests/image/getimagesize_variation3.phpt b/ext/standard/tests/image/getimagesize_variation3.phpt index f65869af9e..b50e822d70 100644 --- a/ext/standard/tests/image/getimagesize_variation3.phpt +++ b/ext/standard/tests/image/getimagesize_variation3.phpt @@ -10,10 +10,10 @@ Test getimagesize() function : variation - Passing non image files $file_types_array = array ( //File containing text string - "File with text data" => "test.txt", + "File with text data" => "test.txt", - //File containing forcibly corrupted bmp image - "File with corrupted BMP data" => "200x100_unknown.unknown", + //File containing forcibly corrupted bmp image + "File with corrupted BMP data" => "200x100_unknown.unknown", //File which doesn't exist "Non-existent file" => "nofile.ext", diff --git a/ext/standard/tests/image/image_type_to_mime_type.phpt b/ext/standard/tests/image/image_type_to_mime_type.phpt index b1781aac2b..aff49ae58f 100644 --- a/ext/standard/tests/image/image_type_to_mime_type.phpt +++ b/ext/standard/tests/image/image_type_to_mime_type.phpt @@ -6,22 +6,22 @@ image_type_to_mime_type() ?> --FILE-- <?php - // Note: SWC requires zlib - $dir = opendir(__DIR__) or die('cannot open directory: '.__DIR__); - $result = array(); - $files = array(); - while (($file = readdir($dir)) !== FALSE) { - if (preg_match('/^test.+pix\./',$file) && $file != "test13pix.swf") { - $files[] = $file; - } - } - closedir($dir); - sort($files); - foreach($files as $file) { - $result[$file] = getimagesize(__DIR__."/$file"); - $result[$file] = image_type_to_mime_type($result[$file][2]); - } - var_dump($result); + // Note: SWC requires zlib + $dir = opendir(__DIR__) or die('cannot open directory: '.__DIR__); + $result = array(); + $files = array(); + while (($file = readdir($dir)) !== FALSE) { + if (preg_match('/^test.+pix\./',$file) && $file != "test13pix.swf") { + $files[] = $file; + } + } + closedir($dir); + sort($files); + foreach($files as $file) { + $result[$file] = getimagesize(__DIR__."/$file"); + $result[$file] = image_type_to_mime_type($result[$file][2]); + } + var_dump($result); ?> --EXPECT-- array(16) { diff --git a/ext/standard/tests/image/image_type_to_mime_type_basic.phpt b/ext/standard/tests/image/image_type_to_mime_type_basic.phpt index 40b5a07725..684056459e 100644 --- a/ext/standard/tests/image/image_type_to_mime_type_basic.phpt +++ b/ext/standard/tests/image/image_type_to_mime_type_basic.phpt @@ -12,28 +12,28 @@ image_type_to_mime_type() echo "Starting image_type_to_mime_type() test\n\n"; $image_types = array ( - IMAGETYPE_GIF, - IMAGETYPE_JPEG, - IMAGETYPE_PNG, - IMAGETYPE_SWF, - IMAGETYPE_PSD, - IMAGETYPE_BMP, - IMAGETYPE_TIFF_II, - IMAGETYPE_TIFF_MM, - IMAGETYPE_JPC, - IMAGETYPE_JP2, - IMAGETYPE_JPX, - IMAGETYPE_JB2, - IMAGETYPE_IFF, - IMAGETYPE_WBMP, - IMAGETYPE_JPEG2000, - IMAGETYPE_XBM, - IMAGETYPE_WEBP + IMAGETYPE_GIF, + IMAGETYPE_JPEG, + IMAGETYPE_PNG, + IMAGETYPE_SWF, + IMAGETYPE_PSD, + IMAGETYPE_BMP, + IMAGETYPE_TIFF_II, + IMAGETYPE_TIFF_MM, + IMAGETYPE_JPC, + IMAGETYPE_JP2, + IMAGETYPE_JPX, + IMAGETYPE_JB2, + IMAGETYPE_IFF, + IMAGETYPE_WBMP, + IMAGETYPE_JPEG2000, + IMAGETYPE_XBM, + IMAGETYPE_WEBP ); - foreach($image_types as $image_type) { - var_dump(image_type_to_mime_type($image_type)); - } + foreach($image_types as $image_type) { + var_dump(image_type_to_mime_type($image_type)); + } echo "\nDone image_type_to_mime_type() test\n"; ?> diff --git a/ext/standard/tests/mail/mail_basic7.phpt b/ext/standard/tests/mail/mail_basic7.phpt index c01fb5fe25..9c9c61d835 100644 --- a/ext/standard/tests/mail/mail_basic7.phpt +++ b/ext/standard/tests/mail/mail_basic7.phpt @@ -22,13 +22,13 @@ $to = 'user@example.com'; $subject = 'Test Subject'; $message = 'A Message'; $additional_headers = array( - 'KHeaders' => 'aaaa', - 'bcc'=>'foo@bar', - 'foo'=> - array( - "bar\r\n hoge", - "bar\r\n\t fuga", - ), + 'KHeaders' => 'aaaa', + 'bcc'=>'foo@bar', + 'foo'=> + array( + "bar\r\n hoge", + "bar\r\n\t fuga", + ), ); $outFile = "mailBasic7.out"; @unlink($outFile); @@ -48,14 +48,14 @@ $subject = 'Test Subject'; $message = 'A Message'; // Headers should not have array values $additional_headers = array( - 'orig-date' => array('foo1'), - 'from' => array('foo2'), - 'sender' => array('foo3'), - 'reply-to' => array('foo4'), - 'to' => array('foo5'), - 'bcc' => array('foo6'), - 'message-id' => array('foo7'), - 'in-reply-to'=> array('foo8'), + 'orig-date' => array('foo1'), + 'from' => array('foo2'), + 'sender' => array('foo3'), + 'reply-to' => array('foo4'), + 'to' => array('foo5'), + 'bcc' => array('foo6'), + 'message-id' => array('foo7'), + 'in-reply-to'=> array('foo8'), ); $outFile = "mailBasic7.out"; @unlink($outFile); @@ -74,13 +74,13 @@ $to = 'user@example.com'; $subject = 'Test Subject'; $message = 'A Message'; $additional_headers = array( - 'foo1' => array('foo1'=>'bar1'), - 'foo2' => array('foo2', array('foo3')), - 'foo3' => array(123), - 'foo4' => array(123.456), - 'foo5' => array(FALSE), - 'foo6' => array(NULL), - 'foo7' => array(new StdClass), + 'foo1' => array('foo1'=>'bar1'), + 'foo2' => array('foo2', array('foo3')), + 'foo3' => array(123), + 'foo4' => array(123.456), + 'foo5' => array(FALSE), + 'foo6' => array(NULL), + 'foo7' => array(new StdClass), ); $outFile = "mailBasic7.out"; @unlink($outFile); @@ -99,16 +99,16 @@ $to = 'user@example.com'; $subject = 'Test Subject'; $message = 'A Message'; $additional_headers = array( - '*:foo1' => array('bar1'), - 'foo2:::' => array('bar1'), - 'foo3()' => array('bar1'), - 'foo4@' => array('bar1'), - 'foo5|' => array('bar1'), - "\0foo6" => array('bar1'), - "foo7\0" => array('bar1'), - "foo8" => array(), - "foo9" => '%&$#!', - "foo10" => "abc\0\tdef", + '*:foo1' => array('bar1'), + 'foo2:::' => array('bar1'), + 'foo3()' => array('bar1'), + 'foo4@' => array('bar1'), + 'foo5|' => array('bar1'), + "\0foo6" => array('bar1'), + "foo7\0" => array('bar1'), + "foo8" => array(), + "foo9" => '%&$#!', + "foo10" => "abc\0\tdef", ); $outFile = "mailBasic7.out"; @unlink($outFile); diff --git a/ext/standard/tests/mail/mail_basic_alt1-win32.phpt b/ext/standard/tests/mail/mail_basic_alt1-win32.phpt index c48634e99c..5952a14f59 100644 --- a/ext/standard/tests/mail/mail_basic_alt1-win32.phpt +++ b/ext/standard/tests/mail/mail_basic_alt1-win32.phpt @@ -38,48 +38,48 @@ HERE; $res = mail($to, $subject, $message); if ($res !== true) { - exit("TEST FAILED : Unable to send test email\n"); + exit("TEST FAILED : Unable to send test email\n"); } else { - echo "Msg sent OK\n"; + echo "Msg sent OK\n"; } // Search for email message on the mail server using imap. $imap_stream = imap_open($default_mailbox, $username, $password); if ($imap_stream === false) { - echo "Cannot connect to IMAP server $server: " . imap_last_error() . "\n"; - return false; + echo "Cannot connect to IMAP server $server: " . imap_last_error() . "\n"; + return false; } $found = false; $repeat_count = 20; // we will repeat a max of 20 times while (!$found && $repeat_count > 0) { - // sleep for a while to allow msg to be delivered - sleep(1); + // sleep for a while to allow msg to be delivered + sleep(1); - $current_msg_count = imap_check($imap_stream)->Nmsgs; + $current_msg_count = imap_check($imap_stream)->Nmsgs; - // Iterate over recent msgs to find the one we sent above - for ($i = 1; $i <= $current_msg_count; $i++) { - // get hdr details - $hdr = imap_headerinfo($imap_stream, $i); + // Iterate over recent msgs to find the one we sent above + for ($i = 1; $i <= $current_msg_count; $i++) { + // get hdr details + $hdr = imap_headerinfo($imap_stream, $i); - if (substr($hdr->Subject, 0 , strlen($subject_prefix)) == $subject_prefix) { - echo "Id of msg just sent is $i\n"; - echo ".. delete it\n"; - imap_delete($imap_stream, $i); - $found = true; - break; - } - } + if (substr($hdr->Subject, 0 , strlen($subject_prefix)) == $subject_prefix) { + echo "Id of msg just sent is $i\n"; + echo ".. delete it\n"; + imap_delete($imap_stream, $i); + $found = true; + break; + } + } - $repeat_count -= 1; + $repeat_count -= 1; } if (!$found) { - echo "TEST FAILED: email not delivered\n"; + echo "TEST FAILED: email not delivered\n"; } else { - echo "TEST PASSED: Msgs sent and deleted OK\n"; + echo "TEST PASSED: Msgs sent and deleted OK\n"; } imap_close($imap_stream, CL_EXPUNGE); diff --git a/ext/standard/tests/mail/mail_basic_alt2-win32.phpt b/ext/standard/tests/mail/mail_basic_alt2-win32.phpt index 3aff59a614..8c7a28983c 100644 --- a/ext/standard/tests/mail/mail_basic_alt2-win32.phpt +++ b/ext/standard/tests/mail/mail_basic_alt2-win32.phpt @@ -35,48 +35,48 @@ $extra_headers = "from: user@example.com"; $res = mail($to, $subject, $message, $extra_headers); if ($res !== true) { - exit("TEST FAILED : Unable to send test email\n"); + exit("TEST FAILED : Unable to send test email\n"); } else { - echo "Msg sent OK\n"; + echo "Msg sent OK\n"; } // Search for email message on the mail server using imap. $imap_stream = imap_open($default_mailbox, $username, $password); if ($imap_stream === false) { - echo "Cannot connect to IMAP server $server: " . imap_last_error() . "\n"; - return false; + echo "Cannot connect to IMAP server $server: " . imap_last_error() . "\n"; + return false; } $found = false; $repeat_count = 20; // we will repeat a max of 20 times while (!$found && $repeat_count > 0) { - // sleep for a while to allow msg to be delivered - sleep(1); + // sleep for a while to allow msg to be delivered + sleep(1); - $current_msg_count = imap_check($imap_stream)->Nmsgs; + $current_msg_count = imap_check($imap_stream)->Nmsgs; - // Iterate over recent msgs to find the one we sent above - for ($i = 1; $i <= $current_msg_count; $i++) { - // get hdr details - $hdr = imap_headerinfo($imap_stream, $i); + // Iterate over recent msgs to find the one we sent above + for ($i = 1; $i <= $current_msg_count; $i++) { + // get hdr details + $hdr = imap_headerinfo($imap_stream, $i); - if (substr($hdr->Subject, 0 , strlen($subject_prefix)) == $subject_prefix) { - echo "Id of msg just sent is $i\n"; - echo ".. delete it\n"; - imap_delete($imap_stream, $i); - $found = true; - break; - } - } + if (substr($hdr->Subject, 0 , strlen($subject_prefix)) == $subject_prefix) { + echo "Id of msg just sent is $i\n"; + echo ".. delete it\n"; + imap_delete($imap_stream, $i); + $found = true; + break; + } + } - $repeat_count -= 1; + $repeat_count -= 1; } if (!$found) { - echo "TEST FAILED: email not delivered\n"; + echo "TEST FAILED: email not delivered\n"; } else { - echo "TEST PASSED: Msgs sent and deleted OK\n"; + echo "TEST PASSED: Msgs sent and deleted OK\n"; } imap_close($imap_stream, CL_EXPUNGE); diff --git a/ext/standard/tests/mail/mail_basic_alt3-win32.phpt b/ext/standard/tests/mail/mail_basic_alt3-win32.phpt index 52d48937ed..15fb701e28 100644 --- a/ext/standard/tests/mail/mail_basic_alt3-win32.phpt +++ b/ext/standard/tests/mail/mail_basic_alt3-win32.phpt @@ -35,48 +35,48 @@ $extra_headers = "FRom: user@example.com"; $res = mail($to, $subject, $message, $extra_headers); if ($res !== true) { - exit("TEST FAILED : Unable to send test email\n"); + exit("TEST FAILED : Unable to send test email\n"); } else { - echo "Msg sent OK\n"; + echo "Msg sent OK\n"; } // Search for email message on the mail server using imap. $imap_stream = imap_open($default_mailbox, $username, $password); if ($imap_stream === false) { - echo "Cannot connect to IMAP server $server: " . imap_last_error() . "\n"; - return false; + echo "Cannot connect to IMAP server $server: " . imap_last_error() . "\n"; + return false; } $found = false; $repeat_count = 20; // we will repeat a max of 20 times while (!$found && $repeat_count > 0) { - // sleep for a while to allow msg to be delivered - sleep(1); + // sleep for a while to allow msg to be delivered + sleep(1); - $current_msg_count = imap_check($imap_stream)->Nmsgs; + $current_msg_count = imap_check($imap_stream)->Nmsgs; - // Iterate over recent msgs to find the one we sent above - for ($i = 1; $i <= $current_msg_count; $i++) { - // get hdr details - $hdr = imap_headerinfo($imap_stream, $i); + // Iterate over recent msgs to find the one we sent above + for ($i = 1; $i <= $current_msg_count; $i++) { + // get hdr details + $hdr = imap_headerinfo($imap_stream, $i); - if (substr($hdr->Subject, 0 , strlen($subject_prefix)) == $subject_prefix) { - echo "Id of msg just sent is $i\n"; - echo ".. delete it\n"; - imap_delete($imap_stream, $i); - $found = true; - break; - } - } + if (substr($hdr->Subject, 0 , strlen($subject_prefix)) == $subject_prefix) { + echo "Id of msg just sent is $i\n"; + echo ".. delete it\n"; + imap_delete($imap_stream, $i); + $found = true; + break; + } + } - $repeat_count -= 1; + $repeat_count -= 1; } if (!$found) { - echo "TEST FAILED: email not delivered\n"; + echo "TEST FAILED: email not delivered\n"; } else { - echo "TEST PASSED: Msgs sent and deleted OK\n"; + echo "TEST PASSED: Msgs sent and deleted OK\n"; } imap_close($imap_stream, CL_EXPUNGE); diff --git a/ext/standard/tests/mail/mail_basic_alt4-win32.phpt b/ext/standard/tests/mail/mail_basic_alt4-win32.phpt index a677312442..96c6fb11f5 100644 --- a/ext/standard/tests/mail/mail_basic_alt4-win32.phpt +++ b/ext/standard/tests/mail/mail_basic_alt4-win32.phpt @@ -36,48 +36,48 @@ $extra_parameters = "addons"; // should be ignored $res = mail($to, $subject, $message, $extra_headers, $extra_parameters); if ($res !== true) { - exit("TEST FAILED : Unable to send test email\n"); + exit("TEST FAILED : Unable to send test email\n"); } else { - echo "Msg sent OK\n"; + echo "Msg sent OK\n"; } // Search for email message on the mail server using imap. $imap_stream = imap_open($default_mailbox, $username, $password); if ($imap_stream === false) { - echo "Cannot connect to IMAP server $server: " . imap_last_error() . "\n"; - return false; + echo "Cannot connect to IMAP server $server: " . imap_last_error() . "\n"; + return false; } $found = false; $repeat_count = 20; // we will repeat a max of 20 times while (!$found && $repeat_count > 0) { - // sleep for a while to allow msg to be delivered - sleep(1); + // sleep for a while to allow msg to be delivered + sleep(1); - $current_msg_count = imap_check($imap_stream)->Nmsgs; + $current_msg_count = imap_check($imap_stream)->Nmsgs; - // Iterate over recent msgs to find the one we sent above - for ($i = 1; $i <= $current_msg_count; $i++) { - // get hdr details - $hdr = imap_headerinfo($imap_stream, $i); + // Iterate over recent msgs to find the one we sent above + for ($i = 1; $i <= $current_msg_count; $i++) { + // get hdr details + $hdr = imap_headerinfo($imap_stream, $i); - if (substr($hdr->Subject, 0 , strlen($subject_prefix)) == $subject_prefix) { - echo "Id of msg just sent is $i\n"; - echo ".. delete it\n"; - imap_delete($imap_stream, $i); - $found = true; - break; - } - } + if (substr($hdr->Subject, 0 , strlen($subject_prefix)) == $subject_prefix) { + echo "Id of msg just sent is $i\n"; + echo ".. delete it\n"; + imap_delete($imap_stream, $i); + $found = true; + break; + } + } - $repeat_count -= 1; + $repeat_count -= 1; } if (!$found) { - echo "TEST FAILED: email not delivered\n"; + echo "TEST FAILED: email not delivered\n"; } else { - echo "TEST PASSED: Msgs sent and deleted OK\n"; + echo "TEST PASSED: Msgs sent and deleted OK\n"; } imap_close($imap_stream, CL_EXPUNGE); diff --git a/ext/standard/tests/mail/mail_include.inc b/ext/standard/tests/mail/mail_include.inc index ba7ee121b5..c69d4a7182 100644 --- a/ext/standard/tests/mail/mail_include.inc +++ b/ext/standard/tests/mail/mail_include.inc @@ -18,32 +18,32 @@ $mailbox_prefix = "phpttest"; // name used for test mailbox * @return IMAP stream to new mailbox on success; FALSE on failure */ function setup_test_mailbox($mailbox_suffix, $message_count, &$new_mailbox = null, $msg_type = "simple"){ - global $server, $default_mailbox, $username, $password; + global $server, $default_mailbox, $username, $password; - // open a stream to default mailbox - $imap_stream = imap_open($default_mailbox, $username, $password); + // open a stream to default mailbox + $imap_stream = imap_open($default_mailbox, $username, $password); - if ($imap_stream === false) { - echo "Cannot connect to IMAP server $server: " . imap_last_error() . "\n"; - return false; - } + if ($imap_stream === false) { + echo "Cannot connect to IMAP server $server: " . imap_last_error() . "\n"; + return false; + } - echo "Create a temporary mailbox and add " . $message_count . " msgs\n"; - $new_mailbox = create_mailbox($imap_stream, $mailbox_suffix, $message_count, $msg_type); - if ($new_mailbox === false) { - echo "Can't create a temporary mailbox: " . imap_last_error(). "\n"; - return false; - } + echo "Create a temporary mailbox and add " . $message_count . " msgs\n"; + $new_mailbox = create_mailbox($imap_stream, $mailbox_suffix, $message_count, $msg_type); + if ($new_mailbox === false) { + echo "Can't create a temporary mailbox: " . imap_last_error(). "\n"; + return false; + } - echo ".. mailbox '$new_mailbox' created\n"; + echo ".. mailbox '$new_mailbox' created\n"; - // reopen stream to new mailbox - if (imap_reopen($imap_stream, $new_mailbox) === false) { - echo "can't re-open '$new_mailbox' mailbox: " . imap_last_error() . "\n"; - return false; - } + // reopen stream to new mailbox + if (imap_reopen($imap_stream, $new_mailbox) === false) { + echo "can't re-open '$new_mailbox' mailbox: " . imap_last_error() . "\n"; + return false; + } - return $imap_stream; + return $imap_stream; } /** @@ -53,30 +53,30 @@ function setup_test_mailbox($mailbox_suffix, $message_count, &$new_mailbox = nul * @param string $mailbox */ function create_mailbox($imap_stream, $mailbox_suffix, $message_count, $msg_type= "simple"){ - global $default_mailbox, $mailbox_prefix; - $mailbox = $default_mailbox . "." . $mailbox_prefix . $mailbox_suffix; - - $mailboxes = imap_getmailboxes($imap_stream, $mailbox, '*'); - - // check mailbox does not already exist - if ($mailboxes) { - foreach($mailboxes as $value) { - if ($value->name == $mailbox) { - exit ("TEST FAILED : Mailbox '$mailbox' already exists\n"); - } - } - } - - if (imap_createmailbox($imap_stream, $mailbox) === false) { - return false; - } - - // Add number of test msgs requested - if ($message_count > 0) { - populate_mailbox($imap_stream, $mailbox, $message_count, $msg_type); - } - - return $mailbox; + global $default_mailbox, $mailbox_prefix; + $mailbox = $default_mailbox . "." . $mailbox_prefix . $mailbox_suffix; + + $mailboxes = imap_getmailboxes($imap_stream, $mailbox, '*'); + + // check mailbox does not already exist + if ($mailboxes) { + foreach($mailboxes as $value) { + if ($value->name == $mailbox) { + exit ("TEST FAILED : Mailbox '$mailbox' already exists\n"); + } + } + } + + if (imap_createmailbox($imap_stream, $mailbox) === false) { + return false; + } + + // Add number of test msgs requested + if ($message_count > 0) { + populate_mailbox($imap_stream, $mailbox, $message_count, $msg_type); + } + + return $mailbox; } /** @@ -87,48 +87,48 @@ function create_mailbox($imap_stream, $mailbox_suffix, $message_count, $msg_type */ function populate_mailbox($imap_stream, $mailbox, $message_count, $msg_type = "simple"){ - global $users, $domain; - - for($i = 1; $i <= $message_count; $i++) { - if ($msg_type == "simple") { - $msg = "From: foo@anywhere.com\r\n" - . "To: $users[0]@$domain\r\n" - . "Subject: test$i\r\n" - . "\r\n" - . "$i: this is a test message, please ignore\r\n"; - } else { - $envelope["from"]= "foo@anywhere.com"; - $envelope["to"] = "$users[0]@$domain"; - $envelope["subject"] = "Test msg $i"; - - $part1["type"] = TYPEMULTIPART; - $part1["subtype"] = "mixed"; - - $part2["type"] = TYPETEXT; - $part2["subtype"] = "plain"; - $part2["description"] = "imap_mail_compose() function"; - $part2["contents.data"] = "message 1:xxxxxxxxxxxxxxxxxxxxxxxxxx"; - - $part3["type"] = TYPETEXT; - $part3["subtype"] = "plain"; - $part3["description"] = "Example"; - $part3["contents.data"] = "message 2:yyyyyyyyyyyyyyyyyyyyyyyyyy"; - - $part4["type"] = TYPETEXT; - $part4["subtype"] = "plain"; - $part4["description"] = "Return Values"; - $part4["contents.data"] = "message 3:zzzzzzzzzzzzzzzzzzzzzzzzzz"; - - $body[1] = $part1; - $body[2] = $part2; - $body[3] = $part3; - $body[4] = $part4; - - $msg = imap_mail_compose($envelope, $body); - } - - imap_append($imap_stream, $mailbox, $msg); - } + global $users, $domain; + + for($i = 1; $i <= $message_count; $i++) { + if ($msg_type == "simple") { + $msg = "From: foo@anywhere.com\r\n" + . "To: $users[0]@$domain\r\n" + . "Subject: test$i\r\n" + . "\r\n" + . "$i: this is a test message, please ignore\r\n"; + } else { + $envelope["from"]= "foo@anywhere.com"; + $envelope["to"] = "$users[0]@$domain"; + $envelope["subject"] = "Test msg $i"; + + $part1["type"] = TYPEMULTIPART; + $part1["subtype"] = "mixed"; + + $part2["type"] = TYPETEXT; + $part2["subtype"] = "plain"; + $part2["description"] = "imap_mail_compose() function"; + $part2["contents.data"] = "message 1:xxxxxxxxxxxxxxxxxxxxxxxxxx"; + + $part3["type"] = TYPETEXT; + $part3["subtype"] = "plain"; + $part3["description"] = "Example"; + $part3["contents.data"] = "message 2:yyyyyyyyyyyyyyyyyyyyyyyyyy"; + + $part4["type"] = TYPETEXT; + $part4["subtype"] = "plain"; + $part4["description"] = "Return Values"; + $part4["contents.data"] = "message 3:zzzzzzzzzzzzzzzzzzzzzzzzzz"; + + $body[1] = $part1; + $body[2] = $part2; + $body[3] = $part3; + $body[4] = $part4; + + $msg = imap_mail_compose($envelope, $body); + } + + imap_append($imap_stream, $mailbox, $msg); + } } /** @@ -139,12 +139,12 @@ function populate_mailbox($imap_stream, $mailbox, $message_count, $msg_type = "s */ function get_mailbox_name($mailbox){ - if (preg_match('/\{.*?\}(.*)/', $mailbox, $match) != 1) { - echo "Unrecpognized mailbox name\n"; - return false; - } + if (preg_match('/\{.*?\}(.*)/', $mailbox, $match) != 1) { + echo "Unrecpognized mailbox name\n"; + return false; + } - return $match[1]; + return $match[1]; } ?> diff --git a/ext/standard/tests/mail/mail_log.phpt b/ext/standard/tests/mail/mail_log.phpt index e60aa621b0..4f9e9423f4 100644 --- a/ext/standard/tests/mail/mail_log.phpt +++ b/ext/standard/tests/mail/mail_log.phpt @@ -9,7 +9,7 @@ date_default_timezone_set("UTC"); $logfile = ini_get("mail.log"); if (file_exists($logfile)) { - unlink($logfile); + unlink($logfile); } touch($logfile); clearstatcache(); diff --git a/ext/standard/tests/mail/mail_skipif.inc b/ext/standard/tests/mail/mail_skipif.inc index fedcfbbe4e..8f2468581d 100644 --- a/ext/standard/tests/mail/mail_skipif.inc +++ b/ext/standard/tests/mail/mail_skipif.inc @@ -2,13 +2,13 @@ extension_loaded('imap') or die('skip imap extension not available in this build'); if( substr(PHP_OS, 0, 3) == 'WIN' && extension_loaded('sockets')) { - // be sure mail server is accessible... on PHP 5.3.13 release build, using test-pack PHP-5.3-r1af8b3f, - // the code below didn't skip test even though there was no mail server - // test then failed (no mail server to test against) - $socket = socket_create(AF_INET, SOCK_RAW, 1); - socket_set_option($socket, SOL_SOCKET, SO_RCVTIMEO, array('sec' => 10, 'usec' => 10)); - // imap uses tcp port 143 - socket_connect($socket, "localhost", 143) or die ("skip can't socket to mail server"); + // be sure mail server is accessible... on PHP 5.3.13 release build, using test-pack PHP-5.3-r1af8b3f, + // the code below didn't skip test even though there was no mail server + // test then failed (no mail server to test against) + $socket = socket_create(AF_INET, SOCK_RAW, 1); + socket_set_option($socket, SOL_SOCKET, SO_RCVTIMEO, array('sec' => 10, 'usec' => 10)); + // imap uses tcp port 143 + socket_connect($socket, "localhost", 143) or die ("skip can't socket to mail server"); } // Change these to make tests run successfully @@ -20,7 +20,7 @@ $retries = 0; // don't retry connect on failure $mbox = imap_open($mailbox, $username, $password, $options, $retries); if (!$mbox) { - die("skip could not connect to mailbox $mailbox"); + die("skip could not connect to mailbox $mailbox"); } imap_close($mbox); ?> diff --git a/ext/standard/tests/mail/mail_variation_alt1-win32.phpt b/ext/standard/tests/mail/mail_variation_alt1-win32.phpt index 92a59477d0..155dc9815a 100644 --- a/ext/standard/tests/mail/mail_variation_alt1-win32.phpt +++ b/ext/standard/tests/mail/mail_variation_alt1-win32.phpt @@ -37,48 +37,48 @@ HERE; $res = mail($to, $subject, $message); if ($res !== true) { - exit("TEST COMPLETED : Unable to send test email\n"); + exit("TEST COMPLETED : Unable to send test email\n"); } else { - echo "Msg sent OK\n"; + echo "Msg sent OK\n"; } // Search for email message on the mail server using imap. $imap_stream = imap_open($default_mailbox, $username, $password); if ($imap_stream === false) { - echo "Cannot connect to IMAP server $server: " . imap_last_error() . "\n"; - return false; + echo "Cannot connect to IMAP server $server: " . imap_last_error() . "\n"; + return false; } $found = false; $repeat_count = 20; // we will repeat a max of 20 times while (!$found && $repeat_count > 0) { - // sleep for a while to allow msg to be delivered - sleep(1); + // sleep for a while to allow msg to be delivered + sleep(1); - $current_msg_count = imap_check($imap_stream)->Nmsgs; + $current_msg_count = imap_check($imap_stream)->Nmsgs; - // Iterate over recent msgs to find the one we sent above - for ($i = 1; $i <= $current_msg_count; $i++) { - // get hdr details - $hdr = imap_headerinfo($imap_stream, $i); + // Iterate over recent msgs to find the one we sent above + for ($i = 1; $i <= $current_msg_count; $i++) { + // get hdr details + $hdr = imap_headerinfo($imap_stream, $i); - if (substr($hdr->Subject, 0 , strlen($subject_prefix)) == $subject_prefix) { - echo "Id of msg just sent is $i\n"; - echo ".. delete it\n"; - imap_delete($imap_stream, $i); - $found = true; - break; - } - } + if (substr($hdr->Subject, 0 , strlen($subject_prefix)) == $subject_prefix) { + echo "Id of msg just sent is $i\n"; + echo ".. delete it\n"; + imap_delete($imap_stream, $i); + $found = true; + break; + } + } - $repeat_count -= 1; + $repeat_count -= 1; } if (!$found) { - echo "TEST FAILED: email not delivered\n"; + echo "TEST FAILED: email not delivered\n"; } else { - echo "TEST PASSED: Msgs sent and deleted OK\n"; + echo "TEST PASSED: Msgs sent and deleted OK\n"; } imap_close($imap_stream, CL_EXPUNGE); diff --git a/ext/standard/tests/mail/mail_variation_alt2-win32.phpt b/ext/standard/tests/mail/mail_variation_alt2-win32.phpt index 06c16eb5f8..36d971329f 100644 --- a/ext/standard/tests/mail/mail_variation_alt2-win32.phpt +++ b/ext/standard/tests/mail/mail_variation_alt2-win32.phpt @@ -37,48 +37,48 @@ HERE; $res = mail($to, $subject, $message); if ($res !== true) { - exit("TEST COMPLETED : Unable to send test email\n"); + exit("TEST COMPLETED : Unable to send test email\n"); } else { - echo "Msg sent OK\n"; + echo "Msg sent OK\n"; } // Search for email message on the mail server using imap. $imap_stream = imap_open($default_mailbox, $username, $password); if ($imap_stream === false) { - echo "Cannot connect to IMAP server $server: " . imap_last_error() . "\n"; - return false; + echo "Cannot connect to IMAP server $server: " . imap_last_error() . "\n"; + return false; } $found = false; $repeat_count = 20; // we will repeat a max of 20 times while (!$found && $repeat_count > 0) { - // sleep for a while to allow msg to be delivered - sleep(1); + // sleep for a while to allow msg to be delivered + sleep(1); - $current_msg_count = imap_check($imap_stream)->Nmsgs; + $current_msg_count = imap_check($imap_stream)->Nmsgs; - // Iterate over recent msgs to find the one we sent above - for ($i = 1; $i <= $current_msg_count; $i++) { - // get hdr details - $hdr = imap_headerinfo($imap_stream, $i); + // Iterate over recent msgs to find the one we sent above + for ($i = 1; $i <= $current_msg_count; $i++) { + // get hdr details + $hdr = imap_headerinfo($imap_stream, $i); - if (substr($hdr->Subject, 0 , strlen($subject_prefix)) == $subject_prefix) { - echo "Id of msg just sent is $i\n"; - echo ".. delete it\n"; - imap_delete($imap_stream, $i); - $found = true; - break; - } - } + if (substr($hdr->Subject, 0 , strlen($subject_prefix)) == $subject_prefix) { + echo "Id of msg just sent is $i\n"; + echo ".. delete it\n"; + imap_delete($imap_stream, $i); + $found = true; + break; + } + } - $repeat_count -= 1; + $repeat_count -= 1; } if (!$found) { - echo "TEST FAILED: email not delivered\n"; + echo "TEST FAILED: email not delivered\n"; } else { - echo "TEST PASSED: Msgs sent and deleted OK\n"; + echo "TEST PASSED: Msgs sent and deleted OK\n"; } imap_close($imap_stream, CL_EXPUNGE); diff --git a/ext/standard/tests/mail/mail_variation_alt3-win32.phpt b/ext/standard/tests/mail/mail_variation_alt3-win32.phpt index 44eda4555b..96d5d796bb 100644 --- a/ext/standard/tests/mail/mail_variation_alt3-win32.phpt +++ b/ext/standard/tests/mail/mail_variation_alt3-win32.phpt @@ -36,48 +36,48 @@ HERE; $res = mail($to, $subject, $message); if ($res !== true) { - exit("TEST COMPLETED : Unable to send test email\n"); + exit("TEST COMPLETED : Unable to send test email\n"); } else { - echo "Msg sent OK\n"; + echo "Msg sent OK\n"; } // Search for email message on the mail server using imap. $imap_stream = imap_open($default_mailbox, $username, $password); if ($imap_stream === false) { - echo "Cannot connect to IMAP server $server: " . imap_last_error() . "\n"; - return false; + echo "Cannot connect to IMAP server $server: " . imap_last_error() . "\n"; + return false; } $found = false; $repeat_count = 20; // we will repeat a max of 20 times while (!$found && $repeat_count > 0) { - // sleep for a while to allow msg to be delivered - sleep(1); + // sleep for a while to allow msg to be delivered + sleep(1); - $current_msg_count = imap_check($imap_stream)->Nmsgs; + $current_msg_count = imap_check($imap_stream)->Nmsgs; - // Iterate over recent msgs to find the one we sent above - for ($i = 1; $i <= $current_msg_count; $i++) { - // get hdr details - $hdr = imap_headerinfo($imap_stream, $i); + // Iterate over recent msgs to find the one we sent above + for ($i = 1; $i <= $current_msg_count; $i++) { + // get hdr details + $hdr = imap_headerinfo($imap_stream, $i); - if (substr($hdr->Subject, 0 , strlen($subject_prefix)) == $subject_prefix) { - echo "Id of msg just sent is $i\n"; - echo ".. delete it\n"; - imap_delete($imap_stream, $i); - $found = true; - break; - } - } + if (substr($hdr->Subject, 0 , strlen($subject_prefix)) == $subject_prefix) { + echo "Id of msg just sent is $i\n"; + echo ".. delete it\n"; + imap_delete($imap_stream, $i); + $found = true; + break; + } + } - $repeat_count -= 1; + $repeat_count -= 1; } if (!$found) { - echo "TEST FAILED: email not delivered\n"; + echo "TEST FAILED: email not delivered\n"; } else { - echo "TEST PASSED: Msgs sent and deleted OK\n"; + echo "TEST PASSED: Msgs sent and deleted OK\n"; } imap_close($imap_stream, CL_EXPUNGE); diff --git a/ext/standard/tests/math/abs.phpt b/ext/standard/tests/math/abs.phpt index af8732811d..f1ff71b6f2 100644 --- a/ext/standard/tests/math/abs.phpt +++ b/ext/standard/tests/math/abs.phpt @@ -6,7 +6,7 @@ Simple math tests define('LONG_MAX', is_int(5000000000)? 9223372036854775807 : 0x7FFFFFFF); define('LONG_MIN', -LONG_MAX - 1); printf("%d,%d,%d,%d\n",is_int(LONG_MIN ),is_int(LONG_MAX ), - is_int(LONG_MIN-1),is_int(LONG_MAX+1)); + is_int(LONG_MIN-1),is_int(LONG_MAX+1)); $tests = <<<TESTS 1 === abs(-1) diff --git a/ext/standard/tests/math/abs_basic.phpt b/ext/standard/tests/math/abs_basic.phpt index 1866097c3e..b7da2a49bd 100644 --- a/ext/standard/tests/math/abs_basic.phpt +++ b/ext/standard/tests/math/abs_basic.phpt @@ -12,23 +12,23 @@ precision = 14 echo "*** Testing abs() : basic functionality ***\n"; $values = array(23, - -23, - 2.345e1, - -2.345e1, - 0x17, - 027, - "23", - "-23", - "23.45", - "2.345e1", - "-2.345e1", - null, - true, - false); + -23, + 2.345e1, + -2.345e1, + 0x17, + 027, + "23", + "-23", + "23.45", + "2.345e1", + "-2.345e1", + null, + true, + false); for ($i = 0; $i < count($values); $i++) { - $res = abs($values[$i]); - var_dump($res); + $res = abs($values[$i]); + var_dump($res); } ?> --EXPECT-- diff --git a/ext/standard/tests/math/abs_variation.phpt b/ext/standard/tests/math/abs_variation.phpt index f27a73559a..854cb71181 100644 --- a/ext/standard/tests/math/abs_variation.phpt +++ b/ext/standard/tests/math/abs_variation.phpt @@ -72,13 +72,13 @@ $inputs = array( // loop through each element of $inputs to check the behavior of abs() $iterator = 1; foreach($inputs as $input) { - echo "\n-- Iteration $iterator --\n"; - try { - var_dump(abs($input)); - } catch (TypeError $e) { - echo $e->getMessage(), "\n"; - } - $iterator++; + echo "\n-- Iteration $iterator --\n"; + try { + var_dump(abs($input)); + } catch (TypeError $e) { + echo $e->getMessage(), "\n"; + } + $iterator++; }; fclose($fp); diff --git a/ext/standard/tests/math/acos_basic.phpt b/ext/standard/tests/math/acos_basic.phpt index 6f73d40f40..4f7962ce5e 100644 --- a/ext/standard/tests/math/acos_basic.phpt +++ b/ext/standard/tests/math/acos_basic.phpt @@ -19,20 +19,20 @@ echo "acos .5 = "; $acosv1 = 360.0 * acos(0.5) / (2.0 * M_PI ); var_dump($acosv1); if (allowed_rounding_error($acosv1 ,60 )) { - echo "Pass\n"; + echo "Pass\n"; } else { - echo "Fail\n"; + echo "Fail\n"; } echo "acos 0.86602540378444 = "; $acosv2 = 360.0 * acos(0.86602540378444) / (2.0 * M_PI ); var_dump($acosv2); if (allowed_rounding_error($acosv2 ,30 )) { - echo "Pass\n"; + echo "Pass\n"; } else { - echo "Fail\n"; + echo "Fail\n"; } @@ -40,10 +40,10 @@ echo "acos 1.0 = "; $acosv3 = 360.0 * acos(1.0) / (2.0 * M_PI); var_dump($acosv3); if (allowed_rounding_error($acosv3 ,0 )) { - echo "Pass\n"; + echo "Pass\n"; } else { - echo "Fail\n"; + echo "Fail\n"; } @@ -51,10 +51,10 @@ echo "acos 0.0 = "; $acosv4 = 360.0 * acos(0.0) / (2.0 * M_PI ); var_dump($acosv4); if (allowed_rounding_error($acosv3 ,0 )) { - echo "Pass\n"; + echo "Pass\n"; } else { - echo "Fail\n"; + echo "Fail\n"; } ?> diff --git a/ext/standard/tests/math/acos_variation.phpt b/ext/standard/tests/math/acos_variation.phpt index 4fe8437fd5..20065d62eb 100644 --- a/ext/standard/tests/math/acos_variation.phpt +++ b/ext/standard/tests/math/acos_variation.phpt @@ -13,23 +13,23 @@ precision=10 //Test acos with a different input values $values = array(23, - -23, - 2.345e1, - -2.345e1, - 0x17, - 027, - "23", - "23.45", - "2.345e1", - "1000", - "1000ABC", - null, - true, - false); + -23, + 2.345e1, + -2.345e1, + 0x17, + 027, + "23", + "23.45", + "2.345e1", + "1000", + "1000ABC", + null, + true, + false); for ($i = 0; $i < count($values); $i++) { - $res = acos($values[$i]); - var_dump($res); + $res = acos($values[$i]); + var_dump($res); } ?> diff --git a/ext/standard/tests/math/acosh_basic.phpt b/ext/standard/tests/math/acosh_basic.phpt index a9ba199df5..aed150cba8 100644 --- a/ext/standard/tests/math/acosh_basic.phpt +++ b/ext/standard/tests/math/acosh_basic.phpt @@ -16,20 +16,20 @@ echo "acosh 1.1276259652064= "; var_dump(acosh(1.1276259652064)); if (allowed_rounding_error(acosh(1.1276259652064), 0.5)) { - echo "Pass\n"; + echo "Pass\n"; } else { - echo "Fail\n"; + echo "Fail\n"; } echo "acosh 10.067661995778= "; var_dump(acosh(10.067661995778)); if (allowed_rounding_error(acosh(10.067661995778), 3.0)) { - echo "Pass\n"; + echo "Pass\n"; } else { - echo "Fail\n"; + echo "Fail\n"; } diff --git a/ext/standard/tests/math/acosh_variation.phpt b/ext/standard/tests/math/acosh_variation.phpt index 12200e035c..27e1a9ac24 100644 --- a/ext/standard/tests/math/acosh_variation.phpt +++ b/ext/standard/tests/math/acosh_variation.phpt @@ -13,23 +13,23 @@ precision = 10 //Test acosh with a different input values $values = array(23, - -23, - 2.345e1, - -2.345e1, - 0x17, - 027, - "23", - "23.45", - "2.345e1", - "1000", - "1000ABC", - null, - true, - false); + -23, + 2.345e1, + -2.345e1, + 0x17, + 027, + "23", + "23.45", + "2.345e1", + "1000", + "1000ABC", + null, + true, + false); for ($i = 0; $i < count($values); $i++) { - $res = acosh($values[$i]); - var_dump($res); + $res = acosh($values[$i]); + var_dump($res); } ?> diff --git a/ext/standard/tests/math/allowed_rounding_error.inc b/ext/standard/tests/math/allowed_rounding_error.inc index 9ba754b582..c4a1cce4bf 100644 --- a/ext/standard/tests/math/allowed_rounding_error.inc +++ b/ext/standard/tests/math/allowed_rounding_error.inc @@ -1,18 +1,18 @@ <?php function allowed_rounding_error ($number, $expected) { - //different machines may give slightly different floating point numbers - //This assumes that the results will be the same to + or - 1.0E-10. + //different machines may give slightly different floating point numbers + //This assumes that the results will be the same to + or - 1.0E-10. - $small_number = 1.0e-10; - $min = $expected - $small_number; - $max = $expected + $small_number; + $small_number = 1.0e-10; + $min = $expected - $small_number; + $max = $expected + $small_number; - if ($number < $max && $number > $min ) { - return true; - } - else { - return false; - } + if ($number < $max && $number > $min ) { + return true; + } + else { + return false; + } } ?> diff --git a/ext/standard/tests/math/asin_basic.phpt b/ext/standard/tests/math/asin_basic.phpt index ec43d50692..419a9ef343 100644 --- a/ext/standard/tests/math/asin_basic.phpt +++ b/ext/standard/tests/math/asin_basic.phpt @@ -19,30 +19,30 @@ echo "asin .5 = "; $asinv1 = 360.0 * asin(0.5) / (2.0 * M_PI ); var_dump($asinv1); if (allowed_rounding_error($asinv1 ,30 )) { - echo "Pass\n"; + echo "Pass\n"; } else { - echo "Fail\n"; + echo "Fail\n"; } echo "asin 0.86602540378444 = "; $asinv2 = 360.0 * asin(0.86602540378444) / (2.0 * M_PI ); var_dump($asinv2); if (allowed_rounding_error($asinv2 ,60 )) { - echo "Pass\n"; + echo "Pass\n"; } else { - echo "Fail\n"; + echo "Fail\n"; } echo "asin 1.0 = "; $asinv3 = 360.0 * asin(1.0) / (2.0 * M_PI ); var_dump($asinv3); if (allowed_rounding_error($asinv3 ,90 )) { - echo "Pass\n"; + echo "Pass\n"; } else { - echo "Fail\n"; + echo "Fail\n"; } @@ -50,10 +50,10 @@ echo "asin 0.0 = "; $asinv4 = 360.0 * asin(0.0) / (2.0 * M_PI ); var_dump($asinv4); if (allowed_rounding_error($asinv4 ,0 )) { - echo "Pass\n"; + echo "Pass\n"; } else { - echo "Fail\n"; + echo "Fail\n"; } ?> diff --git a/ext/standard/tests/math/asin_variation.phpt b/ext/standard/tests/math/asin_variation.phpt index c5d170e8db..7c0e5a37d6 100644 --- a/ext/standard/tests/math/asin_variation.phpt +++ b/ext/standard/tests/math/asin_variation.phpt @@ -13,23 +13,23 @@ precision = 10 //Test asin with a different input values $values = array(23, - -23, - 2.345e1, - -2.345e1, - 0x17, - 027, - "23", - "23.45", - "2.345e1", - "1000", - "1000ABC", - null, - true, - false); + -23, + 2.345e1, + -2.345e1, + 0x17, + 027, + "23", + "23.45", + "2.345e1", + "1000", + "1000ABC", + null, + true, + false); for ($i = 0; $i < count($values); $i++) { - $res = asin($values[$i]); - var_dump($res); + $res = asin($values[$i]); + var_dump($res); } ?> diff --git a/ext/standard/tests/math/asinh_basic.phpt b/ext/standard/tests/math/asinh_basic.phpt index 8fd189c66a..16380da128 100644 --- a/ext/standard/tests/math/asinh_basic.phpt +++ b/ext/standard/tests/math/asinh_basic.phpt @@ -16,20 +16,20 @@ echo "asinh 0.52109530549375= "; var_dump(asinh(0.52109530549375)); if (allowed_rounding_error(asinh(0.52109530549375), 0.5)) { - echo "Pass\n"; + echo "Pass\n"; } else { - echo "Fail\n"; + echo "Fail\n"; } echo "asinh 10.01787492741= "; var_dump(asinh(10.01787492741)); if (allowed_rounding_error(asinh(10.01787492741), 3.0)) { - echo "Pass\n"; + echo "Pass\n"; } else { - echo "Fail\n"; + echo "Fail\n"; } ?> diff --git a/ext/standard/tests/math/asinh_variation.phpt b/ext/standard/tests/math/asinh_variation.phpt index 2470f7d401..f4304148cb 100644 --- a/ext/standard/tests/math/asinh_variation.phpt +++ b/ext/standard/tests/math/asinh_variation.phpt @@ -13,23 +13,23 @@ precision = 10 //Test asinh with a different input values $values = array(23, - -23, - 2.345e1, - -2.345e1, - 0x17, - 027, - "23", - "23.45", - "2.345e1", - "1000", - "1000ABC", - null, - true, - false); + -23, + 2.345e1, + -2.345e1, + 0x17, + 027, + "23", + "23.45", + "2.345e1", + "1000", + "1000ABC", + null, + true, + false); for ($i = 0; $i < count($values); $i++) { - $res = asinh($values[$i]); - var_dump($res); + $res = asinh($values[$i]); + var_dump($res); } ?> diff --git a/ext/standard/tests/math/atan2_basic.phpt b/ext/standard/tests/math/atan2_basic.phpt index f6dae62900..fe015ac2aa 100644 --- a/ext/standard/tests/math/atan2_basic.phpt +++ b/ext/standard/tests/math/atan2_basic.phpt @@ -5,37 +5,37 @@ precision=14 --FILE-- <?php $valuesy = array(23, - -23, - 2.345e1, - -2.345e1, - 0x17, - 027, - "23", - "23.45", - "2.345e1", - null, - true, - false); + -23, + 2.345e1, + -2.345e1, + 0x17, + 027, + "23", + "23.45", + "2.345e1", + null, + true, + false); $valuesx = array(23, - -23, - 2.345e1, - -2.345e1, - 0x17, - 027, - "23", - "23.45", - "2.345e1", - null, - true, - false); + -23, + 2.345e1, + -2.345e1, + 0x17, + 027, + "23", + "23.45", + "2.345e1", + null, + true, + false); for ($i = 0; $i < count($valuesy); $i++) { - for ($j = 0; $j < count($valuesx); $j++) { - $res = atan2($valuesy[$i], $valuesx[$j]); - echo "Y:$valuesy[$i] X:$valuesx[$j] "; - var_dump($res); - } + for ($j = 0; $j < count($valuesx); $j++) { + $res = atan2($valuesy[$i], $valuesx[$j]); + echo "Y:$valuesy[$i] X:$valuesx[$j] "; + var_dump($res); + } } ?> --EXPECT-- diff --git a/ext/standard/tests/math/atan2_basiclong_64bit.phpt b/ext/standard/tests/math/atan2_basiclong_64bit.phpt index 235be3eca8..e29501232d 100644 --- a/ext/standard/tests/math/atan2_basiclong_64bit.phpt +++ b/ext/standard/tests/math/atan2_basiclong_64bit.phpt @@ -23,7 +23,7 @@ $otherVals = array(0, 1, -1, 7, 9, 65, -44, MAX_32Bit, MIN_32Bit, MAX_64Bit, MIN foreach ($longVals as $longVal) { foreach($otherVals as $otherVal) { - echo "--- testing: $longVal, $otherVal ---\n"; + echo "--- testing: $longVal, $otherVal ---\n"; var_dump(atan2($longVal, $otherVal)); } } diff --git a/ext/standard/tests/math/atan_basic.phpt b/ext/standard/tests/math/atan_basic.phpt index 24f1f4b924..9f41e58234 100644 --- a/ext/standard/tests/math/atan_basic.phpt +++ b/ext/standard/tests/math/atan_basic.phpt @@ -16,20 +16,20 @@ echo "atan 1.7320508075689 = "; $atan1 = 360 * atan(1.7320508075689) / (2.0 * M_PI); var_dump($atan1); if (allowed_rounding_error($atan1 ,60 )) { - echo "Pass\n"; + echo "Pass\n"; } else { - echo "Fail\n"; + echo "Fail\n"; } echo "atan 0.57735026918963 = "; $atan2 = 360 * atan(0.57735026918963) / (2.0 * M_PI); var_dump($atan2); if (allowed_rounding_error($atan2 ,30 )) { - echo "Pass\n"; + echo "Pass\n"; } else { - echo "Fail\n"; + echo "Fail\n"; } ?> diff --git a/ext/standard/tests/math/atan_variation.phpt b/ext/standard/tests/math/atan_variation.phpt index 625b6d0b83..409f0b1719 100644 --- a/ext/standard/tests/math/atan_variation.phpt +++ b/ext/standard/tests/math/atan_variation.phpt @@ -13,23 +13,23 @@ precision = 10 //Test atan with a different input values $values = array(23, - -23, - 2.345e1, - -2.345e1, - 0x17, - 027, - "23", - "23.45", - "2.345e1", - "1000", - "1000ABC", - null, - true, - false); + -23, + 2.345e1, + -2.345e1, + 0x17, + 027, + "23", + "23.45", + "2.345e1", + "1000", + "1000ABC", + null, + true, + false); for ($i = 0; $i < count($values); $i++) { - $res = atan($values[$i]); - var_dump($res); + $res = atan($values[$i]); + var_dump($res); } ?> diff --git a/ext/standard/tests/math/atanh_basic.phpt b/ext/standard/tests/math/atanh_basic.phpt index 8b994bc5fd..0a7040360b 100644 --- a/ext/standard/tests/math/atanh_basic.phpt +++ b/ext/standard/tests/math/atanh_basic.phpt @@ -16,20 +16,20 @@ echo "atanh 0.46211715726001 = "; var_dump(atanh(0.46211715726001)); if (allowed_rounding_error(atanh(0.46211715726001), 0.5)) { - echo "Pass\n"; + echo "Pass\n"; } else { - echo "Fail\n"; + echo "Fail\n"; } echo "atanh 0.99505475368673 = "; var_dump(atanh(0.99505475368673)); if (allowed_rounding_error(atanh(0.99505475368673), 3.0)) { - echo "Pass\n"; + echo "Pass\n"; } else { - echo "Fail\n"; + echo "Fail\n"; } diff --git a/ext/standard/tests/math/atanh_variation.phpt b/ext/standard/tests/math/atanh_variation.phpt index f14406bb0d..610aaab3fb 100644 --- a/ext/standard/tests/math/atanh_variation.phpt +++ b/ext/standard/tests/math/atanh_variation.phpt @@ -13,23 +13,23 @@ precision = 10 //Test atanh with a different input values $values = array(23, - -23, - 2.345e1, - -2.345e1, - 0x17, - 027, - "23", - "23.45", - "2.345e1", - "1000", - "1000ABC", - null, - true, - false); + -23, + 2.345e1, + -2.345e1, + 0x17, + 027, + "23", + "23.45", + "2.345e1", + "1000", + "1000ABC", + null, + true, + false); for ($i = 0; $i < count($values); $i++) { - $res = atanh($values[$i]); - var_dump($res); + $res = atanh($values[$i]); + var_dump($res); } ?> diff --git a/ext/standard/tests/math/base_convert_basic.phpt b/ext/standard/tests/math/base_convert_basic.phpt index 14767faeea..bdef339f3b 100644 --- a/ext/standard/tests/math/base_convert_basic.phpt +++ b/ext/standard/tests/math/base_convert_basic.phpt @@ -6,26 +6,26 @@ $frombase = array(2,8,10,16,36); $tobase = array(2,8,10,16,36); $values = array(10, - 27, - 39, - 03, - 0x5F, - "10", - "27", - "39", - "5F", - "3XYZ" - ); + 27, + 39, + 03, + 0x5F, + "10", + "27", + "39", + "5F", + "3XYZ" + ); for ($f= 0; $f < count($frombase); $f++) { - echo "\n...from base is ", $frombase[$f], "\n"; - for ($t= 0; $t < count($tobase); $t++) { - echo "......to base is ", $tobase[$t], "\n"; - for ($i =0; $i < count($values); $i++){ - $res = base_convert($values[$i],$frombase[$f],$tobase[$t]); - echo ".........value= ", $values[$i], " res = ", $res, "\n"; - } - } + echo "\n...from base is ", $frombase[$f], "\n"; + for ($t= 0; $t < count($tobase); $t++) { + echo "......to base is ", $tobase[$t], "\n"; + for ($i =0; $i < count($values); $i++){ + $res = base_convert($values[$i],$frombase[$f],$tobase[$t]); + echo ".........value= ", $values[$i], " res = ", $res, "\n"; + } + } } ?> --EXPECTF-- diff --git a/ext/standard/tests/math/base_convert_variation1.phpt b/ext/standard/tests/math/base_convert_variation1.phpt index 00eb9e7585..b0dba2b49b 100644 --- a/ext/standard/tests/math/base_convert_variation1.phpt +++ b/ext/standard/tests/math/base_convert_variation1.phpt @@ -70,9 +70,9 @@ $inputs = array( // loop through each element of $inputs to check the behaviour of base_convert() $iterator = 1; foreach($inputs as $input) { - echo "\n-- Iteration $iterator --\n"; - var_dump(base_convert($input, 10, 8)); - $iterator++; + echo "\n-- Iteration $iterator --\n"; + var_dump(base_convert($input, 10, 8)); + $iterator++; }; fclose($fp); ?> diff --git a/ext/standard/tests/math/bindec_basic.phpt b/ext/standard/tests/math/bindec_basic.phpt index 70c29b6fd2..03eec8ee30 100644 --- a/ext/standard/tests/math/bindec_basic.phpt +++ b/ext/standard/tests/math/bindec_basic.phpt @@ -9,28 +9,28 @@ precision=14 --FILE-- <?php $values = array(111000111, - 011100000, - 1111111111111111111111111111111, - 10000000000000000000000000000000, - 100002001, - '111000111', - '011100000', - '1111111111111111111111111111111', - '10000000000000000000000000000000', - '100002001', - 'abcdefg', - 311015, - 31101.3, - 31.1013e5, - 0x111ABC, - 011237, - true, - false, - null); + 011100000, + 1111111111111111111111111111111, + 10000000000000000000000000000000, + 100002001, + '111000111', + '011100000', + '1111111111111111111111111111111', + '10000000000000000000000000000000', + '100002001', + 'abcdefg', + 311015, + 31101.3, + 31.1013e5, + 0x111ABC, + 011237, + true, + false, + null); for ($i = 0; $i < count($values); $i++) { - $res = bindec($values[$i]); - var_dump($res); + $res = bindec($values[$i]); + var_dump($res); } ?> --EXPECTF-- diff --git a/ext/standard/tests/math/bindec_basic_64bit.phpt b/ext/standard/tests/math/bindec_basic_64bit.phpt index 8408944acb..b8f46b6748 100644 --- a/ext/standard/tests/math/bindec_basic_64bit.phpt +++ b/ext/standard/tests/math/bindec_basic_64bit.phpt @@ -9,28 +9,28 @@ precision=14 --FILE-- <?php $values = array(111000111, - 011100000, - 1111111111111111111111111111111, - 10000000000000000000000000000000, - 100002001, - '111000111', - '011100000', - '1111111111111111111111111111111', - '10000000000000000000000000000000', - '100002001', - 'abcdefg', - 311015, - 31101.3, - 31.1013e5, - 0x111ABC, - 011237, - true, - false, - null); + 011100000, + 1111111111111111111111111111111, + 10000000000000000000000000000000, + 100002001, + '111000111', + '011100000', + '1111111111111111111111111111111', + '10000000000000000000000000000000', + '100002001', + 'abcdefg', + 311015, + 31101.3, + 31.1013e5, + 0x111ABC, + 011237, + true, + false, + null); for ($i = 0; $i < count($values); $i++) { - $res = bindec($values[$i]); - var_dump($res); + $res = bindec($values[$i]); + var_dump($res); } ?> --EXPECTF-- diff --git a/ext/standard/tests/math/bindec_variation1.phpt b/ext/standard/tests/math/bindec_variation1.phpt index f215e8ee26..2b166a3edd 100644 --- a/ext/standard/tests/math/bindec_variation1.phpt +++ b/ext/standard/tests/math/bindec_variation1.phpt @@ -72,13 +72,13 @@ $inputs = array( // loop through each element of $inputs to check the behaviour of bindec() $iterator = 1; foreach($inputs as $input) { - echo "\n-- Iteration $iterator --\n"; - try { - var_dump(bindec($input)); - } catch (TypeError $e) { - echo $e->getMessage(), "\n"; - } - $iterator++; + echo "\n-- Iteration $iterator --\n"; + try { + var_dump(bindec($input)); + } catch (TypeError $e) { + echo $e->getMessage(), "\n"; + } + $iterator++; }; fclose($fp); ?> diff --git a/ext/standard/tests/math/bindec_variation1_64bit.phpt b/ext/standard/tests/math/bindec_variation1_64bit.phpt index 3b5b3e82e0..6784c13601 100644 --- a/ext/standard/tests/math/bindec_variation1_64bit.phpt +++ b/ext/standard/tests/math/bindec_variation1_64bit.phpt @@ -72,13 +72,13 @@ $inputs = array( // loop through each element of $inputs to check the behaviour of bindec() $iterator = 1; foreach($inputs as $input) { - echo "\n-- Iteration $iterator --\n"; - try { - var_dump(bindec($input)); - } catch (TypeError $e) { - echo $e->getMessage(), "\n"; - } - $iterator++; + echo "\n-- Iteration $iterator --\n"; + try { + var_dump(bindec($input)); + } catch (TypeError $e) { + echo $e->getMessage(), "\n"; + } + $iterator++; }; fclose($fp); ?> diff --git a/ext/standard/tests/math/bug24142.phpt b/ext/standard/tests/math/bug24142.phpt index 3696b6e790..947deaebd6 100644 --- a/ext/standard/tests/math/bug24142.phpt +++ b/ext/standard/tests/math/bug24142.phpt @@ -4,8 +4,8 @@ Bug #24142 (round() problems) <?php $v = 0.005; for ($i = 1; $i < 10; $i++) { - echo "round({$v}, 2) -> ".round($v, 2)."\n"; - $v += 0.01; + echo "round({$v}, 2) -> ".round($v, 2)."\n"; + $v += 0.01; } ?> --EXPECT-- diff --git a/ext/standard/tests/math/bug30695.phpt b/ext/standard/tests/math/bug30695.phpt index 938b0e7fc8..a0034892db 100644 --- a/ext/standard/tests/math/bug30695.phpt +++ b/ext/standard/tests/math/bug30695.phpt @@ -2,7 +2,7 @@ Bug #30695 (32 bit issues) --FILE-- <?php - function toUTF8( $char_code ) + function toUTF8( $char_code ) { switch ( $char_code ) { @@ -44,7 +44,7 @@ Bug #30695 (32 bit issues) } - echo "\n", toUTF8(65), "\n", toUTF8(233), "\n", toUTF8(1252), "\n", toUTF8(20095), "\n"; + echo "\n", toUTF8(65), "\n", toUTF8(233), "\n", toUTF8(1252), "\n", toUTF8(20095), "\n"; ?> --EXPECT-- A diff --git a/ext/standard/tests/math/ceil_basic.phpt b/ext/standard/tests/math/ceil_basic.phpt index 61c3dd683d..54b91836d1 100644 --- a/ext/standard/tests/math/ceil_basic.phpt +++ b/ext/standard/tests/math/ceil_basic.phpt @@ -11,30 +11,30 @@ precision=14 echo "*** Testing ceil() : basic functionality ***\n"; $values = array(0, - -0, - 0.5, - -0.5, - 1, - -1, - 1.5, - -1.5, - 2.6, - -2.6, - 037, - 0x5F, - "10.5", - "-10.5", - "3.95E3", - "-3.95E3", - "039", - true, - false, - null, - ); + -0, + 0.5, + -0.5, + 1, + -1, + 1.5, + -1.5, + 2.6, + -2.6, + 037, + 0x5F, + "10.5", + "-10.5", + "3.95E3", + "-3.95E3", + "039", + true, + false, + null, + ); for ($i = 0; $i < count($values); $i++) { - $res = ceil($values[$i]); - var_dump($res); + $res = ceil($values[$i]); + var_dump($res); } ?> diff --git a/ext/standard/tests/math/ceil_variation1.phpt b/ext/standard/tests/math/ceil_variation1.phpt index a6f308d386..815093ea49 100644 --- a/ext/standard/tests/math/ceil_variation1.phpt +++ b/ext/standard/tests/math/ceil_variation1.phpt @@ -66,13 +66,13 @@ $inputs = array( // loop through each element of $inputs to check the behaviour of ceil() $iterator = 1; foreach($inputs as $input) { - echo "\n-- Iteration $iterator --\n"; - try { - var_dump(ceil($input)); - } catch (TypeError $e) { - echo $e->getMessage(), "\n"; - } - $iterator++; + echo "\n-- Iteration $iterator --\n"; + try { + var_dump(ceil($input)); + } catch (TypeError $e) { + echo $e->getMessage(), "\n"; + } + $iterator++; }; fclose($fp); ?> diff --git a/ext/standard/tests/math/cos_basic.phpt b/ext/standard/tests/math/cos_basic.phpt index 863d443830..5e471ae07f 100644 --- a/ext/standard/tests/math/cos_basic.phpt +++ b/ext/standard/tests/math/cos_basic.phpt @@ -26,55 +26,55 @@ $threesixty = M_PI * 2.0; echo "cos 30 = "; var_dump(cos($thirty)); if (allowed_rounding_error(cos($thirty),0.86602540378444)) { - echo "Pass\n"; + echo "Pass\n"; } else { - echo "Fail\n"; + echo "Fail\n"; } echo "cos 60 = "; var_dump(cos($sixty)); if (allowed_rounding_error(cos($sixty),0.5)) { - echo "Pass\n"; + echo "Pass\n"; } else { - echo "Fail\n"; + echo "Fail\n"; } echo "cos 90 = "; var_dump(cos($ninety)); if (allowed_rounding_error(cos($ninety),0.0)) { - echo "Pass\n"; + echo "Pass\n"; } else { - echo "Fail\n"; + echo "Fail\n"; } echo "cos 180 = "; var_dump(cos($oneeighty)); if (allowed_rounding_error(cos($oneeighty),-1.0)) { - echo "Pass\n"; + echo "Pass\n"; } else { - echo "Fail\n"; + echo "Fail\n"; } echo "cos 270 = "; var_dump(cos($twoseventy)); if (allowed_rounding_error(cos($twoseventy),0.0)) { - echo "Pass\n"; + echo "Pass\n"; } else { - echo "Fail\n"; + echo "Fail\n"; } echo "cos 360 = "; var_dump(cos($threesixty)); if (allowed_rounding_error(cos($threesixty),1.0)) { - echo "Pass\n"; + echo "Pass\n"; } else { - echo "Fail\n"; + echo "Fail\n"; } ?> --EXPECTF-- diff --git a/ext/standard/tests/math/cos_variation.phpt b/ext/standard/tests/math/cos_variation.phpt index f9d1b26246..da92b6aafe 100644 --- a/ext/standard/tests/math/cos_variation.phpt +++ b/ext/standard/tests/math/cos_variation.phpt @@ -13,23 +13,23 @@ precision = 10 //Test cos with a different input values $values = array(23, - -23, - 2.345e1, - -2.345e1, - 0x17, - 027, - "23", - "23.45", - "2.345e1", - "1000", - "1000ABC", - null, - true, - false); + -23, + 2.345e1, + -2.345e1, + 0x17, + 027, + "23", + "23.45", + "2.345e1", + "1000", + "1000ABC", + null, + true, + false); for ($i = 0; $i < count($values); $i++) { - $res = cos($values[$i]); - var_dump($res); + $res = cos($values[$i]); + var_dump($res); } ?> diff --git a/ext/standard/tests/math/cosh_basic.phpt b/ext/standard/tests/math/cosh_basic.phpt index 5b52fb2a63..620bbbebcd 100644 --- a/ext/standard/tests/math/cosh_basic.phpt +++ b/ext/standard/tests/math/cosh_basic.phpt @@ -16,37 +16,37 @@ echo "cosh .5 = "; var_dump(cosh(0.5)); if (allowed_rounding_error(cosh(0.5),1.1276259652064)){ - echo "Pass\n"; + echo "Pass\n"; } else { - echo "Fail\n"; + echo "Fail\n"; } echo "cosh -0.5 = "; var_dump(cosh(-0.5)); if (allowed_rounding_error(cosh(-0.5),1.1276259652064)){ - echo "Pass\n"; + echo "Pass\n"; } else { - echo "Fail\n"; + echo "Fail\n"; } echo "cosh 3 = "; var_dump(cosh(3.0)); if (allowed_rounding_error(cosh(3.0), 10.067661995778)){ - echo "Pass\n"; + echo "Pass\n"; } else { - echo "Fail\n"; + echo "Fail\n"; } echo "cosh -3 = "; var_dump(cosh(-3.0)); if (allowed_rounding_error(cosh(-3.0), 10.067661995778)){ - echo "Pass\n"; + echo "Pass\n"; } else { - echo "Fail\n"; + echo "Fail\n"; } ?> diff --git a/ext/standard/tests/math/cosh_variation.phpt b/ext/standard/tests/math/cosh_variation.phpt index ec58c0151f..a0b3b60f19 100644 --- a/ext/standard/tests/math/cosh_variation.phpt +++ b/ext/standard/tests/math/cosh_variation.phpt @@ -13,23 +13,23 @@ precision = 10 //Test cosh with a different input values $values = array(23, - -23, - 2.345e1, - -2.345e1, - 0x17, - 027, - "23", - "23.45", - "2.345e1", - "1000", - "1000ABC", - null, - true, - false); + -23, + 2.345e1, + -2.345e1, + 0x17, + 027, + "23", + "23.45", + "2.345e1", + "1000", + "1000ABC", + null, + true, + false); for ($i = 0; $i < count($values); $i++) { - $res = cosh($values[$i]); - var_dump($res); + $res = cosh($values[$i]); + var_dump($res); } ?> diff --git a/ext/standard/tests/math/decbin_basic.phpt b/ext/standard/tests/math/decbin_basic.phpt index b067030a48..da681dfbe8 100644 --- a/ext/standard/tests/math/decbin_basic.phpt +++ b/ext/standard/tests/math/decbin_basic.phpt @@ -3,23 +3,23 @@ Test decbin() - basic function test --FILE-- <?php $values = array(10, - 3950.5, - 3.9505e3, - 03, - 0x5F, - "10", - "3950.5", - "3.9505e3", - "039", - "0x5F", - true, - false, - null, - ); + 3950.5, + 3.9505e3, + 03, + 0x5F, + "10", + "3950.5", + "3.9505e3", + "039", + "0x5F", + true, + false, + null, + ); for ($i = 0; $i < count($values); $i++) { - $res = decbin($values[$i]); - var_dump($res); + $res = decbin($values[$i]); + var_dump($res); } ?> --EXPECT-- diff --git a/ext/standard/tests/math/decbin_variation1.phpt b/ext/standard/tests/math/decbin_variation1.phpt index 46b509be3b..581e88b283 100644 --- a/ext/standard/tests/math/decbin_variation1.phpt +++ b/ext/standard/tests/math/decbin_variation1.phpt @@ -84,9 +84,9 @@ $inputs = array( // loop through each element of $inputs to check the behaviour of decbin() $iterator = 1; foreach($inputs as $input) { - echo "\n-- Iteration $iterator --\n"; - var_dump(decbin($input)); - $iterator++; + echo "\n-- Iteration $iterator --\n"; + var_dump(decbin($input)); + $iterator++; }; fclose($fp); ?> diff --git a/ext/standard/tests/math/decbin_variation1_64bit.phpt b/ext/standard/tests/math/decbin_variation1_64bit.phpt index 589c954651..91f79aaecb 100644 --- a/ext/standard/tests/math/decbin_variation1_64bit.phpt +++ b/ext/standard/tests/math/decbin_variation1_64bit.phpt @@ -84,9 +84,9 @@ $inputs = array( // loop through each element of $inputs to check the behaviour of decbin() $iterator = 1; foreach($inputs as $input) { - echo "\n-- Iteration $iterator --\n"; - var_dump(decbin($input)); - $iterator++; + echo "\n-- Iteration $iterator --\n"; + var_dump(decbin($input)); + $iterator++; }; fclose($fp); ?> diff --git a/ext/standard/tests/math/dechex_basic.phpt b/ext/standard/tests/math/dechex_basic.phpt index 9f6328c24a..690e2a9842 100644 --- a/ext/standard/tests/math/dechex_basic.phpt +++ b/ext/standard/tests/math/dechex_basic.phpt @@ -3,23 +3,23 @@ Test dechex() - basic function dechex() --FILE-- <?php $values = array(10, - 3950.5, - 3.9505e3, - 03, - 0x5F, - "10", - "3950.5", - "3.9505e3", - "039", - "0x5F", - true, - false, - null, - ); + 3950.5, + 3.9505e3, + 03, + 0x5F, + "10", + "3950.5", + "3.9505e3", + "039", + "0x5F", + true, + false, + null, + ); for ($i = 0; $i < count($values); $i++) { - $res = dechex($values[$i]); - var_dump($res); + $res = dechex($values[$i]); + var_dump($res); } ?> --EXPECT-- diff --git a/ext/standard/tests/math/dechex_variation1.phpt b/ext/standard/tests/math/dechex_variation1.phpt index e2a3e4ed67..fd1ea6def1 100644 --- a/ext/standard/tests/math/dechex_variation1.phpt +++ b/ext/standard/tests/math/dechex_variation1.phpt @@ -84,9 +84,9 @@ $inputs = array( // loop through each element of $inputs to check the behaviour of dechex() $iterator = 1; foreach($inputs as $input) { - echo "\n-- Iteration $iterator --\n"; - var_dump(dechex($input)); - $iterator++; + echo "\n-- Iteration $iterator --\n"; + var_dump(dechex($input)); + $iterator++; }; fclose($fp); ?> diff --git a/ext/standard/tests/math/dechex_variation1_64bit.phpt b/ext/standard/tests/math/dechex_variation1_64bit.phpt index 6d186fa008..a566001d62 100644 --- a/ext/standard/tests/math/dechex_variation1_64bit.phpt +++ b/ext/standard/tests/math/dechex_variation1_64bit.phpt @@ -84,9 +84,9 @@ $inputs = array( // loop through each element of $inputs to check the behaviour of dechex() $iterator = 1; foreach($inputs as $input) { - echo "\n-- Iteration $iterator --\n"; - var_dump(dechex($input)); - $iterator++; + echo "\n-- Iteration $iterator --\n"; + var_dump(dechex($input)); + $iterator++; }; fclose($fp); ?> diff --git a/ext/standard/tests/math/decoct_basic.phpt b/ext/standard/tests/math/decoct_basic.phpt index 19bda37bff..46418df67d 100644 --- a/ext/standard/tests/math/decoct_basic.phpt +++ b/ext/standard/tests/math/decoct_basic.phpt @@ -3,23 +3,23 @@ Test decoct() - basic function test decoct() --FILE-- <?php $values = array(10, - 3950.5, - 3.9505e3, - 03, - 0x5F, - "10", - "3950.5", - "3.9505e3", - "039", - "0x5F", - true, - false, - null, - ); + 3950.5, + 3.9505e3, + 03, + 0x5F, + "10", + "3950.5", + "3.9505e3", + "039", + "0x5F", + true, + false, + null, + ); for ($i = 0; $i < count($values); $i++) { - $res = decoct($values[$i]); - var_dump($res); + $res = decoct($values[$i]); + var_dump($res); } ?> --EXPECT-- diff --git a/ext/standard/tests/math/decoct_variation1.phpt b/ext/standard/tests/math/decoct_variation1.phpt index ad6c63f0dc..174fddf470 100644 --- a/ext/standard/tests/math/decoct_variation1.phpt +++ b/ext/standard/tests/math/decoct_variation1.phpt @@ -85,9 +85,9 @@ $inputs = array( // loop through each element of $inputs to check the behaviour of decoct() $iterator = 1; foreach($inputs as $input) { - echo "\n-- Iteration $iterator --\n"; - var_dump(decoct($input)); - $iterator++; + echo "\n-- Iteration $iterator --\n"; + var_dump(decoct($input)); + $iterator++; }; fclose($fp); ?> diff --git a/ext/standard/tests/math/decoct_variation1_64bit.phpt b/ext/standard/tests/math/decoct_variation1_64bit.phpt index 0a35475883..2ff2c4c48e 100644 --- a/ext/standard/tests/math/decoct_variation1_64bit.phpt +++ b/ext/standard/tests/math/decoct_variation1_64bit.phpt @@ -85,9 +85,9 @@ $inputs = array( // loop through each element of $inputs to check the behaviour of decoct() $iterator = 1; foreach($inputs as $input) { - echo "\n-- Iteration $iterator --\n"; - var_dump(decoct($input)); - $iterator++; + echo "\n-- Iteration $iterator --\n"; + var_dump(decoct($input)); + $iterator++; }; fclose($fp); ?> diff --git a/ext/standard/tests/math/deg2rad_basic.phpt b/ext/standard/tests/math/deg2rad_basic.phpt index 6db1be4da8..ea1eba6ddf 100644 --- a/ext/standard/tests/math/deg2rad_basic.phpt +++ b/ext/standard/tests/math/deg2rad_basic.phpt @@ -22,38 +22,38 @@ echo "deg2rad $arg_0 = "; $r0 = deg2rad($arg_0); var_dump($r0); if (allowed_rounding_error($r0 ,0 )) { - echo "Pass\n"; + echo "Pass\n"; } else { - echo "Fail\n"; + echo "Fail\n"; } echo "deg2rad $arg_1 = "; $r1 = deg2rad($arg_1); var_dump($r1); if (allowed_rounding_error($r1 ,1.5707963267949 )) { - echo "Pass\n"; + echo "Pass\n"; } else { - echo "Fail\n"; + echo "Fail\n"; } echo "deg2rad $arg_2 = "; $r2 = deg2rad($arg_2); var_dump($r2); if (allowed_rounding_error($r2 ,3.1415926535898 )) { - echo "Pass\n"; + echo "Pass\n"; } else { - echo "Fail\n"; + echo "Fail\n"; } echo "deg2rad $arg_3 = "; $r3 = deg2rad($arg_3); var_dump($r3); if (allowed_rounding_error($r3 ,6.2831853071796 )) { - echo "Pass\n"; + echo "Pass\n"; } else { - echo "Fail\n"; + echo "Fail\n"; } ?> --EXPECTF-- diff --git a/ext/standard/tests/math/deg2rad_variation.phpt b/ext/standard/tests/math/deg2rad_variation.phpt index eb3c7eae0e..3e344540a2 100644 --- a/ext/standard/tests/math/deg2rad_variation.phpt +++ b/ext/standard/tests/math/deg2rad_variation.phpt @@ -13,23 +13,23 @@ precision = 10 //Test deg2rad with a different input values $values = array(23, - -23, - 2.345e1, - -2.345e1, - 0x17, - 027, - "23", - "23.45", - "2.345e1", - "1000", - "1000ABC", - null, - true, - false); + -23, + 2.345e1, + -2.345e1, + 0x17, + 027, + "23", + "23.45", + "2.345e1", + "1000", + "1000ABC", + null, + true, + false); for ($i = 0; $i < count($values); $i++) { - $res = deg2rad($values[$i]); - var_dump($res); + $res = deg2rad($values[$i]); + var_dump($res); } ?> diff --git a/ext/standard/tests/math/exp_basic.phpt b/ext/standard/tests/math/exp_basic.phpt index ba53e22f28..b73889153f 100644 --- a/ext/standard/tests/math/exp_basic.phpt +++ b/ext/standard/tests/math/exp_basic.phpt @@ -5,24 +5,24 @@ precision=14 --FILE-- <?php $values = array(10, - 10.3, - 3.9505e3, - 037, - 0x5F, - "10", - "3950.5", - "3.9505e3", - "039", - true, - false, - null, - ); + 10.3, + 3.9505e3, + 037, + 0x5F, + "10", + "3950.5", + "3.9505e3", + "039", + true, + false, + null, + ); $iterator = 1; foreach($values as $value) { - echo "\n-- Iteration $iterator --\n"; - var_dump(exp($value)); - $iterator++; + echo "\n-- Iteration $iterator --\n"; + var_dump(exp($value)); + $iterator++; }; ?> diff --git a/ext/standard/tests/math/expm1_basic.phpt b/ext/standard/tests/math/expm1_basic.phpt index 9e926b869d..296838570c 100644 --- a/ext/standard/tests/math/expm1_basic.phpt +++ b/ext/standard/tests/math/expm1_basic.phpt @@ -12,25 +12,25 @@ precision=14 echo "*** Testing expm1() : basic functionality ***\n"; $values = array(10, - 10.3, - 3.9505e3, - 037, - 0x5F, - "10", - "3950.5", - "3.9505e3", - "039", - true, - false, - null, - ); + 10.3, + 3.9505e3, + 037, + 0x5F, + "10", + "3950.5", + "3.9505e3", + "039", + true, + false, + null, + ); // loop through each element of $values to check the behaviour of expm1() $iterator = 1; foreach($values as $value) { - echo "\n-- Iteration $iterator --\n"; - var_dump(expm1($value)); - $iterator++; + echo "\n-- Iteration $iterator --\n"; + var_dump(expm1($value)); + $iterator++; }; ?> --EXPECT-- diff --git a/ext/standard/tests/math/floor_basic.phpt b/ext/standard/tests/math/floor_basic.phpt index c5d2fc46b1..84153af08e 100644 --- a/ext/standard/tests/math/floor_basic.phpt +++ b/ext/standard/tests/math/floor_basic.phpt @@ -11,30 +11,30 @@ precision=14 echo "*** Testing floor() : basic functionality ***\n"; $values = array(0, - -0, - 0.5, - -0.5, - 1, - -1, - 1.5, - -1.5, - 2.6, - -2.6, - 037, - 0x5F, - "10.5", - "-10.5", - "3.95E3", - "-3.95E3", - "039", - true, - false, - null, - ); + -0, + 0.5, + -0.5, + 1, + -1, + 1.5, + -1.5, + 2.6, + -2.6, + 037, + 0x5F, + "10.5", + "-10.5", + "3.95E3", + "-3.95E3", + "039", + true, + false, + null, + ); foreach($values as $value) { - echo "\n-- floor $value --\n"; - var_dump(floor($value)); + echo "\n-- floor $value --\n"; + var_dump(floor($value)); }; ?> diff --git a/ext/standard/tests/math/floor_variation1.phpt b/ext/standard/tests/math/floor_variation1.phpt index 6774816ead..dd0e70b863 100644 --- a/ext/standard/tests/math/floor_variation1.phpt +++ b/ext/standard/tests/math/floor_variation1.phpt @@ -66,13 +66,13 @@ $inputs = array( // loop through each element of $inputs to check the behaviour of floor() $iterator = 1; foreach($inputs as $input) { - echo "\n-- Iteration $iterator --\n"; - try { - var_dump(floor($input)); - } catch (TypeError $e) { - echo $e->getMessage(), "\n"; - } - $iterator++; + echo "\n-- Iteration $iterator --\n"; + try { + var_dump(floor($input)); + } catch (TypeError $e) { + echo $e->getMessage(), "\n"; + } + $iterator++; }; fclose($fp); ?> diff --git a/ext/standard/tests/math/fmod_basic.phpt b/ext/standard/tests/math/fmod_basic.phpt index 875ae8dd05..e7b204f540 100644 --- a/ext/standard/tests/math/fmod_basic.phpt +++ b/ext/standard/tests/math/fmod_basic.phpt @@ -5,37 +5,37 @@ precision=14 --FILE-- <?php $values1 = array(234, - -234, - 23.45e1, - -23.45e1, - 0xEA, - 0352, - "234", - "234.5", - "23.45e1", - null, - true, - false); + -234, + 23.45e1, + -23.45e1, + 0xEA, + 0352, + "234", + "234.5", + "23.45e1", + null, + true, + false); $values2 = array(2, - -2, - 2.3e1, - -2.3e1, - 0x2, - 02, - "2", - "2.3", - "2.3e1", - null, - true, - false); + -2, + 2.3e1, + -2.3e1, + 0x2, + 02, + "2", + "2.3", + "2.3e1", + null, + true, + false); for ($i = 0; $i < count($values1); $i++) { - echo "\niteration ", $i, "\n"; + echo "\niteration ", $i, "\n"; - for ($j = 0; $j < count($values2); $j++) { - $res = fmod($values1[$i], $values2[$j]); - var_dump($res); - } + for ($j = 0; $j < count($values2); $j++) { + $res = fmod($values1[$i], $values2[$j]); + var_dump($res); + } } ?> --EXPECT-- diff --git a/ext/standard/tests/math/fmod_basiclong_64bit.phpt b/ext/standard/tests/math/fmod_basiclong_64bit.phpt index e949aab00a..5ef283689e 100644 --- a/ext/standard/tests/math/fmod_basiclong_64bit.phpt +++ b/ext/standard/tests/math/fmod_basiclong_64bit.phpt @@ -23,7 +23,7 @@ $otherVals = array(0, 1, -1, 7, 9, 65, -44, MAX_32Bit, MIN_32Bit, MAX_64Bit, MIN foreach ($longVals as $longVal) { foreach($otherVals as $otherVal) { - echo "--- testing: $longVal, $otherVal ---\n"; + echo "--- testing: $longVal, $otherVal ---\n"; var_dump(fmod($longVal, $otherVal)); } } diff --git a/ext/standard/tests/math/hexdec_basic.phpt b/ext/standard/tests/math/hexdec_basic.phpt index 0ca2342d81..748c641a1a 100644 --- a/ext/standard/tests/math/hexdec_basic.phpt +++ b/ext/standard/tests/math/hexdec_basic.phpt @@ -7,26 +7,26 @@ if (PHP_INT_SIZE != 4) die("skip this test is for 32bit platform only"); --FILE-- <?php $values = array(0x123abc, - 0x789DEF, - 0x7FFFFFFF, - 0x80000000, - '0x123abc', - '0x789DEF', - '0x7FFFFFFF', - '0x80000000', - '0x123XYZABC', - 311015, - '311015', - 31101.3, - 31.1013e5, - 011237, - '011237', - true, - false, - null); + 0x789DEF, + 0x7FFFFFFF, + 0x80000000, + '0x123abc', + '0x789DEF', + '0x7FFFFFFF', + '0x80000000', + '0x123XYZABC', + 311015, + '311015', + 31101.3, + 31.1013e5, + 011237, + '011237', + true, + false, + null); for ($i = 0; $i < count($values); $i++) { - $res = hexdec($values[$i]); - var_dump($res); + $res = hexdec($values[$i]); + var_dump($res); } ?> --EXPECTF-- diff --git a/ext/standard/tests/math/hexdec_basic_64bit.phpt b/ext/standard/tests/math/hexdec_basic_64bit.phpt index bb8c3d3f27..c7c59451f5 100644 --- a/ext/standard/tests/math/hexdec_basic_64bit.phpt +++ b/ext/standard/tests/math/hexdec_basic_64bit.phpt @@ -9,27 +9,27 @@ if (PHP_INT_SIZE != 8) die("skip this test is for 64bit platform only"); echo "*** Testing hexdec() : basic functionality ***\n"; $values = array(0x123abc, - 0x789DEF, - 0x7FFFFFFF, - 0x80000000, - '0x123abc', - '0x789DEF', - '0x7FFFFFFF', - '0x80000000', - '0x123XYZABC', - 311015, - '311015', - 31101.3, - 31.1013e5, - 011237, - '011237', - true, - false, - null); + 0x789DEF, + 0x7FFFFFFF, + 0x80000000, + '0x123abc', + '0x789DEF', + '0x7FFFFFFF', + '0x80000000', + '0x123XYZABC', + 311015, + '311015', + 31101.3, + 31.1013e5, + 011237, + '011237', + true, + false, + null); foreach($values as $value) { - echo "\n-- hexdec $value --\n"; - var_dump(hexdec($value)); + echo "\n-- hexdec $value --\n"; + var_dump(hexdec($value)); }; ?> diff --git a/ext/standard/tests/math/hexdec_variation1.phpt b/ext/standard/tests/math/hexdec_variation1.phpt index d395f8a8f1..c50c550f61 100644 --- a/ext/standard/tests/math/hexdec_variation1.phpt +++ b/ext/standard/tests/math/hexdec_variation1.phpt @@ -76,13 +76,13 @@ $inputs = array( // loop through each element of $inputs to check the behaviour of hexdec() $iterator = 1; foreach($inputs as $input) { - echo "\n-- Iteration $iterator --\n"; - try { - var_dump(hexdec($input)); - } catch (TypeError $e) { - echo $e->getMessage(), "\n"; - } - $iterator++; + echo "\n-- Iteration $iterator --\n"; + try { + var_dump(hexdec($input)); + } catch (TypeError $e) { + echo $e->getMessage(), "\n"; + } + $iterator++; }; fclose($fp); ?> diff --git a/ext/standard/tests/math/hexdec_variation1_64bit.phpt b/ext/standard/tests/math/hexdec_variation1_64bit.phpt index 35c17f727a..d3b22d8040 100644 --- a/ext/standard/tests/math/hexdec_variation1_64bit.phpt +++ b/ext/standard/tests/math/hexdec_variation1_64bit.phpt @@ -76,13 +76,13 @@ $inputs = array( // loop through each element of $inputs to check the behaviour of hexdec() $iterator = 1; foreach($inputs as $input) { - echo "\n-- Iteration $iterator --\n"; - try { - var_dump(hexdec($input)); - } catch (TypeError $e) { - echo $e->getMessage(), "\n"; - } - $iterator++; + echo "\n-- Iteration $iterator --\n"; + try { + var_dump(hexdec($input)); + } catch (TypeError $e) { + echo $e->getMessage(), "\n"; + } + $iterator++; }; fclose($fp); ?> diff --git a/ext/standard/tests/math/hypot_basic.phpt b/ext/standard/tests/math/hypot_basic.phpt index 796c160810..f9e5787f40 100644 --- a/ext/standard/tests/math/hypot_basic.phpt +++ b/ext/standard/tests/math/hypot_basic.phpt @@ -13,39 +13,39 @@ precision=14 echo "*** Testing hypot() : basic functionality ***\n"; $valuesy = array(23, - -23, - 2.345e1, - -2.345e1, - 0x17, - 027, - "23", - "23.45", - "2.345e1", - "23abc", - null, - true, - false); + -23, + 2.345e1, + -2.345e1, + 0x17, + 027, + "23", + "23.45", + "2.345e1", + "23abc", + null, + true, + false); $valuesx = array(33, - -33, - 3.345e1, - -3.345e1, - 0x27, - 037, - "33", - "43.45", - "1.345e1", - "33abc", - null, - true, - false); + -33, + 3.345e1, + -3.345e1, + 0x27, + 037, + "33", + "43.45", + "1.345e1", + "33abc", + null, + true, + false); for ($i = 0; $i < count($valuesy); $i++) { - for ($j = 0; $j < count($valuesx); $j++) { - echo "\nY:$valuesy[$i] X:$valuesx[$j] "; - $res = hypot($valuesy[$i], $valuesx[$j]); - var_dump($res); - } + for ($j = 0; $j < count($valuesx); $j++) { + echo "\nY:$valuesy[$i] X:$valuesx[$j] "; + $res = hypot($valuesy[$i], $valuesx[$j]); + var_dump($res); + } } ?> --EXPECTF-- diff --git a/ext/standard/tests/math/hypot_basiclong_64bit.phpt b/ext/standard/tests/math/hypot_basiclong_64bit.phpt index 9a0b71ffc1..1e1ca60996 100644 --- a/ext/standard/tests/math/hypot_basiclong_64bit.phpt +++ b/ext/standard/tests/math/hypot_basiclong_64bit.phpt @@ -23,7 +23,7 @@ $otherVals = array(0, 1, -1, 7, 9, 65, -44, MAX_32Bit, MIN_32Bit, MAX_64Bit, MIN foreach ($longVals as $longVal) { foreach($otherVals as $otherVal) { - echo "--- testing: $longVal, $otherVal ---\n"; + echo "--- testing: $longVal, $otherVal ---\n"; var_dump(hypot($longVal, $otherVal)); } } diff --git a/ext/standard/tests/math/is_finite_basic.phpt b/ext/standard/tests/math/is_finite_basic.phpt index 11db785ae4..9ee9d544e3 100644 --- a/ext/standard/tests/math/is_finite_basic.phpt +++ b/ext/standard/tests/math/is_finite_basic.phpt @@ -3,23 +3,23 @@ Test is_finite() - basic function test is_finite() --FILE-- <?php $values = array(234, - -234, - 23.45e1, - -23.45e1, - 0xEA, - 0352, - "234", - "234.5", - "23.45e1", - null, - true, - false, - pow(0, -2), - acos(1.01)); + -234, + 23.45e1, + -23.45e1, + 0xEA, + 0352, + "234", + "234.5", + "23.45e1", + null, + true, + false, + pow(0, -2), + acos(1.01)); ; for ($i = 0; $i < count($values); $i++) { - $res = is_finite($values[$i]); - var_dump($res); + $res = is_finite($values[$i]); + var_dump($res); } ?> --EXPECT-- diff --git a/ext/standard/tests/math/is_infinite_basic.phpt b/ext/standard/tests/math/is_infinite_basic.phpt index 4f90340311..076f202c14 100644 --- a/ext/standard/tests/math/is_infinite_basic.phpt +++ b/ext/standard/tests/math/is_infinite_basic.phpt @@ -3,23 +3,23 @@ Test is_infinite() - basic function test is_infinite() --FILE-- <?php $values = array(234, - -234, - 23.45e1, - -23.45e1, - 0xEA, - 0352, - "234", - "234.5", - "23.45e1", - null, - true, - false, - pow(0, -2), - acos(1.01)); + -234, + 23.45e1, + -23.45e1, + 0xEA, + 0352, + "234", + "234.5", + "23.45e1", + null, + true, + false, + pow(0, -2), + acos(1.01)); ; for ($i = 0; $i < count($values); $i++) { - $res = is_infinite($values[$i]); - var_dump($res); + $res = is_infinite($values[$i]); + var_dump($res); } ?> --EXPECT-- diff --git a/ext/standard/tests/math/is_nan_basic.phpt b/ext/standard/tests/math/is_nan_basic.phpt index 49d2ce4ccf..fabc40b97b 100644 --- a/ext/standard/tests/math/is_nan_basic.phpt +++ b/ext/standard/tests/math/is_nan_basic.phpt @@ -3,24 +3,24 @@ Test is_nan() - basic function test is_nan() --FILE-- <?php $values = array(234, - -234, - 23.45e1, - -23.45e1, - 0xEA, - 0352, - "234", - "234.5", - "23.45e1", - null, - true, - false, - pow(0, -2), - acos(1.01)); + -234, + 23.45e1, + -23.45e1, + 0xEA, + 0352, + "234", + "234.5", + "23.45e1", + null, + true, + false, + pow(0, -2), + acos(1.01)); for ($i = 0; $i < count($values); $i++) { - $res = is_nan($values[$i]); - var_dump($res); + $res = is_nan($values[$i]); + var_dump($res); } ?> diff --git a/ext/standard/tests/math/lcg_value_basic.phpt b/ext/standard/tests/math/lcg_value_basic.phpt index 7660f67c24..95811c6f3c 100644 --- a/ext/standard/tests/math/lcg_value_basic.phpt +++ b/ext/standard/tests/math/lcg_value_basic.phpt @@ -8,17 +8,17 @@ echo "MATHS test script started\n"; echo "\n lcg_value tests...\n"; for ($i = 0; $i < 100; $i++) { - $res = lcg_value(); + $res = lcg_value(); - if (!is_float($res) || $res < 0 || $res > 1) { - break; - } + if (!is_float($res) || $res < 0 || $res > 1) { + break; + } } if ($i != 100) { - echo "FAILED\n"; + echo "FAILED\n"; } else { - echo "PASSED\n"; + echo "PASSED\n"; } echo "MATHS test script completed\n"; diff --git a/ext/standard/tests/math/log10_basic.phpt b/ext/standard/tests/math/log10_basic.phpt index b81284faf2..0997d3db4b 100644 --- a/ext/standard/tests/math/log10_basic.phpt +++ b/ext/standard/tests/math/log10_basic.phpt @@ -20,30 +20,30 @@ echo "log10 $arg_0 = "; $r0 = log10($arg_0); var_dump($r0); if (allowed_rounding_error($r0 ,0.0 )) { - echo "Pass\n"; + echo "Pass\n"; } else { - echo "Fail\n"; + echo "Fail\n"; } echo "log10 $arg_1 = "; $r1 = log10($arg_1); var_dump($r1); if (allowed_rounding_error($r1 ,1.0 )) { - echo "Pass\n"; + echo "Pass\n"; } else { - echo "Fail\n"; + echo "Fail\n"; } echo "log10 $arg_2 = "; $r2 = log10($arg_2); var_dump($r2); if (allowed_rounding_error($r2 ,2.0 )) { - echo "Pass\n"; + echo "Pass\n"; } else { - echo "Fail\n"; + echo "Fail\n"; } ?> --EXPECTF-- diff --git a/ext/standard/tests/math/log10_variation.phpt b/ext/standard/tests/math/log10_variation.phpt index 8dbea47a84..e852d82ea9 100644 --- a/ext/standard/tests/math/log10_variation.phpt +++ b/ext/standard/tests/math/log10_variation.phpt @@ -13,23 +13,23 @@ precision = 10 //Test log10 with a different input values $values = array(23, - -23, - 2.345e1, - -2.345e1, - 0x17, - 027, - "23", - "23.45", - "2.345e1", - "1000", - "1000ABC", - null, - true, - false); + -23, + 2.345e1, + -2.345e1, + 0x17, + 027, + "23", + "23.45", + "2.345e1", + "1000", + "1000ABC", + null, + true, + false); for ($i = 0; $i < count($values); $i++) { - $res = log10($values[$i]); - var_dump($res); + $res = log10($values[$i]); + var_dump($res); } ?> diff --git a/ext/standard/tests/math/log1p_basic.phpt b/ext/standard/tests/math/log1p_basic.phpt index 2b8c7f8cc5..115deec1d9 100644 --- a/ext/standard/tests/math/log1p_basic.phpt +++ b/ext/standard/tests/math/log1p_basic.phpt @@ -13,23 +13,23 @@ precision=14 echo "*** Testing log1p() : basic functionality ***\n"; $values = array(23, - -23, - 2.345e1, - -2.345e1, - 0x17, - 027, - "23", - "23.45", - "2.345e1", - null, - true, - false); + -23, + 2.345e1, + -2.345e1, + 0x17, + 027, + "23", + "23.45", + "2.345e1", + null, + true, + false); echo "\n LOG1p tests\n"; foreach($values as $value) { - echo "\n-- log1p $value --\n"; - var_dump(log1p($value)); + echo "\n-- log1p $value --\n"; + var_dump(log1p($value)); }; diff --git a/ext/standard/tests/math/log_basic.phpt b/ext/standard/tests/math/log_basic.phpt index de97ee264b..8ff1c88ccf 100644 --- a/ext/standard/tests/math/log_basic.phpt +++ b/ext/standard/tests/math/log_basic.phpt @@ -5,28 +5,28 @@ precision=14 --FILE-- <?php $values = array(23, - -23, - 2.345e1, - -2.345e1, - 0x17, - 027, - "23", - "23.45", - "2.345e1", - null, - true, - false); + -23, + 2.345e1, + -2.345e1, + 0x17, + 027, + "23", + "23.45", + "2.345e1", + null, + true, + false); echo "\n LOG tests...no base\n"; for ($i = 0; $i < count($values); $i++) { - $res = log($values[$i]); - var_dump($res); + $res = log($values[$i]); + var_dump($res); } echo "\n LOG tests...base\n"; for ($i = 0; $i < count($values); $i++) { - $res = log($values[$i], 4); - var_dump($res); + $res = log($values[$i], 4); + var_dump($res); } ?> --EXPECT-- diff --git a/ext/standard/tests/math/mt_rand_basic.phpt b/ext/standard/tests/math/mt_rand_basic.phpt index 3a1e4406eb..24050bbc8a 100644 --- a/ext/standard/tests/math/mt_rand_basic.phpt +++ b/ext/standard/tests/math/mt_rand_basic.phpt @@ -6,77 +6,77 @@ $default_max = mt_getrandmax(); echo "\nmt_rand() tests with default min and max value (i.e 0 thru ", $default_max, ")\n"; for ($i = 0; $i < 100; $i++) { - $res = mt_rand(); + $res = mt_rand(); // By default RAND_MAX is 32768 although no constant is defined for it for user space apps - if (!is_int($res) || $res < 0 || $res > $default_max) { - break; - } + if (!is_int($res) || $res < 0 || $res > $default_max) { + break; + } } if ($i != 100) { - echo "FAILED: res = ", $res, " min = 0 max = ", $default_max, "\n"; + echo "FAILED: res = ", $res, " min = 0 max = ", $default_max, "\n"; } else { - echo "PASSED: range min = 0 max = ", $default_max, "\n"; + echo "PASSED: range min = 0 max = ", $default_max, "\n"; } echo "\nmt_rand() tests with defined min and max value\n"; $min = array(10, - 100, - 10.5, - 10.5e3, - 0x10, - 0400); + 100, + 10.5, + 10.5e3, + 0x10, + 0400); $max = array(100, - 1000, - 19.5, - 10.5e5, - 0x10000, - 0700); + 1000, + 19.5, + 10.5e5, + 0x10000, + 0700); for ($x = 0; $x < count($min); $x++) { - for ($i = 0; $i < 100; $i++) { - $res = mt_rand($min[$x], $max[$x]); + for ($i = 0; $i < 100; $i++) { + $res = mt_rand($min[$x], $max[$x]); - if (!is_int($res) || $res < intval($min[$x]) || $res > intval($max[$x])) { - echo "FAILED: res = ", $res, " min = ", intval($min[$x]), " max = ", intval($max[$x]), "\n"; - break; - } - } + if (!is_int($res) || $res < intval($min[$x]) || $res > intval($max[$x])) { + echo "FAILED: res = ", $res, " min = ", intval($min[$x]), " max = ", intval($max[$x]), "\n"; + break; + } + } - if ($i == 100) { - echo "PASSED: range min = ", intval($min[$x]), " max = ", intval($max[$x]), "\n"; - } + if ($i == 100) { + echo "PASSED: range min = ", intval($min[$x]), " max = ", intval($max[$x]), "\n"; + } } echo "\nNon-numeric cases\n"; $min = array(true, - false, - null, - "10", - "10.5"); + false, + null, + "10", + "10.5"); // Expected numerical equivalent of above non-numerics $minval = array(1, - 0, - 0, - 10, - 10); + 0, + 0, + 10, + 10); for ($x = 0; $x < count($min); $x++) { - for ($i = 0; $i < 100; $i++) { - $res = mt_rand($min[$x], 100); + for ($i = 0; $i < 100; $i++) { + $res = mt_rand($min[$x], 100); - if (!is_int($res) || $res < intval($minval[$x]) || $res > 100) { - echo "FAILED: res = ", $res, " min = ", intval($min[$x]), " max = ", intval($max[$x]), "\n"; - break; - } - } + if (!is_int($res) || $res < intval($minval[$x]) || $res > 100) { + echo "FAILED: res = ", $res, " min = ", intval($min[$x]), " max = ", intval($max[$x]), "\n"; + break; + } + } - if ($i == 100) { - echo "PASSED range min = ", intval($min[$x]), " max = 100\n"; - } + if ($i == 100) { + echo "PASSED range min = ", intval($min[$x]), " max = 100\n"; + } } ?> --EXPECT-- diff --git a/ext/standard/tests/math/number_format_basic.phpt b/ext/standard/tests/math/number_format_basic.phpt index 5a2570126a..b82ad5c753 100644 --- a/ext/standard/tests/math/number_format_basic.phpt +++ b/ext/standard/tests/math/number_format_basic.phpt @@ -3,40 +3,40 @@ Test number_format() - basic function test number_format() --FILE-- <?php $values = array(1234.5678, - -1234.5678, - 1234.6578e4, - -1234.56789e4, - 0x1234CDEF, - 02777777777, - "123456789", - "123.456789", - "12.3456789e1", - null, - true, - false); + -1234.5678, + 1234.6578e4, + -1234.56789e4, + 0x1234CDEF, + 02777777777, + "123456789", + "123.456789", + "12.3456789e1", + null, + true, + false); echo "\n number_format tests.....default\n"; for ($i = 0; $i < count($values); $i++) { - $res = number_format($values[$i]); - var_dump($res); + $res = number_format($values[$i]); + var_dump($res); } echo "\n number_format tests.....with two dp\n"; for ($i = 0; $i < count($values); $i++) { - $res = number_format($values[$i], 2); - var_dump($res); + $res = number_format($values[$i], 2); + var_dump($res); } echo "\n number_format tests.....English format\n"; for ($i = 0; $i < count($values); $i++) { - $res = number_format($values[$i], 2, '.', ' '); - var_dump($res); + $res = number_format($values[$i], 2, '.', ' '); + var_dump($res); } echo "\n number_format tests.....French format\n"; for ($i = 0; $i < count($values); $i++) { - $res = number_format($values[$i], 2, ',' , ' '); - var_dump($res); + $res = number_format($values[$i], 2, ',' , ' '); + var_dump($res); } ?> --EXPECT-- diff --git a/ext/standard/tests/math/number_format_multichar.phpt b/ext/standard/tests/math/number_format_multichar.phpt index b12c81c1a2..5648257e03 100644 --- a/ext/standard/tests/math/number_format_multichar.phpt +++ b/ext/standard/tests/math/number_format_multichar.phpt @@ -3,34 +3,34 @@ Test number_format() - multiple character separator support --FILE-- <?php $values = array(1234.5678, - -1234.5678, - 1234.6578e4, - -1234.56789e4, - 0x1234CDEF, - 02777777777, - "123456789", - "123.456789", - "12.3456789e1", - null, - true, - false); + -1234.5678, + 1234.6578e4, + -1234.56789e4, + 0x1234CDEF, + 02777777777, + "123456789", + "123.456789", + "12.3456789e1", + null, + true, + false); echo " number_format tests.....multiple character decimal point\n"; for ($i = 0; $i < count($values); $i++) { - $res = number_format($values[$i], 2, '·', ' '); - var_dump($res); + $res = number_format($values[$i], 2, '·', ' '); + var_dump($res); } echo "\n number_format tests.....multiple character thousand separator\n"; for ($i = 0; $i < count($values); $i++) { - $res = number_format($values[$i], 2, '.' , ' '); - var_dump($res); + $res = number_format($values[$i], 2, '.' , ' '); + var_dump($res); } echo "\n number_format tests.....multiple character decimal and thousep\n"; for ($i = 0; $i < count($values); $i++) { - $res = number_format($values[$i], 2, '·' , ' '); - var_dump($res); + $res = number_format($values[$i], 2, '·' , ' '); + var_dump($res); } ?> --EXPECT-- diff --git a/ext/standard/tests/math/octdec_basic.phpt b/ext/standard/tests/math/octdec_basic.phpt index c31af55673..1daf9a4338 100644 --- a/ext/standard/tests/math/octdec_basic.phpt +++ b/ext/standard/tests/math/octdec_basic.phpt @@ -7,26 +7,26 @@ if (PHP_INT_SIZE != 4) die("skip this test is for 32bit platform only"); --FILE-- <?php $values = array(01234567, - 0567, - 017777777777, - 020000000000, - 0x1234ABC, - 12345, - '01234567', - '0567', - '017777777777', - '020000000000', - '0x1234ABC', - '12345', - 31101.3, - 31.1013e5, - true, - false, - null); + 0567, + 017777777777, + 020000000000, + 0x1234ABC, + 12345, + '01234567', + '0567', + '017777777777', + '020000000000', + '0x1234ABC', + '12345', + 31101.3, + 31.1013e5, + true, + false, + null); for ($i = 0; $i < count($values); $i++) { - $res = octdec($values[$i]); - var_dump($res); + $res = octdec($values[$i]); + var_dump($res); } ?> --EXPECTF-- diff --git a/ext/standard/tests/math/octdec_basic_64bit.phpt b/ext/standard/tests/math/octdec_basic_64bit.phpt index 6401fdff3c..bb8f70085d 100644 --- a/ext/standard/tests/math/octdec_basic_64bit.phpt +++ b/ext/standard/tests/math/octdec_basic_64bit.phpt @@ -10,26 +10,26 @@ if (PHP_INT_SIZE != 8) die("skip this test is for 64bit platform only"); echo "*** Testing octdec() : basic functionality ***\n"; $values = array(01234567, - 0567, - 017777777777, - 020000000000, - 0x1234ABC, - 12345, - '01234567', - '0567', - '017777777777', - '020000000000', - '0x1234ABC', - '12345', - 31101.3, - 31.1013e5, - true, - false, - null); + 0567, + 017777777777, + 020000000000, + 0x1234ABC, + 12345, + '01234567', + '0567', + '017777777777', + '020000000000', + '0x1234ABC', + '12345', + 31101.3, + 31.1013e5, + true, + false, + null); for ($i = 0; $i < count($values); $i++) { - $res = octdec($values[$i]); - var_dump($res); + $res = octdec($values[$i]); + var_dump($res); } ?> --EXPECTF-- diff --git a/ext/standard/tests/math/octdec_variation1.phpt b/ext/standard/tests/math/octdec_variation1.phpt index b59b3b71eb..48e4faf466 100644 --- a/ext/standard/tests/math/octdec_variation1.phpt +++ b/ext/standard/tests/math/octdec_variation1.phpt @@ -72,13 +72,13 @@ $inputs = array( // loop through each element of $inputs to check the behaviour of octdec() $iterator = 1; foreach($inputs as $input) { - echo "\n-- Iteration $iterator --\n"; - try { - var_dump(octdec($input)); - } catch (TypeError $e) { - echo $e->getMessage(), "\n"; - } - $iterator++; + echo "\n-- Iteration $iterator --\n"; + try { + var_dump(octdec($input)); + } catch (TypeError $e) { + echo $e->getMessage(), "\n"; + } + $iterator++; }; fclose($fp); ?> diff --git a/ext/standard/tests/math/pow.phpt b/ext/standard/tests/math/pow.phpt index 534ecbd58f..e8ee73135e 100644 --- a/ext/standard/tests/math/pow.phpt +++ b/ext/standard/tests/math/pow.phpt @@ -6,7 +6,7 @@ Various pow() tests define('LONG_MAX', is_int(5000000000)? 9223372036854775807 : 0x7FFFFFFF); define('LONG_MIN', -LONG_MAX - 1); printf("%d,%d,%d,%d\n",is_int(LONG_MIN ),is_int(LONG_MAX ), - is_int(LONG_MIN-1),is_int(LONG_MAX+1)); + is_int(LONG_MIN-1),is_int(LONG_MAX+1)); $tests = <<<TESTS 0.25 === pow(-2,-2) diff --git a/ext/standard/tests/math/pow_basic.phpt b/ext/standard/tests/math/pow_basic.phpt index e23dac3fb4..bc594b27c6 100644 --- a/ext/standard/tests/math/pow_basic.phpt +++ b/ext/standard/tests/math/pow_basic.phpt @@ -9,18 +9,18 @@ if (PHP_INT_SIZE != 4) die("skip this test is for 32bit platform only"); --FILE-- <?php $bases = array(23, - -23, - 23.1, - -23.1, - 2.345e1, - -2.345e1, - 0x17, - 027, - "23", - "23.45", - "2.345e1", - PHP_INT_MAX, - -PHP_INT_MAX - 1); + -23, + 23.1, + -23.1, + 2.345e1, + -2.345e1, + 0x17, + 027, + "23", + "23.45", + "2.345e1", + PHP_INT_MAX, + -PHP_INT_MAX - 1); $exponents = array(0, 1, @@ -34,16 +34,16 @@ $exponents = array(0, 500, -500, 2147483647, - -2147483648); + -2147483648); foreach($bases as $base) { - echo "\n\nBase = $base"; - foreach($exponents as $exponent) { - echo "\n..... Exponent = $exponent Result = "; - $res = pow($base, $exponent); - echo $res; - } - echo "\n\n"; + echo "\n\nBase = $base"; + foreach($exponents as $exponent) { + echo "\n..... Exponent = $exponent Result = "; + $res = pow($base, $exponent); + echo $res; + } + echo "\n\n"; } ?> --EXPECT-- diff --git a/ext/standard/tests/math/pow_basic_64bit.phpt b/ext/standard/tests/math/pow_basic_64bit.phpt index 3dc37c4774..95ecd8c487 100644 --- a/ext/standard/tests/math/pow_basic_64bit.phpt +++ b/ext/standard/tests/math/pow_basic_64bit.phpt @@ -9,18 +9,18 @@ if (PHP_INT_SIZE != 8) die("skip this test is for 64bit platform only"); --FILE-- <?php $bases = array(23, - -23, - 23.1, - -23.1, - 2.345e1, - -2.345e1, - 0x17, - 027, - "23", - "23.45", - "2.345e1", - PHP_INT_MAX, - -PHP_INT_MAX - 1); + -23, + 23.1, + -23.1, + 2.345e1, + -2.345e1, + 0x17, + 027, + "23", + "23.45", + "2.345e1", + PHP_INT_MAX, + -PHP_INT_MAX - 1); $exponents = array(0, 1, @@ -34,16 +34,16 @@ $exponents = array(0, 500, -500, 2147483647, - -2147483648); + -2147483648); foreach($bases as $base) { - echo "\n\nBase = $base"; - foreach($exponents as $exponent) { - echo "\n..... Exponent = $exponent Result = "; - $res = pow($base, $exponent); - echo $res; - } - echo "\n\n"; + echo "\n\nBase = $base"; + foreach($exponents as $exponent) { + echo "\n..... Exponent = $exponent Result = "; + $res = pow($base, $exponent); + echo $res; + } + echo "\n\n"; } ?> --EXPECT-- diff --git a/ext/standard/tests/math/pow_basiclong_64bit.phpt b/ext/standard/tests/math/pow_basiclong_64bit.phpt index ff661c3a9a..d955edfcf3 100644 --- a/ext/standard/tests/math/pow_basiclong_64bit.phpt +++ b/ext/standard/tests/math/pow_basiclong_64bit.phpt @@ -23,7 +23,7 @@ $otherVals = array(0, 1, -1, 7, 9, 65, -44, MAX_32Bit, MIN_32Bit, MAX_64Bit, MIN foreach ($longVals as $longVal) { foreach($otherVals as $otherVal) { - echo "--- testing: $longVal, $otherVal ---\n"; + echo "--- testing: $longVal, $otherVal ---\n"; var_dump(pow($longVal, $otherVal)); } } diff --git a/ext/standard/tests/math/rad2deg_basic.phpt b/ext/standard/tests/math/rad2deg_basic.phpt index d09f376151..df5f837422 100644 --- a/ext/standard/tests/math/rad2deg_basic.phpt +++ b/ext/standard/tests/math/rad2deg_basic.phpt @@ -21,37 +21,37 @@ echo "rad2deg $arg_0= "; $r0 = rad2deg($arg_0); var_dump($r0); if (allowed_rounding_error($r0 ,0 )) { - echo "Pass\n"; + echo "Pass\n"; } else { - echo "Fail\n"; + echo "Fail\n"; } echo "rad2deg $arg_1 = "; $r1 = rad2deg($arg_1); var_dump($r1); if (allowed_rounding_error($r1 ,90.000000011752)) { - echo "Pass\n"; + echo "Pass\n"; } else { - echo "Fail\n"; + echo "Fail\n"; } echo "rad2deg $arg_2 = "; $r2 = rad2deg($arg_2); var_dump($r2); if (allowed_rounding_error($r2 ,180.0000000235 )) { - echo "Pass\n"; + echo "Pass\n"; } else { - echo "Fail\n"; + echo "Fail\n"; } echo "rad2deg $arg_3 = "; $r3 = rad2deg($arg_3); var_dump($r3); if (allowed_rounding_error($r3 ,359.99999998971 )) { - echo "Pass\n"; + echo "Pass\n"; } else { - echo "Fail\n"; + echo "Fail\n"; } ?> --EXPECTF-- diff --git a/ext/standard/tests/math/rad2deg_variation.phpt b/ext/standard/tests/math/rad2deg_variation.phpt index 6ea7d0c8a4..7144f18b61 100644 --- a/ext/standard/tests/math/rad2deg_variation.phpt +++ b/ext/standard/tests/math/rad2deg_variation.phpt @@ -13,23 +13,23 @@ precision = 10 //Test rad2deg with a different input values $values = array(23, - -23, - 2.345e1, - -2.345e1, - 0x17, - 027, - "23", - "23.45", - "2.345e1", - "1000", - "1000ABC", - null, - true, - false); + -23, + 2.345e1, + -2.345e1, + 0x17, + 027, + "23", + "23.45", + "2.345e1", + "1000", + "1000ABC", + null, + true, + false); for ($i = 0; $i < count($values); $i++) { - $res = rad2deg($values[$i]); - var_dump($res); + $res = rad2deg($values[$i]); + var_dump($res); } ?> diff --git a/ext/standard/tests/math/rand_basic.phpt b/ext/standard/tests/math/rand_basic.phpt index fbaab3c9af..87e9d7cd42 100644 --- a/ext/standard/tests/math/rand_basic.phpt +++ b/ext/standard/tests/math/rand_basic.phpt @@ -6,77 +6,77 @@ $default_max = getrandmax(); echo "\nrand() tests with default min and max value (i.e 0 thru ", $default_max, ")\n"; for ($i = 0; $i < 100; $i++) { - $res = rand(); + $res = rand(); // By default RAND_MAX is 32768 although no constant is defined for it for user space apps - if (!is_int($res) || $res < 0 || $res > $default_max) { - break; - } + if (!is_int($res) || $res < 0 || $res > $default_max) { + break; + } } if ($i != 100) { - echo "FAILED: res = ", $res, " min = 0 max = ", $default_max, "\n"; + echo "FAILED: res = ", $res, " min = 0 max = ", $default_max, "\n"; } else { - echo "PASSED: range min = 0 max = ", $default_max, "\n"; + echo "PASSED: range min = 0 max = ", $default_max, "\n"; } echo "\nrand() tests with defined min and max value\n"; $min = array(10, - 100, - 10.5, - 10.5e3, - 0x10, - 0400); + 100, + 10.5, + 10.5e3, + 0x10, + 0400); $max = array(100, - 1000, - 19.5, - 10.5e5, - 0x10000, - 0700); + 1000, + 19.5, + 10.5e5, + 0x10000, + 0700); for ($x = 0; $x < count($min); $x++) { - for ($i = 0; $i < 100; $i++) { - $res = rand($min[$x], $max[$x]); + for ($i = 0; $i < 100; $i++) { + $res = rand($min[$x], $max[$x]); - if (!is_int($res) || $res < intval($min[$x]) || $res > intval($max[$x])) { - echo "FAILED: res = ", $res, " min = ", intval($min[$x]), " max = ", intval($max[$x]), "\n"; - break; - } - } + if (!is_int($res) || $res < intval($min[$x]) || $res > intval($max[$x])) { + echo "FAILED: res = ", $res, " min = ", intval($min[$x]), " max = ", intval($max[$x]), "\n"; + break; + } + } - if ($i == 100) { - echo "PASSED: range min = ", intval($min[$x]), " max = ", intval($max[$x]), "\n"; - } + if ($i == 100) { + echo "PASSED: range min = ", intval($min[$x]), " max = ", intval($max[$x]), "\n"; + } } echo "\nNon-numeric cases\n"; $min = array(true, - false, - null, - "10", - "10.5"); + false, + null, + "10", + "10.5"); // Eexepcted numerical equivalent of above non-numerics $minval = array(1, - 0, - 0, - 10, - 10); + 0, + 0, + 10, + 10); for ($x = 0; $x < count($min); $x++) { - for ($i = 0; $i < 100; $i++) { - $res = rand($min[$x], 100); + for ($i = 0; $i < 100; $i++) { + $res = rand($min[$x], 100); - if (!is_int($res) || $res < intval($minval[$x]) || $res > 100) { - echo "FAILED: res = ", $res, " min = ", intval($min[$x]), " max = ", intval($max[$x]), "\n"; - break; - } - } + if (!is_int($res) || $res < intval($minval[$x]) || $res > 100) { + echo "FAILED: res = ", $res, " min = ", intval($min[$x]), " max = ", intval($max[$x]), "\n"; + break; + } + } - if ($i == 100) { - echo "PASSED range min = ", intval($min[$x]), " max = 100\n"; - } + if ($i == 100) { + echo "PASSED range min = ", intval($min[$x]), " max = 100\n"; + } } ?> --EXPECTF-- diff --git a/ext/standard/tests/math/round.phpt b/ext/standard/tests/math/round.phpt index 16255c0a30..f78d2757c2 100644 --- a/ext/standard/tests/math/round.phpt +++ b/ext/standard/tests/math/round.phpt @@ -6,7 +6,7 @@ Simple math tests define('LONG_MAX', is_int(5000000000)? 9223372036854775807 : 0x7FFFFFFF); define('LONG_MIN', -LONG_MAX - 1); printf("%d,%d,%d,%d\n",is_int(LONG_MIN ),is_int(LONG_MAX ), - is_int(LONG_MIN-1),is_int(LONG_MAX+1)); + is_int(LONG_MIN-1),is_int(LONG_MAX+1)); $tests = <<<TESTS -1 ~== ceil(-1.5) diff --git a/ext/standard/tests/math/round_basic.phpt b/ext/standard/tests/math/round_basic.phpt index 912529433e..70d5ae4806 100644 --- a/ext/standard/tests/math/round_basic.phpt +++ b/ext/standard/tests/math/round_basic.phpt @@ -13,35 +13,35 @@ precision=14 echo "*** Testing round() : basic functionality ***\n"; $values = array(123456789, - 123.456789, - -4.5679123, - 1.23E4, - -4.567E3, - 0x234567, - 067777777, - "1.234567", - "2.3456789e8"); + 123.456789, + -4.5679123, + 1.23E4, + -4.567E3, + 0x234567, + 067777777, + "1.234567", + "2.3456789e8"); $precision = array(2, - 8, - 0x3, - 04, - 3.6, - "2", - "04", - "3.6", - "2.1e1", - null, - true, - false); + 8, + 0x3, + 04, + 3.6, + "2", + "04", + "3.6", + "2.1e1", + null, + true, + false); for ($i = 0; $i < count($values); $i++) { - echo "round: $values[$i]\n"; - for ($j = 0; $j < count($precision); $j++) { - $res = round($values[$i], $precision[$j]); - echo "...with precision $precision[$j]-> "; - var_dump($res); - } + echo "round: $values[$i]\n"; + for ($j = 0; $j < count($precision); $j++) { + $res = round($values[$i], $precision[$j]); + echo "...with precision $precision[$j]-> "; + var_dump($res); + } } ?> --EXPECT-- diff --git a/ext/standard/tests/math/sin_basic.phpt b/ext/standard/tests/math/sin_basic.phpt index f9be13bec9..7c5b787a7a 100644 --- a/ext/standard/tests/math/sin_basic.phpt +++ b/ext/standard/tests/math/sin_basic.phpt @@ -26,55 +26,55 @@ $threesixty = M_PI * 2.0; echo "sin 30 = "; var_dump(sin($thirty)); if (allowed_rounding_error(sin($thirty),0.5)) { - echo "Pass\n"; + echo "Pass\n"; } else { - echo "Fail\n"; + echo "Fail\n"; } echo "sin 60 = "; var_dump(sin($sixty)); if (allowed_rounding_error(sin($sixty),0.86602540378444)) { - echo "Pass\n"; + echo "Pass\n"; } else { - echo "Fail\n"; + echo "Fail\n"; } echo "sin 90 = "; var_dump(sin($ninety)); if (allowed_rounding_error(sin($ninety),1.0)) { - echo "Pass\n"; + echo "Pass\n"; } else { - echo "Fail\n"; + echo "Fail\n"; } echo "sin 180 = "; var_dump(sin($oneeighty)); if (allowed_rounding_error(sin($oneeighty),0.0)) { - echo "Pass\n"; + echo "Pass\n"; } else { - echo "Fail\n"; + echo "Fail\n"; } echo "sin 270 = "; var_dump(sin($twoseventy)); if (allowed_rounding_error(sin($twoseventy),-1.0)) { - echo "Pass\n"; + echo "Pass\n"; } else { - echo "Fail\n"; + echo "Fail\n"; } echo "sin 360 = "; var_dump(sin($threesixty)); if (allowed_rounding_error(sin($threesixty),0.0)) { - echo "Pass\n"; + echo "Pass\n"; } else { - echo "Fail\n"; + echo "Fail\n"; } ?> --EXPECTF-- diff --git a/ext/standard/tests/math/sin_variation.phpt b/ext/standard/tests/math/sin_variation.phpt index d044a16b40..bad70c710d 100644 --- a/ext/standard/tests/math/sin_variation.phpt +++ b/ext/standard/tests/math/sin_variation.phpt @@ -13,23 +13,23 @@ precision = 10 //Test sin with a different input values $values = array(23, - -23, - 2.345e1, - -2.345e1, - 0x17, - 027, - "23", - "23.45", - "2.345e1", - "1000", - "1000ABC", - null, - true, - false); + -23, + 2.345e1, + -2.345e1, + 0x17, + 027, + "23", + "23.45", + "2.345e1", + "1000", + "1000ABC", + null, + true, + false); for ($i = 0; $i < count($values); $i++) { - $res = sin($values[$i]); - var_dump($res); + $res = sin($values[$i]); + var_dump($res); } ?> diff --git a/ext/standard/tests/math/sinh_basic.phpt b/ext/standard/tests/math/sinh_basic.phpt index 8d16e1712e..0cdd8f1179 100644 --- a/ext/standard/tests/math/sinh_basic.phpt +++ b/ext/standard/tests/math/sinh_basic.phpt @@ -15,37 +15,37 @@ require($file_path."/allowed_rounding_error.inc"); echo "sinh .5 = "; var_dump(sinh(0.5)); if (allowed_rounding_error(sinh(0.5),0.52109530549375)){ - echo "Pass\n"; + echo "Pass\n"; } else { - echo "Fail\n"; + echo "Fail\n"; } echo "sinh -0.5 = "; var_dump(sinh(-0.5)); if (allowed_rounding_error(sinh(-0.5), -0.52109530549375)){ - echo "Pass\n"; + echo "Pass\n"; } else { - echo "Fail\n"; + echo "Fail\n"; } echo "sinh 3 = "; var_dump(sinh(3.0)); if (allowed_rounding_error(sinh(3.0), 10.01787492741)){ - echo "Pass\n"; + echo "Pass\n"; } else { - echo "Fail\n"; + echo "Fail\n"; } echo "sinh -3 = "; var_dump(sinh(-3.0)); if (allowed_rounding_error(sinh(-3.0), -10.01787492741)){ - echo "Pass\n"; + echo "Pass\n"; } else { - echo "Fail\n"; + echo "Fail\n"; } ?> diff --git a/ext/standard/tests/math/sinh_variation.phpt b/ext/standard/tests/math/sinh_variation.phpt index 5e576f447f..5b3a79ca78 100644 --- a/ext/standard/tests/math/sinh_variation.phpt +++ b/ext/standard/tests/math/sinh_variation.phpt @@ -13,23 +13,23 @@ precision = 10 //Test sinh with a different input values $values = array(23, - -23, - 2.345e1, - -2.345e1, - 0x17, - 027, - "23", - "23.45", - "2.345e1", - "1000", - "1000ABC", - null, - true, - false); + -23, + 2.345e1, + -2.345e1, + 0x17, + 027, + "23", + "23.45", + "2.345e1", + "1000", + "1000ABC", + null, + true, + false); for ($i = 0; $i < count($values); $i++) { - $res = sinh($values[$i]); - var_dump($res); + $res = sinh($values[$i]); + var_dump($res); } ?> diff --git a/ext/standard/tests/math/sqrt_variation.phpt b/ext/standard/tests/math/sqrt_variation.phpt index 696596cefa..75c460db7a 100644 --- a/ext/standard/tests/math/sqrt_variation.phpt +++ b/ext/standard/tests/math/sqrt_variation.phpt @@ -14,23 +14,23 @@ precision = 14 echo "*** Testing sqrt() : usage variations ***\n"; $values = array(23, - -23, - 2.345e1, - -2.345e1, - 0x17, - 027, - "23", - "23.45", - "2.345e1", - "1000", - "1000ABC", - null, - true, - false); + -23, + 2.345e1, + -2.345e1, + 0x17, + 027, + "23", + "23.45", + "2.345e1", + "1000", + "1000ABC", + null, + true, + false); for ($i = 0; $i < count($values); $i++) { - $res = sqrt($values[$i]); - var_dump($res); + $res = sqrt($values[$i]); + var_dump($res); } ?> diff --git a/ext/standard/tests/math/tan_basic.phpt b/ext/standard/tests/math/tan_basic.phpt index a4d95d77b0..15e7848c48 100644 --- a/ext/standard/tests/math/tan_basic.phpt +++ b/ext/standard/tests/math/tan_basic.phpt @@ -18,19 +18,19 @@ $thirty = M_PI / 6.0; echo "tan 60 = "; var_dump(tan($sixty)); if (allowed_rounding_error(tan($sixty),1.7320508075689)) { - echo "Pass\n"; + echo "Pass\n"; } else { - echo "Fail\n"; + echo "Fail\n"; } echo "tan 30 = "; var_dump(tan($thirty)); if (allowed_rounding_error(tan($thirty),0.57735026918963)) { - echo "Pass\n"; + echo "Pass\n"; } else { - echo "Fail\n"; + echo "Fail\n"; } ?> diff --git a/ext/standard/tests/math/tan_variation.phpt b/ext/standard/tests/math/tan_variation.phpt index 2c9ede4738..1575e24694 100644 --- a/ext/standard/tests/math/tan_variation.phpt +++ b/ext/standard/tests/math/tan_variation.phpt @@ -13,23 +13,23 @@ precision = 10 //Test tan with a different input values $values = array(23, - -23, - 2.345e1, - -2.345e1, - 0x17, - 027, - "23", - "23.45", - "2.345e1", - "1000", - "1000ABC", - null, - true, - false); + -23, + 2.345e1, + -2.345e1, + 0x17, + 027, + "23", + "23.45", + "2.345e1", + "1000", + "1000ABC", + null, + true, + false); for ($i = 0; $i < count($values); $i++) { - $res = tan($values[$i]); - var_dump($res); + $res = tan($values[$i]); + var_dump($res); } ?> diff --git a/ext/standard/tests/math/tanh_basic.phpt b/ext/standard/tests/math/tanh_basic.phpt index 472d88b94e..d8288843a1 100644 --- a/ext/standard/tests/math/tanh_basic.phpt +++ b/ext/standard/tests/math/tanh_basic.phpt @@ -15,37 +15,37 @@ require($file_path."/allowed_rounding_error.inc"); echo "tanh .5 = "; var_dump(tanh(0.5)); if (allowed_rounding_error(tanh(0.5), 0.46211715726001)) { - echo "Pass\n"; + echo "Pass\n"; } else { - echo "Fail\n"; + echo "Fail\n"; } echo "tanh -0.5 = "; var_dump(tanh(-0.5)); if (allowed_rounding_error(tanh(-0.5), -0.46211715726001)) { - echo "Pass\n"; + echo "Pass\n"; } else { - echo "Fail\n"; + echo "Fail\n"; } echo "tanh 3 = "; var_dump(tanh(3.0)); if (allowed_rounding_error(tanh(3.0),0.99505475368673 )) { - echo "Pass\n"; + echo "Pass\n"; } else { - echo "Fail\n"; + echo "Fail\n"; } echo "tanh -3 = "; var_dump(tanh(-3.0)); if (allowed_rounding_error(tanh(-3.0),-0.99505475368673 )) { - echo "Pass\n"; + echo "Pass\n"; } else { - echo "Fail\n"; + echo "Fail\n"; } ?> diff --git a/ext/standard/tests/math/tanh_variation.phpt b/ext/standard/tests/math/tanh_variation.phpt index 907f802b8a..502130c5d4 100644 --- a/ext/standard/tests/math/tanh_variation.phpt +++ b/ext/standard/tests/math/tanh_variation.phpt @@ -13,23 +13,23 @@ precision = 10 //Test tanh with a different input values $values = array(23, - -23, - 2.345e1, - -2.345e1, - 0x17, - 027, - "23", - "23.45", - "2.345e1", - "1000", - "1000ABC", - null, - true, - false); + -23, + 2.345e1, + -2.345e1, + 0x17, + 027, + "23", + "23.45", + "2.345e1", + "1000", + "1000ABC", + null, + true, + false); for ($i = 0; $i < count($values); $i++) { - $res = tanh($values[$i]); - var_dump($res); + $res = tanh($values[$i]); + var_dump($res); } ?> diff --git a/ext/standard/tests/misc/browsernames.inc b/ext/standard/tests/misc/browsernames.inc index cac8f9a782..fe4350e222 100644 --- a/ext/standard/tests/misc/browsernames.inc +++ b/ext/standard/tests/misc/browsernames.inc @@ -4,48 +4,48 @@ * Common browser names. Used with: get_browser() */ return array( - "Opera/7.11 (Windows NT 5.1; U) [en]", - "Mozilla/4.0 (compatible; MSIE 6.0; MSIE 5.5; Windows NT 5.0) Opera 7.02 Bork-edition [en]", - "Mozilla/4.0 (compatible; MSIE 6.0; MSIE 5.5; Windows NT 4.0) Opera 7.0 [en]", - "Mozilla/4.0 (compatible; MSIE 5.0; Windows 2000) Opera 6.0 [en]", - "Mozilla/4.0 (compatible; MSIE 5.0; Mac_PowerPC) Opera 5.0 [en]", - "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1) Opera 8.60 [en]", - "Opera/9.00 (Windows NT 5.1; U; en)", - "Opera/9.26 (Macintosh; PPC Mac OS X; U; en)", + "Opera/7.11 (Windows NT 5.1; U) [en]", + "Mozilla/4.0 (compatible; MSIE 6.0; MSIE 5.5; Windows NT 5.0) Opera 7.02 Bork-edition [en]", + "Mozilla/4.0 (compatible; MSIE 6.0; MSIE 5.5; Windows NT 4.0) Opera 7.0 [en]", + "Mozilla/4.0 (compatible; MSIE 5.0; Windows 2000) Opera 6.0 [en]", + "Mozilla/4.0 (compatible; MSIE 5.0; Mac_PowerPC) Opera 5.0 [en]", + "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1) Opera 8.60 [en]", + "Opera/9.00 (Windows NT 5.1; U; en)", + "Opera/9.26 (Macintosh; PPC Mac OS X; U; en)", - "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; Q312461)", - "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; .NET CLR 1.0.3705)", - "Mozilla/4.0 (compatible; MSIE 5.22; Mac_PowerPC)", - "Mozilla/4.0 (compatible; MSIE 5.0; Mac_PowerPC; e504460WanadooNL)", - "Mozilla/4.0 (Mozilla/4.0; MSIE 7.0; Windows NT 5.1; FDM; SV1; .NET CLR 3.0.04506.30)", - "Mozilla/4.0 (Mozilla/4.0; MSIE 7.0; Windows NT 5.1; FDM; SV1)", - "Mozilla/4.0 (compatible;MSIE 7.0;Windows NT 6.0)", + "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; Q312461)", + "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; .NET CLR 1.0.3705)", + "Mozilla/4.0 (compatible; MSIE 5.22; Mac_PowerPC)", + "Mozilla/4.0 (compatible; MSIE 5.0; Mac_PowerPC; e504460WanadooNL)", + "Mozilla/4.0 (Mozilla/4.0; MSIE 7.0; Windows NT 5.1; FDM; SV1; .NET CLR 3.0.04506.30)", + "Mozilla/4.0 (Mozilla/4.0; MSIE 7.0; Windows NT 5.1; FDM; SV1)", + "Mozilla/4.0 (compatible;MSIE 7.0;Windows NT 6.0)", - "Mozilla/5.0 (Macintosh; U; PPC Mac OS X; en-us) AppleWebKit/74 (KHTML, like Gecko) Safari/74", - "Mozilla/5.0 (Macintosh; U; PPC Mac OS X; en) AppleWebKit/51 (like Gecko) Safari/51", - "Mozilla/5.0 (Windows; U; Windows NT 6.0; en) AppleWebKit/522.11.3 (KHTML, like Gecko) Version/3.0 Safari/522.11.3", - "Mozilla/5.0 (iPhone; U; CPU like Mac OS X; en) AppleWebKit/420+ (KHTML, like Gecko) Version/3.0 Mobile/1C28 Safari/419.3", - "Mozilla/5.0 (iPod; U; CPU like Mac OS X; en) AppleWebKit/420.1 (KHTML, like Gecko) Version/3.0 Mobile/3A100a Safari/419.3", - "Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_4_11; ru-ru) AppleWebKit/525.18 (KHTML, like Gecko) Version/3.1.1 Safari/525.18", - "Mozilla/5.0 (Windows; U; Windows NT 5.1; en) AppleWebKit/526.9 (KHTML, like Gecko) Version/4.0dp1 Safari/526.8", - "Mozilla/5.0 (Macintosh; U; PPC Mac OS X Mach-O; en; rv:1.8.1.12) Gecko/20080206 Camino/1.5.5", + "Mozilla/5.0 (Macintosh; U; PPC Mac OS X; en-us) AppleWebKit/74 (KHTML, like Gecko) Safari/74", + "Mozilla/5.0 (Macintosh; U; PPC Mac OS X; en) AppleWebKit/51 (like Gecko) Safari/51", + "Mozilla/5.0 (Windows; U; Windows NT 6.0; en) AppleWebKit/522.11.3 (KHTML, like Gecko) Version/3.0 Safari/522.11.3", + "Mozilla/5.0 (iPhone; U; CPU like Mac OS X; en) AppleWebKit/420+ (KHTML, like Gecko) Version/3.0 Mobile/1C28 Safari/419.3", + "Mozilla/5.0 (iPod; U; CPU like Mac OS X; en) AppleWebKit/420.1 (KHTML, like Gecko) Version/3.0 Mobile/3A100a Safari/419.3", + "Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_4_11; ru-ru) AppleWebKit/525.18 (KHTML, like Gecko) Version/3.1.1 Safari/525.18", + "Mozilla/5.0 (Windows; U; Windows NT 5.1; en) AppleWebKit/526.9 (KHTML, like Gecko) Version/4.0dp1 Safari/526.8", + "Mozilla/5.0 (Macintosh; U; PPC Mac OS X Mach-O; en; rv:1.8.1.12) Gecko/20080206 Camino/1.5.5", - "Mozilla/5.0 (compatible; Konqueror/3.1; Linux; X11; i686)", - "Mozilla/5.0 (compatible; Konqueror/3.1; Linux 2.4.19-32mdkenterprise; X11; i686; ar, en_US)", - "Mozilla/5.0 (compatible; Konqueror/2.1.1; X11)", + "Mozilla/5.0 (compatible; Konqueror/3.1; Linux; X11; i686)", + "Mozilla/5.0 (compatible; Konqueror/3.1; Linux 2.4.19-32mdkenterprise; X11; i686; ar, en_US)", + "Mozilla/5.0 (compatible; Konqueror/2.1.1; X11)", - "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.4b) Gecko/20030504 Mozilla", - "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.2a) Gecko/20020910", - "Mozilla/5.0 (X11; U; Linux 2.4.3-20mdk i586; en-US; rv:0.9.1) Gecko/20010611", - "Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.9) Gecko/20050711", - "Mozilla/5.0 (Windows; U; Windows NT 5.1; cs; rv:1.9) Gecko/2008052906", + "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.4b) Gecko/20030504 Mozilla", + "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.2a) Gecko/20020910", + "Mozilla/5.0 (X11; U; Linux 2.4.3-20mdk i586; en-US; rv:0.9.1) Gecko/20010611", + "Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.9) Gecko/20050711", + "Mozilla/5.0 (Windows; U; Windows NT 5.1; cs; rv:1.9) Gecko/2008052906", - "Mozilla/5.0 (Windows; U; WinNT4.0; en-US; rv:1.3a) Gecko/20021207 Phoenix/0.5", - "Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.4b) Gecko/20030516 Mozilla Firebird/0.6", - "Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.4a) Gecko/20030423 Firebird Browser/0.6", - "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.6) Gecko/20040206 Firefox/0.8", - "Mozilla/5.0 (Windows 98; U; en; rv:1.8.0) Gecko/20060728 Firefox/1.5.0", - "Mozilla/5.0 (Macintosh; PPC Mac OS X; U; en; rv:1.8.0) Gecko/20060728 Firefox/1.5.0", - "Mozilla/5.0 (X11; U; SunOS sun4u; en-US; rv:1.8.1.12) Gecko/20080210 Firefox/2.0.0.12", - "Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.8.1.12) Gecko/20080214 Firefox/2.0.0.12", + "Mozilla/5.0 (Windows; U; WinNT4.0; en-US; rv:1.3a) Gecko/20021207 Phoenix/0.5", + "Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.4b) Gecko/20030516 Mozilla Firebird/0.6", + "Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.4a) Gecko/20030423 Firebird Browser/0.6", + "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.6) Gecko/20040206 Firefox/0.8", + "Mozilla/5.0 (Windows 98; U; en; rv:1.8.0) Gecko/20060728 Firefox/1.5.0", + "Mozilla/5.0 (Macintosh; PPC Mac OS X; U; en; rv:1.8.0) Gecko/20060728 Firefox/1.5.0", + "Mozilla/5.0 (X11; U; SunOS sun4u; en-US; rv:1.8.1.12) Gecko/20080210 Firefox/2.0.0.12", + "Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.8.1.12) Gecko/20080214 Firefox/2.0.0.12", ); diff --git a/ext/standard/tests/misc/get_browser_basic.phpt b/ext/standard/tests/misc/get_browser_basic.phpt index 81eb9d52e9..85ac8e3493 100644 --- a/ext/standard/tests/misc/get_browser_basic.phpt +++ b/ext/standard/tests/misc/get_browser_basic.phpt @@ -18,7 +18,7 @@ $browsers = include __DIR__ . DIRECTORY_SEPARATOR . 'browsernames.inc'; echo "*** Testing get_browser() : basic functionality ***\n"; for( $x = 0; $x < 20; $x++) { - var_dump( get_browser( $browsers[$x], true ) ); + var_dump( get_browser( $browsers[$x], true ) ); } ?> diff --git a/ext/standard/tests/misc/get_browser_variation1.phpt b/ext/standard/tests/misc/get_browser_variation1.phpt index 7c32a722c7..58c3a24267 100644 --- a/ext/standard/tests/misc/get_browser_variation1.phpt +++ b/ext/standard/tests/misc/get_browser_variation1.phpt @@ -19,7 +19,7 @@ echo "*** Testing get_browser() : variation functionality: extra browser names * $count = count( $browsers ); for( $x = 20; $x < $count; $x++) { - var_dump( get_browser( $browsers[$x], true ) ); + var_dump( get_browser( $browsers[$x], true ) ); } ?> diff --git a/ext/standard/tests/network/bug20134.phpt b/ext/standard/tests/network/bug20134.phpt index 260878d474..669f5c74ea 100644 --- a/ext/standard/tests/network/bug20134.phpt +++ b/ext/standard/tests/network/bug20134.phpt @@ -5,17 +5,17 @@ Bug #20134 (UDP reads from invalid ports) $fp = fsockopen("udp://localhost", 65534, $errno, $errstr); if (!$fp) { - /* UDP will never cause a connection error, as it is - * a connection-LESS protocol */ + /* UDP will never cause a connection error, as it is + * a connection-LESS protocol */ echo "ERROR: $errno - $errstr<br>\n"; } else { - /* Likewise, writes will always appear to succeed */ + /* Likewise, writes will always appear to succeed */ $x = fwrite($fp,"\n"); - var_dump($x); - /* But reads should always fail */ + var_dump($x); + /* But reads should always fail */ $content = fread($fp, 40); - var_dump($content); + var_dump($content); fclose($fp); } ?> diff --git a/ext/standard/tests/network/bug64330.phpt b/ext/standard/tests/network/bug64330.phpt index 836709ea49..311376503a 100644 --- a/ext/standard/tests/network/bug64330.phpt +++ b/ext/standard/tests/network/bug64330.phpt @@ -11,7 +11,7 @@ echo "Test\n"; $server = stream_socket_server("unix://\x00/MyBindName"); $client = stream_socket_client("unix://\x00/MyBindName"); if ($client) { - echo "ok\n"; + echo "ok\n"; } ?> --EXPECT-- diff --git a/ext/standard/tests/network/gethostbyname_basic001.phpt b/ext/standard/tests/network/gethostbyname_basic001.phpt index e917b59920..d65289ca41 100644 --- a/ext/standard/tests/network/gethostbyname_basic001.phpt +++ b/ext/standard/tests/network/gethostbyname_basic001.phpt @@ -8,7 +8,7 @@ if (getenv("SKIP_SLOW_TESTS")) die("skip slow test"); ?> --FILE-- <?php - var_dump(is_string(gethostbyname("www.php.net"))); + var_dump(is_string(gethostbyname("www.php.net"))); ?> --EXPECT-- bool(true) diff --git a/ext/standard/tests/network/gethostbyname_error001.phpt b/ext/standard/tests/network/gethostbyname_error001.phpt index f141be8b4e..87f4571fd3 100644 --- a/ext/standard/tests/network/gethostbyname_error001.phpt +++ b/ext/standard/tests/network/gethostbyname_error001.phpt @@ -4,7 +4,7 @@ gethostbyname() function - basic type return error test "Sylvain R." <sracine@phpquebec.org> --FILE-- <?php - var_dump(is_string(gethostbyname("192.168.0.101"))); + var_dump(is_string(gethostbyname("192.168.0.101"))); ?> --EXPECT-- bool(true) diff --git a/ext/standard/tests/network/gethostbyname_error002.phpt b/ext/standard/tests/network/gethostbyname_error002.phpt index 2430a7fcdc..8f586d02ba 100644 --- a/ext/standard/tests/network/gethostbyname_error002.phpt +++ b/ext/standard/tests/network/gethostbyname_error002.phpt @@ -4,7 +4,7 @@ gethostbyname() function - basic type return error test "Sylvain R." <sracine@phpquebec.org> --FILE-- <?php - var_dump(is_string(gethostbyname("1234567890"))); + var_dump(is_string(gethostbyname("1234567890"))); ?> --EXPECT-- bool(true) diff --git a/ext/standard/tests/network/gethostbyname_error003.phpt b/ext/standard/tests/network/gethostbyname_error003.phpt index 3d4bb7a55e..ebc8a971cb 100644 --- a/ext/standard/tests/network/gethostbyname_error003.phpt +++ b/ext/standard/tests/network/gethostbyname_error003.phpt @@ -4,7 +4,7 @@ gethostbyname() function - basic type return error test "Sylvain R." <sracine@phpquebec.org> --FILE-- <?php - var_dump(is_string(gethostbyname("asdfasdf"))); + var_dump(is_string(gethostbyname("asdfasdf"))); ?> --EXPECT-- bool(true) diff --git a/ext/standard/tests/network/gethostbyname_error004.phpt b/ext/standard/tests/network/gethostbyname_error004.phpt index 274301a236..25ded4bc24 100644 --- a/ext/standard/tests/network/gethostbyname_error004.phpt +++ b/ext/standard/tests/network/gethostbyname_error004.phpt @@ -9,8 +9,8 @@ if (getenv("SKIP_ONLINE_TESTS")) die("skip test requiring internet connection"); ?> --FILE-- <?php - $ip = gethostbyname("www.php.net"); - var_dump((bool) ip2long($ip)); + $ip = gethostbyname("www.php.net"); + var_dump((bool) ip2long($ip)); ?> --EXPECT-- bool(true) diff --git a/ext/standard/tests/network/gethostbyname_error006.phpt b/ext/standard/tests/network/gethostbyname_error006.phpt index 46247a113d..156ba0e623 100644 --- a/ext/standard/tests/network/gethostbyname_error006.phpt +++ b/ext/standard/tests/network/gethostbyname_error006.phpt @@ -4,7 +4,7 @@ gethostbyname() function - basic invalid parameter test "Sylvain R." <sracine@phpquebec.org> --FILE-- <?php - var_dump(gethostbyname(".toto.toto.toto")); + var_dump(gethostbyname(".toto.toto.toto")); ?> --EXPECT-- string(15) ".toto.toto.toto" diff --git a/ext/standard/tests/network/getprotobyname_basic.phpt b/ext/standard/tests/network/getprotobyname_basic.phpt index 37cc26aa2b..ee5e396114 100644 --- a/ext/standard/tests/network/getprotobyname_basic.phpt +++ b/ext/standard/tests/network/getprotobyname_basic.phpt @@ -4,7 +4,7 @@ getprotobyname function basic test edgarsandi - <edgar.r.sandi@gmail.com> --FILE-- <?php - var_dump(getprotobyname('tcp')); + var_dump(getprotobyname('tcp')); ?> --EXPECT-- int(6) diff --git a/ext/standard/tests/network/getprotobynumber_basic.phpt b/ext/standard/tests/network/getprotobynumber_basic.phpt index 7850e60ffd..d781ab92b0 100644 --- a/ext/standard/tests/network/getprotobynumber_basic.phpt +++ b/ext/standard/tests/network/getprotobynumber_basic.phpt @@ -4,7 +4,7 @@ getprotobynumber function basic test edgarsandi - <edgar.r.sandi@gmail.com> --FILE-- <?php - var_dump(getprotobynumber(6)); + var_dump(getprotobynumber(6)); ?> --EXPECT-- string(3) "tcp" diff --git a/ext/standard/tests/network/inet.phpt b/ext/standard/tests/network/inet.phpt index 81db0016b5..29b4aa0e6b 100644 --- a/ext/standard/tests/network/inet.phpt +++ b/ext/standard/tests/network/inet.phpt @@ -23,14 +23,14 @@ var_dump(inet_pton(-1)); var_dump(inet_pton("abra")); $array = array( - "127.0.0.1", - "66.163.161.116", - "255.255.255.255", - "0.0.0.0", - ); + "127.0.0.1", + "66.163.161.116", + "255.255.255.255", + "0.0.0.0", + ); foreach ($array as $val) { - var_dump(bin2hex($packed = inet_pton($val))); - var_dump(inet_ntop($packed)); + var_dump(bin2hex($packed = inet_pton($val))); + var_dump(inet_ntop($packed)); } echo "Done\n"; diff --git a/ext/standard/tests/network/inet_ipv6.phpt b/ext/standard/tests/network/inet_ipv6.phpt index 55323688de..f78d4be7cc 100644 --- a/ext/standard/tests/network/inet_ipv6.phpt +++ b/ext/standard/tests/network/inet_ipv6.phpt @@ -15,20 +15,20 @@ if (stristr(PHP_OS, "darwin") !== false) die("skip MacOS has broken inet_*() fun <?php $a = array( - '::1', - '::2', - '::35', - '::255', - '::1024', - '', - '2001:0db8:85a3:08d3:1319:8a2e:0370:7344', - '2001:0db8:1234:0000:0000:0000:0000:0000', - '2001:0db8:1234:FFFF:FFFF:FFFF:FFFF:FFFF', + '::1', + '::2', + '::35', + '::255', + '::1024', + '', + '2001:0db8:85a3:08d3:1319:8a2e:0370:7344', + '2001:0db8:1234:0000:0000:0000:0000:0000', + '2001:0db8:1234:FFFF:FFFF:FFFF:FFFF:FFFF', ); foreach ($a as $address) { - $packed = inet_pton($address); - var_dump(inet_ntop($packed)); + $packed = inet_pton($address); + var_dump(inet_ntop($packed)); } echo "Done\n"; diff --git a/ext/standard/tests/network/ip.phpt b/ext/standard/tests/network/ip.phpt index 831eee018a..97e06b3187 100644 --- a/ext/standard/tests/network/ip.phpt +++ b/ext/standard/tests/network/ip.phpt @@ -8,17 +8,17 @@ if (PHP_INT_SIZE != 4) die("skip this test is for 32bit platform only"); <?php $array = array( - "127.0.0.1", - "10.0.0.1", - "255.255.255.255", - "255.255.255.0", - "0.0.0.0", - "66.163.161.116", + "127.0.0.1", + "10.0.0.1", + "255.255.255.255", + "255.255.255.0", + "0.0.0.0", + "66.163.161.116", ); foreach ($array as $ip) { - var_dump($long = ip2long($ip)); - var_dump(long2ip($long)); + var_dump($long = ip2long($ip)); + var_dump(long2ip($long)); } var_dump(ip2long("")); diff --git a/ext/standard/tests/network/ip2long_variation2.phpt b/ext/standard/tests/network/ip2long_variation2.phpt index 0fcd701b26..56c74bb37e 100644 --- a/ext/standard/tests/network/ip2long_variation2.phpt +++ b/ext/standard/tests/network/ip2long_variation2.phpt @@ -12,18 +12,18 @@ Test ip2long() function : usage variation 2, 32 bit */ $ips = array( - "1.1.011.011", - "127.0.0.1", - "1.1.071.071", - "0.0.0.0", - "1.1.081.081", - "192.168.0.0", - "256.0.0.1", - "192.168.0xa.5", + "1.1.011.011", + "127.0.0.1", + "1.1.071.071", + "0.0.0.0", + "1.1.081.081", + "192.168.0.0", + "256.0.0.1", + "192.168.0xa.5", ); foreach($ips as $ip) { - var_dump(ip2long($ip)); + var_dump(ip2long($ip)); } ?> diff --git a/ext/standard/tests/network/ip2long_variation2_x64.phpt b/ext/standard/tests/network/ip2long_variation2_x64.phpt index 563f579b84..3ee59c9efb 100644 --- a/ext/standard/tests/network/ip2long_variation2_x64.phpt +++ b/ext/standard/tests/network/ip2long_variation2_x64.phpt @@ -19,18 +19,18 @@ if(PHP_INT_SIZE != 8) {die('skip 64 bit only');} */ $ips = array( - "1.1.011.011", - "127.0.0.1", - "1.1.071.071", - "0.0.0.0", - "1.1.081.081", - "192.168.0.0", - "256.0.0.1", - "192.168.0xa.5", + "1.1.011.011", + "127.0.0.1", + "1.1.071.071", + "0.0.0.0", + "1.1.081.081", + "192.168.0.0", + "256.0.0.1", + "192.168.0xa.5", ); foreach($ips as $ip) { - var_dump(ip2long($ip)); + var_dump(ip2long($ip)); } ?> diff --git a/ext/standard/tests/network/ip_x86_64.phpt b/ext/standard/tests/network/ip_x86_64.phpt index 06ed1549a6..c659eb70fb 100644 --- a/ext/standard/tests/network/ip_x86_64.phpt +++ b/ext/standard/tests/network/ip_x86_64.phpt @@ -8,17 +8,17 @@ if (PHP_INT_SIZE == 4) die("skip this test is for >32bit platform only"); <?php $array = array( - "127.0.0.1", - "10.0.0.1", - "255.255.255.255", - "255.255.255.0", - "0.0.0.0", - "66.163.161.116", + "127.0.0.1", + "10.0.0.1", + "255.255.255.255", + "255.255.255.0", + "0.0.0.0", + "66.163.161.116", ); foreach ($array as $ip) { - var_dump($long = ip2long($ip)); - var_dump(long2ip($long)); + var_dump($long = ip2long($ip)); + var_dump(long2ip($long)); } var_dump(ip2long("")); diff --git a/ext/standard/tests/network/setcookie.phpt b/ext/standard/tests/network/setcookie.phpt index 1033b7bbbe..c2806ad8a9 100644 --- a/ext/standard/tests/network/setcookie.phpt +++ b/ext/standard/tests/network/setcookie.phpt @@ -21,54 +21,54 @@ setcookie('name', 'value', ['expires' => $tsp]); setcookie('name', 'value', ['expires' => $tsn, 'path' => '/path/', 'domain' => 'domain.tld', 'secure' => true, 'httponly' => true, 'samesite' => 'Strict']); $expected = array( - 'Set-Cookie: name=deleted; expires='.date('D, d-M-Y H:i:s', 1).' GMT; Max-Age=0', - 'Set-Cookie: name=deleted; expires='.date('D, d-M-Y H:i:s', 1).' GMT; Max-Age=0', - 'Set-Cookie: name=value', - 'Set-Cookie: name=space%20value', - 'Set-Cookie: name=value', - 'Set-Cookie: name=value; expires='.date('D, d-M-Y H:i:s', $tsp).' GMT; Max-Age=5', - 'Set-Cookie: name=value; expires='.date('D, d-M-Y H:i:s', $tsn).' GMT; Max-Age=0', - 'Set-Cookie: name=value; expires='.date('D, d-M-Y H:i:s', $tsc).' GMT; Max-Age=0', - 'Set-Cookie: name=value; path=/path/', - 'Set-Cookie: name=value; domain=domain.tld', - 'Set-Cookie: name=value; secure', - 'Set-Cookie: name=value; HttpOnly', - 'Set-Cookie: name=value; expires='.date('D, d-M-Y H:i:s', $tsp).' GMT; Max-Age=5', - 'Set-Cookie: name=value; expires='.date('D, d-M-Y H:i:s', $tsn).' GMT; Max-Age=0; path=/path/; domain=domain.tld; secure; HttpOnly; SameSite=Strict' + 'Set-Cookie: name=deleted; expires='.date('D, d-M-Y H:i:s', 1).' GMT; Max-Age=0', + 'Set-Cookie: name=deleted; expires='.date('D, d-M-Y H:i:s', 1).' GMT; Max-Age=0', + 'Set-Cookie: name=value', + 'Set-Cookie: name=space%20value', + 'Set-Cookie: name=value', + 'Set-Cookie: name=value; expires='.date('D, d-M-Y H:i:s', $tsp).' GMT; Max-Age=5', + 'Set-Cookie: name=value; expires='.date('D, d-M-Y H:i:s', $tsn).' GMT; Max-Age=0', + 'Set-Cookie: name=value; expires='.date('D, d-M-Y H:i:s', $tsc).' GMT; Max-Age=0', + 'Set-Cookie: name=value; path=/path/', + 'Set-Cookie: name=value; domain=domain.tld', + 'Set-Cookie: name=value; secure', + 'Set-Cookie: name=value; HttpOnly', + 'Set-Cookie: name=value; expires='.date('D, d-M-Y H:i:s', $tsp).' GMT; Max-Age=5', + 'Set-Cookie: name=value; expires='.date('D, d-M-Y H:i:s', $tsn).' GMT; Max-Age=0; path=/path/; domain=domain.tld; secure; HttpOnly; SameSite=Strict' ); $headers = headers_list(); if (($i = count($expected)) > count($headers)) { - echo "Fewer headers are being sent than expected - aborting"; - return; + echo "Fewer headers are being sent than expected - aborting"; + return; } do { - if (strncmp(current($headers), 'Set-Cookie:', 11) !== 0) - { - continue; - } + if (strncmp(current($headers), 'Set-Cookie:', 11) !== 0) + { + continue; + } - if (current($headers) === current($expected)) - { - $i--; - } - else - { - echo "Header mismatch:\n\tExpected: " - .current($expected) - ."\n\tReceived: ".current($headers)."\n"; - } + if (current($headers) === current($expected)) + { + $i--; + } + else + { + echo "Header mismatch:\n\tExpected: " + .current($expected) + ."\n\tReceived: ".current($headers)."\n"; + } - next($expected); + next($expected); } while (next($headers) !== FALSE); echo ($i === 0) - ? 'OK' - : 'A total of '.$i.' errors found.'; + ? 'OK' + : 'A total of '.$i.' errors found.'; ?> --EXPECTHEADERS-- diff --git a/ext/standard/tests/network/shutdown.phpt b/ext/standard/tests/network/shutdown.phpt index 1e79b059b1..b8655cc1f4 100644 --- a/ext/standard/tests/network/shutdown.phpt +++ b/ext/standard/tests/network/shutdown.phpt @@ -17,56 +17,56 @@ stream_socket_shutdown() test on IPv4 TCP Loopback } if (!$server) { - die('Unable to create AF_INET socket [server]'); - } + die('Unable to create AF_INET socket [server]'); + } - /* Connect and send request 1 */ - $client1 = stream_socket_client("tcp://127.0.0.1:$port"); - if (!$client1) { - die('Unable to create AF_INET socket [client]'); - } - @fwrite($client1, "Client 1\n"); - stream_socket_shutdown($client1, STREAM_SHUT_WR); - @fwrite($client1, "Error 1\n"); + /* Connect and send request 1 */ + $client1 = stream_socket_client("tcp://127.0.0.1:$port"); + if (!$client1) { + die('Unable to create AF_INET socket [client]'); + } + @fwrite($client1, "Client 1\n"); + stream_socket_shutdown($client1, STREAM_SHUT_WR); + @fwrite($client1, "Error 1\n"); - /* Connect and send request 2 */ - $client2 = stream_socket_client("tcp://127.0.0.1:$port"); - if (!$client2) { - die('Unable to create AF_INET socket [client]'); - } - @fwrite($client2, "Client 2\n"); - stream_socket_shutdown($client2, STREAM_SHUT_WR); - @fwrite($client2, "Error 2\n"); + /* Connect and send request 2 */ + $client2 = stream_socket_client("tcp://127.0.0.1:$port"); + if (!$client2) { + die('Unable to create AF_INET socket [client]'); + } + @fwrite($client2, "Client 2\n"); + stream_socket_shutdown($client2, STREAM_SHUT_WR); + @fwrite($client2, "Error 2\n"); - /* Accept connection 1 */ - $socket = stream_socket_accept($server); - if (!$socket) { - die('Unable to accept connection'); - } - @fwrite($socket, fgets($socket)); - @fwrite($socket, fgets($socket)); - fclose($socket); + /* Accept connection 1 */ + $socket = stream_socket_accept($server); + if (!$socket) { + die('Unable to accept connection'); + } + @fwrite($socket, fgets($socket)); + @fwrite($socket, fgets($socket)); + fclose($socket); - /* Read Response 1 */ - echo fgets($client1); - echo fgets($client1); + /* Read Response 1 */ + echo fgets($client1); + echo fgets($client1); - /* Accept connection 2 */ - $socket = stream_socket_accept($server); - if (!$socket) { - die('Unable to accept connection'); - } - @fwrite($socket, fgets($socket)); - @fwrite($socket, fgets($socket)); - fclose($socket); + /* Accept connection 2 */ + $socket = stream_socket_accept($server); + if (!$socket) { + die('Unable to accept connection'); + } + @fwrite($socket, fgets($socket)); + @fwrite($socket, fgets($socket)); + fclose($socket); - /* Read Response 2 */ - echo fgets($client2); - echo fgets($client2); + /* Read Response 2 */ + echo fgets($client2); + echo fgets($client2); - fclose($client1); - fclose($client2); - fclose($server); + fclose($client1); + fclose($client2); + fclose($server); ?> --EXPECT-- Client 1 diff --git a/ext/standard/tests/network/socket_bug74429.phpt b/ext/standard/tests/network/socket_bug74429.phpt index 2c955bb5be..f72e9e31d7 100644 --- a/ext/standard/tests/network/socket_bug74429.phpt +++ b/ext/standard/tests/network/socket_bug74429.phpt @@ -4,8 +4,8 @@ Bug #74429 Remote socket URI with unique persistence identifier broken <?php /* This behavior is undocumented, but might be in use. Until there's no officially - supported alternative, ensure changes doesn't cause BC breach. Otherwise, - the test should be removed once the undocumented behavior changes. */ + supported alternative, ensure changes doesn't cause BC breach. Otherwise, + the test should be removed once the undocumented behavior changes. */ for ($i=0; $i<100; $i++) { $port = rand(10000, 65000); diff --git a/ext/standard/tests/network/tcp4loop.phpt b/ext/standard/tests/network/tcp4loop.phpt index a18fa3ba57..1632eba423 100644 --- a/ext/standard/tests/network/tcp4loop.phpt +++ b/ext/standard/tests/network/tcp4loop.phpt @@ -11,30 +11,30 @@ Streams Based IPv4 TCP Loopback test break; } } - if (!$server) { - die('Unable to create AF_INET socket [server]'); - } + if (!$server) { + die('Unable to create AF_INET socket [server]'); + } - /* Connect to it */ - $client = stream_socket_client("tcp://127.0.0.1:$port"); - if (!$client) { - die('Unable to create AF_INET socket [client]'); - } + /* Connect to it */ + $client = stream_socket_client("tcp://127.0.0.1:$port"); + if (!$client) { + die('Unable to create AF_INET socket [client]'); + } - /* Accept that connection */ - $socket = stream_socket_accept($server); - if (!$socket) { - die('Unable to accept connection'); - } + /* Accept that connection */ + $socket = stream_socket_accept($server); + if (!$socket) { + die('Unable to accept connection'); + } - fwrite($client, "ABCdef123\n"); + fwrite($client, "ABCdef123\n"); - $data = fread($socket, 10); - var_dump($data); + $data = fread($socket, 10); + var_dump($data); - fclose($client); - fclose($socket); - fclose($server); + fclose($client); + fclose($socket); + fclose($server); ?> --EXPECT-- string(10) "ABCdef123 diff --git a/ext/standard/tests/network/tcp6loop.phpt b/ext/standard/tests/network/tcp6loop.phpt index c8223633ca..6f6e418ffc 100644 --- a/ext/standard/tests/network/tcp6loop.phpt +++ b/ext/standard/tests/network/tcp6loop.phpt @@ -20,30 +20,30 @@ Streams Based IPv6 TCP Loopback test } } - if (!$server) { - die('Unable to create AF_INET6 socket [server]'); - } + if (!$server) { + die('Unable to create AF_INET6 socket [server]'); + } - /* Connect to it */ - $client = stream_socket_client("tcp://[::1]:$port"); - if (!$client) { - die('Unable to create AF_INET6 socket [client]'); - } + /* Connect to it */ + $client = stream_socket_client("tcp://[::1]:$port"); + if (!$client) { + die('Unable to create AF_INET6 socket [client]'); + } - /* Accept that connection */ - $socket = stream_socket_accept($server); - if (!$socket) { - die('Unable to accept connection'); - } + /* Accept that connection */ + $socket = stream_socket_accept($server); + if (!$socket) { + die('Unable to accept connection'); + } - fwrite($client, "ABCdef123\n"); + fwrite($client, "ABCdef123\n"); - $data = fread($socket, 10); - var_dump($data); + $data = fread($socket, 10); + var_dump($data); - fclose($client); - fclose($socket); - fclose($server); + fclose($client); + fclose($socket); + fclose($server); ?> --EXPECT-- string(10) "ABCdef123 diff --git a/ext/standard/tests/network/udgloop.phpt b/ext/standard/tests/network/udgloop.phpt index 47ecaf042e..3a7e1bf267 100644 --- a/ext/standard/tests/network/udgloop.phpt +++ b/ext/standard/tests/network/udgloop.phpt @@ -7,30 +7,30 @@ Streams Based Unix Domain Datagram Loopback test ?> --FILE-- <?php - $uniqid = uniqid(); - if (file_exists("/tmp/$uniqid.sock")) - die('Temporary socket /tmp/$uniqid.sock already exists.'); + $uniqid = uniqid(); + if (file_exists("/tmp/$uniqid.sock")) + die('Temporary socket /tmp/$uniqid.sock already exists.'); - /* Setup socket server */ - $server = stream_socket_server("udg:///tmp/$uniqid.sock", $errno, $errstr, STREAM_SERVER_BIND); - if (!$server) { - die('Unable to create AF_UNIX socket [server]'); - } + /* Setup socket server */ + $server = stream_socket_server("udg:///tmp/$uniqid.sock", $errno, $errstr, STREAM_SERVER_BIND); + if (!$server) { + die('Unable to create AF_UNIX socket [server]'); + } - /* Connect to it */ - $client = stream_socket_client("udg:///tmp/$uniqid.sock"); - if (!$client) { - die('Unable to create AF_UNIX socket [client]'); - } + /* Connect to it */ + $client = stream_socket_client("udg:///tmp/$uniqid.sock"); + if (!$client) { + die('Unable to create AF_UNIX socket [client]'); + } - fwrite($client, "ABCdef123\n"); + fwrite($client, "ABCdef123\n"); - $data = fread($server, 10); - var_dump($data); + $data = fread($server, 10); + var_dump($data); - fclose($client); - fclose($server); - unlink("/tmp/$uniqid.sock"); + fclose($client); + fclose($server); + unlink("/tmp/$uniqid.sock"); ?> --EXPECT-- string(10) "ABCdef123 diff --git a/ext/standard/tests/network/udp4loop.phpt b/ext/standard/tests/network/udp4loop.phpt index 3f78df267a..92709233ba 100644 --- a/ext/standard/tests/network/udp4loop.phpt +++ b/ext/standard/tests/network/udp4loop.phpt @@ -2,29 +2,29 @@ Streams Based IPv4 UDP Loopback test --FILE-- <?php - /* Setup socket server */ - for ($port = 31338; $port < 31500; ++$port) { - $uri = "udp://127.0.0.1:$port"; - $server = @stream_socket_server($uri, $errno, $errstr, STREAM_SERVER_BIND); - if ($server) break; - } - if (!$server) { - die('Unable to create AF_INET socket [server]: ' . $errstr); - } + /* Setup socket server */ + for ($port = 31338; $port < 31500; ++$port) { + $uri = "udp://127.0.0.1:$port"; + $server = @stream_socket_server($uri, $errno, $errstr, STREAM_SERVER_BIND); + if ($server) break; + } + if (!$server) { + die('Unable to create AF_INET socket [server]: ' . $errstr); + } - /* Connect to it */ - $client = stream_socket_client($uri); - if (!$client) { - die('Unable to create AF_INET socket [client]'); - } + /* Connect to it */ + $client = stream_socket_client($uri); + if (!$client) { + die('Unable to create AF_INET socket [client]'); + } - fwrite($client, "ABCdef123\n"); + fwrite($client, "ABCdef123\n"); - $data = fread($server, 10); - var_dump($data); + $data = fread($server, 10); + var_dump($data); - fclose($client); - fclose($server); + fclose($client); + fclose($server); ?> --EXPECT-- string(10) "ABCdef123 diff --git a/ext/standard/tests/network/udp6loop.phpt b/ext/standard/tests/network/udp6loop.phpt index 3b70f43119..06d9bf4811 100644 --- a/ext/standard/tests/network/udp6loop.phpt +++ b/ext/standard/tests/network/udp6loop.phpt @@ -26,23 +26,23 @@ Streams Based IPv6 UDP Loopback test } } - if (!$server) { - die('Unable to create AF_INET6 socket [server]'); - } + if (!$server) { + die('Unable to create AF_INET6 socket [server]'); + } - /* Connect to it */ - $client = stream_socket_client("udp://[::1]:$port"); - if (!$client) { - die('Unable to create AF_INET6 socket [client]'); - } + /* Connect to it */ + $client = stream_socket_client("udp://[::1]:$port"); + if (!$client) { + die('Unable to create AF_INET6 socket [client]'); + } - fwrite($client, "ABCdef123\n"); + fwrite($client, "ABCdef123\n"); - $data = fread($server, 10); - var_dump($data); + $data = fread($server, 10); + var_dump($data); - fclose($client); - fclose($server); + fclose($client); + fclose($server); ?> --EXPECT-- string(10) "ABCdef123 diff --git a/ext/standard/tests/network/unixloop.phpt b/ext/standard/tests/network/unixloop.phpt index 2e95beb9f5..4b5bde2262 100644 --- a/ext/standard/tests/network/unixloop.phpt +++ b/ext/standard/tests/network/unixloop.phpt @@ -7,37 +7,37 @@ Streams Based Unix Domain Loopback test ?> --FILE-- <?php - $uniqid = uniqid(); - if (file_exists("/tmp/$uniqid.sock")) - die('Temporary socket already exists.'); + $uniqid = uniqid(); + if (file_exists("/tmp/$uniqid.sock")) + die('Temporary socket already exists.'); - /* Setup socket server */ - $server = stream_socket_server("unix:///tmp/$uniqid.sock"); - if (!$server) { - die('Unable to create AF_UNIX socket [server]'); - } + /* Setup socket server */ + $server = stream_socket_server("unix:///tmp/$uniqid.sock"); + if (!$server) { + die('Unable to create AF_UNIX socket [server]'); + } - /* Connect to it */ - $client = stream_socket_client("unix:///tmp/$uniqid.sock"); - if (!$client) { - die('Unable to create AF_UNIX socket [client]'); - } + /* Connect to it */ + $client = stream_socket_client("unix:///tmp/$uniqid.sock"); + if (!$client) { + die('Unable to create AF_UNIX socket [client]'); + } - /* Accept that connection */ - $socket = stream_socket_accept($server); - if (!$socket) { - die('Unable to accept connection'); - } + /* Accept that connection */ + $socket = stream_socket_accept($server); + if (!$socket) { + die('Unable to accept connection'); + } - fwrite($client, "ABCdef123\n"); + fwrite($client, "ABCdef123\n"); - $data = fread($socket, 10); - var_dump($data); + $data = fread($socket, 10); + var_dump($data); - fclose($client); - fclose($socket); - fclose($server); - unlink("/tmp/$uniqid.sock"); + fclose($client); + fclose($socket); + fclose($server); + unlink("/tmp/$uniqid.sock"); ?> --EXPECT-- string(10) "ABCdef123 diff --git a/ext/standard/tests/password/password_hash_argon2.phpt b/ext/standard/tests/password/password_hash_argon2.phpt index a7612effa9..399c4cd4bc 100644 --- a/ext/standard/tests/password/password_hash_argon2.phpt +++ b/ext/standard/tests/password/password_hash_argon2.phpt @@ -10,12 +10,12 @@ if (!defined('PASSWORD_ARGON2ID')) die('skip password_hash not built with Argon2 $password = "the password for testing 12345!"; $algos = [ - PASSWORD_ARGON2I, - 'argon2i', - 2, - PASSWORD_ARGON2ID, - 'argon2id', - 3, + PASSWORD_ARGON2I, + 'argon2i', + 2, + PASSWORD_ARGON2ID, + 'argon2id', + 3, ]; foreach ($algos as $algo) { $hash = password_hash($password, $algo); diff --git a/ext/standard/tests/serialize/001.phpt b/ext/standard/tests/serialize/001.phpt index 5551956e92..147c355b08 100644 --- a/ext/standard/tests/serialize/001.phpt +++ b/ext/standard/tests/serialize/001.phpt @@ -6,36 +6,36 @@ serialize_precision=100 <?php class t { - function __construct() - { - $this->a = "hallo"; - } + function __construct() + { + $this->a = "hallo"; + } } class s { - public $a; - public $b; - public $c; + public $a; + public $b; + public $c; - function __construct() - { - $this->a = "hallo"; - $this->b = "php"; - $this->c = "world"; - $this->d = "!"; - } + function __construct() + { + $this->a = "hallo"; + $this->b = "php"; + $this->c = "world"; + $this->d = "!"; + } - function __sleep() - { - echo "__sleep called\n"; - return array("a","c"); - } + function __sleep() + { + echo "__sleep called\n"; + return array("a","c"); + } - function __wakeup() - { - echo "__wakeup called\n"; - } + function __wakeup() + { + echo "__wakeup called\n"; + } } diff --git a/ext/standard/tests/serialize/003.phpt b/ext/standard/tests/serialize/003.phpt index 5011412809..cf54f40406 100644 --- a/ext/standard/tests/serialize/003.phpt +++ b/ext/standard/tests/serialize/003.phpt @@ -6,9 +6,9 @@ serialize_precision=100 --FILE-- <?php foreach(array(1e2, 5.2e25, 85.29e-23, 9e-9) AS $value) { - echo ($ser = serialize($value))."\n"; - var_dump(unserialize($ser)); - echo "\n"; + echo ($ser = serialize($value))."\n"; + var_dump(unserialize($ser)); + echo "\n"; } ?> --EXPECTREGEX-- diff --git a/ext/standard/tests/serialize/005.phpt b/ext/standard/tests/serialize/005.phpt index 13ae050129..fd9fcaac18 100644 --- a/ext/standard/tests/serialize/005.phpt +++ b/ext/standard/tests/serialize/005.phpt @@ -7,93 +7,93 @@ serialize()/unserialize() objects function do_autoload($class_name) { - if ($class_name != 'autoload_not_available') - { - require_once(__DIR__ . '/' . strtolower($class_name) . '.inc'); - } - echo __FUNCTION__ . "($class_name)\n"; + if ($class_name != 'autoload_not_available') + { + require_once(__DIR__ . '/' . strtolower($class_name) . '.inc'); + } + echo __FUNCTION__ . "($class_name)\n"; } function unserializer($class_name) { - echo __METHOD__ . "($class_name)\n"; - switch($class_name) - { - case 'TestNAOld': - eval("class TestNAOld extends TestOld {}"); - break; - case 'TestNANew': - eval("class TestNANew extends TestNew {}"); - break; - case 'TestNANew2': - eval("class TestNANew2 extends TestNew {}"); - break; - default: - echo "Try autoloader\n"; - if (!spl_autoload_functions()) { - spl_autoload_register(function ($class_name) { do_autoload($class_name); }); - } - spl_autoload_call($class_name); - break; - } + echo __METHOD__ . "($class_name)\n"; + switch($class_name) + { + case 'TestNAOld': + eval("class TestNAOld extends TestOld {}"); + break; + case 'TestNANew': + eval("class TestNANew extends TestNew {}"); + break; + case 'TestNANew2': + eval("class TestNANew2 extends TestNew {}"); + break; + default: + echo "Try autoloader\n"; + if (!spl_autoload_functions()) { + spl_autoload_register(function ($class_name) { do_autoload($class_name); }); + } + spl_autoload_call($class_name); + break; + } } ini_set('unserialize_callback_func', 'unserializer'); class TestOld { - function serialize() - { - echo __METHOD__ . "()\n"; - } - - function unserialize($serialized) - { - echo __METHOD__ . "()\n"; - } - - function __wakeup() - { - echo __METHOD__ . "()\n"; - } - - function __sleep() - { - echo __METHOD__ . "()\n"; - return array(); - } + function serialize() + { + echo __METHOD__ . "()\n"; + } + + function unserialize($serialized) + { + echo __METHOD__ . "()\n"; + } + + function __wakeup() + { + echo __METHOD__ . "()\n"; + } + + function __sleep() + { + echo __METHOD__ . "()\n"; + return array(); + } } class TestNew implements Serializable { - protected static $check = 0; - - function serialize() - { - echo __METHOD__ . "()\n"; - switch(++self::$check) - { - case 1: - return NULL; - case 2: - return "2"; - } - } - - function unserialize($serialized) - { - echo __METHOD__ . "()\n"; - } - - function __wakeup() - { - echo __METHOD__ . "()\n"; - } - - function __sleep() - { - echo __METHOD__ . "()\n"; - } + protected static $check = 0; + + function serialize() + { + echo __METHOD__ . "()\n"; + switch(++self::$check) + { + case 1: + return NULL; + case 2: + return "2"; + } + } + + function unserialize($serialized) + { + echo __METHOD__ . "()\n"; + } + + function __wakeup() + { + echo __METHOD__ . "()\n"; + } + + function __sleep() + { + echo __METHOD__ . "()\n"; + } } echo "===O1===\n"; diff --git a/ext/standard/tests/serialize/006.phpt b/ext/standard/tests/serialize/006.phpt index 6ba93f4d23..24b3cbbe2d 100644 --- a/ext/standard/tests/serialize/006.phpt +++ b/ext/standard/tests/serialize/006.phpt @@ -2,19 +2,19 @@ serialize()/unserialize() with exotic letters --FILE-- <?php - $åäöÅÄÖ = array('åäöÅÄÖ' => 'åäöÅÄÖ'); + $åäöÅÄÖ = array('åäöÅÄÖ' => 'åäöÅÄÖ'); - class ÜberKööliäå - { - public $åäöÅÄÖüÜber = 'åäöÅÄÖ'; - } + class ÜberKööliäå + { + public $åäöÅÄÖüÜber = 'åäöÅÄÖ'; + } $foo = new Überkööliäå(); - var_dump(serialize($foo)); - var_dump(unserialize(serialize($foo))); - var_dump(serialize($åäöÅÄÖ)); - var_dump(unserialize(serialize($åäöÅÄÖ))); + var_dump(serialize($foo)); + var_dump(unserialize(serialize($foo))); + var_dump(serialize($åäöÅÄÖ)); + var_dump(unserialize(serialize($åäöÅÄÖ))); ?> --EXPECT-- string(55) "O:11:"ÜberKööliäå":1:{s:11:"åäöÅÄÖüÜber";s:6:"åäöÅÄÖ";}" diff --git a/ext/standard/tests/serialize/autoload_implements.inc b/ext/standard/tests/serialize/autoload_implements.inc index 55fcc3cd9f..e5f19c0680 100644 --- a/ext/standard/tests/serialize/autoload_implements.inc +++ b/ext/standard/tests/serialize/autoload_implements.inc @@ -1,10 +1,10 @@ <?php class autoload_implements implements autoload_interface { - function testFunction() - { - return true; - } + function testFunction() + { + return true; + } } ?> diff --git a/ext/standard/tests/serialize/autoload_interface.inc b/ext/standard/tests/serialize/autoload_interface.inc index e6a416e721..6e696f36bf 100644 --- a/ext/standard/tests/serialize/autoload_interface.inc +++ b/ext/standard/tests/serialize/autoload_interface.inc @@ -1,7 +1,7 @@ <?php interface autoload_interface { - function testFunction(); + function testFunction(); } ?> diff --git a/ext/standard/tests/serialize/bug14293.phpt b/ext/standard/tests/serialize/bug14293.phpt index 73636ba56d..875f8b2bc8 100644 --- a/ext/standard/tests/serialize/bug14293.phpt +++ b/ext/standard/tests/serialize/bug14293.phpt @@ -4,16 +4,16 @@ Bug #14293 (serialize() and __sleep()) <?php class t { - function __construct() - { - $this->a = 'hello'; - } + function __construct() + { + $this->a = 'hello'; + } - function __sleep() - { - echo "__sleep called\n"; - return array('a','b'); - } + function __sleep() + { + echo "__sleep called\n"; + return array('a','b'); + } } $t = new t(); diff --git a/ext/standard/tests/serialize/bug21957.phpt b/ext/standard/tests/serialize/bug21957.phpt index 070eda3f4c..9d761a6699 100644 --- a/ext/standard/tests/serialize/bug21957.phpt +++ b/ext/standard/tests/serialize/bug21957.phpt @@ -4,18 +4,18 @@ Bug #21957 (serialize() mangles objects with __sleep) <?php class test { - public $a, $b; + public $a, $b; - function __construct() - { - $this->a = 7; - $this->b = 2; - } + function __construct() + { + $this->a = 7; + $this->b = 2; + } - function __sleep() - { - $this->b = 0; - } + function __sleep() + { + $this->b = 0; + } } $t['one'] = 'ABC'; diff --git a/ext/standard/tests/serialize/bug23298.phpt b/ext/standard/tests/serialize/bug23298.phpt index fe56fccc45..29d09d18e9 100644 --- a/ext/standard/tests/serialize/bug23298.phpt +++ b/ext/standard/tests/serialize/bug23298.phpt @@ -4,10 +4,10 @@ Bug #23298 (serialize() and floats/doubles) serialize_precision=100 --FILE-- <?php - ini_set('precision', 12); - $foo = 1.428571428571428647642857142; - $bar = unserialize(serialize($foo)); - var_dump(($foo === $bar)); + ini_set('precision', 12); + $foo = 1.428571428571428647642857142; + $bar = unserialize(serialize($foo)); + var_dump(($foo === $bar)); ?> --EXPECT-- bool(true) diff --git a/ext/standard/tests/serialize/bug24063.phpt b/ext/standard/tests/serialize/bug24063.phpt index 38c9d6ed24..e3102245f8 100644 --- a/ext/standard/tests/serialize/bug24063.phpt +++ b/ext/standard/tests/serialize/bug24063.phpt @@ -7,8 +7,8 @@ precision=12 <?php $v = 1; for ($i = 1; $i < 10; $i++) { - $v /= 10; - echo "{$v} ".unserialize(serialize($v))."\n"; + $v /= 10; + echo "{$v} ".unserialize(serialize($v))."\n"; } ?> --EXPECT-- diff --git a/ext/standard/tests/serialize/bug26762.phpt b/ext/standard/tests/serialize/bug26762.phpt index ad6c0e0b41..d4daf34464 100644 --- a/ext/standard/tests/serialize/bug26762.phpt +++ b/ext/standard/tests/serialize/bug26762.phpt @@ -10,15 +10,15 @@ Bug #26762 (unserialize() produces lowercase classnames) ini_set('unserialize_callback_func','check'); function check($name) { - var_dump($name); - throw new exception; + var_dump($name); + throw new exception; } try { - @unserialize('O:3:"FOO":0:{}'); + @unserialize('O:3:"FOO":0:{}'); } catch (Exception $e) { - /* ignore */ + /* ignore */ } ?> diff --git a/ext/standard/tests/serialize/bug28325.phpt b/ext/standard/tests/serialize/bug28325.phpt index ee0e60e1ad..cd909dc07d 100644 --- a/ext/standard/tests/serialize/bug28325.phpt +++ b/ext/standard/tests/serialize/bug28325.phpt @@ -3,13 +3,13 @@ Bug #28325 (Problem in serialisation of circular references) --FILE-- <?php class a { - public $b; + public $b; } class b { - public $c; + public $c; } class c { - public $d; + public $d; } $a = new a(); $a->b = new b(); diff --git a/ext/standard/tests/serialize/bug30234.phpt b/ext/standard/tests/serialize/bug30234.phpt index 4b45d8d1ef..66e5aa3547 100644 --- a/ext/standard/tests/serialize/bug30234.phpt +++ b/ext/standard/tests/serialize/bug30234.phpt @@ -8,8 +8,8 @@ Bug #30234 (__autoload() not invoked for interfaces) <?php spl_autoload_register(function ($class_name) { - require_once(__DIR__ . '/' . strtolower($class_name) . '.inc'); - echo __FUNCTION__ . '(' . $class_name . ")\n"; + require_once(__DIR__ . '/' . strtolower($class_name) . '.inc'); + echo __FUNCTION__ . '(' . $class_name . ")\n"; }); var_dump(interface_exists('autoload_interface', false)); diff --git a/ext/standard/tests/serialize/bug49649.phpt b/ext/standard/tests/serialize/bug49649.phpt index d6acb80764..455c1e17d4 100644 --- a/ext/standard/tests/serialize/bug49649.phpt +++ b/ext/standard/tests/serialize/bug49649.phpt @@ -23,11 +23,11 @@ $serialized = 'TzozOiJGb28iOjQ6e3M6MTI6IgBGb28AcHJpdmF0ZSI7aToxO3M6MTI6IgAqAHByb class Foo { - public $public = null; + public $public = null; - public $protected = null; + public $protected = null; - public $private = null; + public $private = null; } $class = unserialize(base64_decode($serialized)); diff --git a/ext/standard/tests/serialize/bug49649_1.phpt b/ext/standard/tests/serialize/bug49649_1.phpt index fb6d6dba52..a2f5427edd 100644 --- a/ext/standard/tests/serialize/bug49649_1.phpt +++ b/ext/standard/tests/serialize/bug49649_1.phpt @@ -23,11 +23,11 @@ $serialized = 'TzozOiJGb28iOjQ6e3M6MTI6IgBGb28AcHJpdmF0ZSI7aToxO3M6MTI6IgAqAHByb class Foo { - protected $public = null; + protected $public = null; - protected $protected = null; + protected $protected = null; - protected $private = null; + protected $private = null; } $class = unserialize(base64_decode($serialized)); diff --git a/ext/standard/tests/serialize/bug49649_2.phpt b/ext/standard/tests/serialize/bug49649_2.phpt index fe5b43a6ad..18796b21f7 100644 --- a/ext/standard/tests/serialize/bug49649_2.phpt +++ b/ext/standard/tests/serialize/bug49649_2.phpt @@ -23,11 +23,11 @@ $serialized = 'TzozOiJGb28iOjQ6e3M6MTI6IgBGb28AcHJpdmF0ZSI7aToxO3M6MTI6IgAqAHByb class Foo { - private $public = null; + private $public = null; - private $protected = null; + private $protected = null; - private $private = null; + private $private = null; } $class = unserialize(base64_decode($serialized)); diff --git a/ext/standard/tests/serialize/bug65481.phpt b/ext/standard/tests/serialize/bug65481.phpt index 65634f63ba..ece721b6fe 100644 --- a/ext/standard/tests/serialize/bug65481.phpt +++ b/ext/standard/tests/serialize/bug65481.phpt @@ -5,29 +5,29 @@ Bug #65481 (shutdown segfault due to serialize) echo "Test\n"; class A { - public $e = array(); + public $e = array(); } class Token implements \Serializable { - public function serialize() - { - $c = new A; + public function serialize() + { + $c = new A; - for ($i = 0; $i < 4; $i++) - { - $e = new A; - $c->e[] = $e; - $e->e = $c->e; - } + for ($i = 0; $i < 4; $i++) + { + $e = new A; + $c->e[] = $e; + $e->e = $c->e; + } - return serialize(array(serialize($c))); - } + return serialize(array(serialize($c))); + } - public function unserialize($str) - { - $r = unserialize($str); - $r = unserialize($r[0]); - } + public function unserialize($str) + { + $r = unserialize($str); + $r = unserialize($r[0]); + } } $token = new Token; diff --git a/ext/standard/tests/serialize/bug65806.phpt b/ext/standard/tests/serialize/bug65806.phpt index cefb923f23..166b694442 100644 --- a/ext/standard/tests/serialize/bug65806.phpt +++ b/ext/standard/tests/serialize/bug65806.phpt @@ -33,8 +33,8 @@ class myList { } public function __wakeup() { - $this->_obj = unserialize($this->_serialized); - } + $this->_obj = unserialize($this->_serialized); + } } echo "SCRIPT START" . PHP_EOL; diff --git a/ext/standard/tests/serialize/bug67072.phpt b/ext/standard/tests/serialize/bug67072.phpt index 951db75a07..df0593180d 100644 --- a/ext/standard/tests/serialize/bug67072.phpt +++ b/ext/standard/tests/serialize/bug67072.phpt @@ -2,7 +2,7 @@ Bug #67072 Echoing unserialized "SplFileObject" crash --FILE-- <?php - echo unserialize('O:13:"SplFileObject":1:{s:9:"*filename";s:15:"/home/flag/flag";}'); + echo unserialize('O:13:"SplFileObject":1:{s:9:"*filename";s:15:"/home/flag/flag";}'); ?> ===DONE== --EXPECTF-- diff --git a/ext/standard/tests/serialize/bug68044.phpt b/ext/standard/tests/serialize/bug68044.phpt index 01ada07ad8..dc6053c501 100644 --- a/ext/standard/tests/serialize/bug68044.phpt +++ b/ext/standard/tests/serialize/bug68044.phpt @@ -2,7 +2,7 @@ Bug #68044 Integer overflow in unserialize() (32-bits only) --FILE-- <?php - echo unserialize('C:3:"XYZ":18446744075857035259:{}'); + echo unserialize('C:3:"XYZ":18446744075857035259:{}'); ?> ===DONE== --EXPECTF-- diff --git a/ext/standard/tests/serialize/bug68594.phpt b/ext/standard/tests/serialize/bug68594.phpt index fbf9310d0b..69ff9e2bf4 100644 --- a/ext/standard/tests/serialize/bug68594.phpt +++ b/ext/standard/tests/serialize/bug68594.phpt @@ -3,19 +3,19 @@ Bug #68545 Use after free vulnerability in unserialize() --FILE-- <?php for ($i=4; $i<100; $i++) { - $m = new StdClass(); + $m = new StdClass(); - $u = array(1); + $u = array(1); - $m->aaa = array(1,2,&$u,4,5); - $m->bbb = 1; - $m->ccc = &$u; - $m->ddd = str_repeat("A", $i); + $m->aaa = array(1,2,&$u,4,5); + $m->bbb = 1; + $m->ccc = &$u; + $m->ddd = str_repeat("A", $i); - $z = serialize($m); - $z = str_replace("bbb", "aaa", $z); - $y = unserialize($z); - $z = serialize($y); + $z = serialize($m); + $z = str_replace("bbb", "aaa", $z); + $y = unserialize($z); + $z = serialize($y); } ?> ===DONE=== diff --git a/ext/standard/tests/serialize/bug68976.phpt b/ext/standard/tests/serialize/bug68976.phpt index d9ca33bdf7..514bd8b453 100644 --- a/ext/standard/tests/serialize/bug68976.phpt +++ b/ext/standard/tests/serialize/bug68976.phpt @@ -3,10 +3,10 @@ Bug #68976 Use After Free Vulnerability in unserialize() --FILE-- <?php class evilClass { - public $name; - function __wakeup() { - unset($this->name); - } + public $name; + function __wakeup() { + unset($this->name); + } } $fakezval = pack( diff --git a/ext/standard/tests/serialize/bug69210.phpt b/ext/standard/tests/serialize/bug69210.phpt index c06fe50e02..610c88f879 100644 --- a/ext/standard/tests/serialize/bug69210.phpt +++ b/ext/standard/tests/serialize/bug69210.phpt @@ -4,22 +4,22 @@ serialize() integrity with non string on __sleep <?php class testString { - public $a = true; + public $a = true; - public function __sleep() - { - return array('a', '1'); - } + public function __sleep() + { + return array('a', '1'); + } } class testInteger { - public $a = true; + public $a = true; - public function __sleep() - { - return array('a', 1); - } + public function __sleep() + { + return array('a', 1); + } } $cs = new testString(); diff --git a/ext/standard/tests/serialize/bug69425.phpt b/ext/standard/tests/serialize/bug69425.phpt index c7f4265789..e080fda7dd 100644 --- a/ext/standard/tests/serialize/bug69425.phpt +++ b/ext/standard/tests/serialize/bug69425.phpt @@ -6,12 +6,12 @@ Bug #69425: Use After Free in unserialize() // POC 1 class test { - var $ryat; + var $ryat; - function __wakeup() - { - $this->ryat = 1; - } + function __wakeup() + { + $this->ryat = 1; + } } $data = unserialize('a:2:{i:0;O:4:"test":1:{s:4:"ryat";R:1;}i:1;i:2;}'); diff --git a/ext/standard/tests/serialize/bug70172.phpt b/ext/standard/tests/serialize/bug70172.phpt index a2359d6434..18bc2fe85d 100644 --- a/ext/standard/tests/serialize/bug70172.phpt +++ b/ext/standard/tests/serialize/bug70172.phpt @@ -3,13 +3,13 @@ Bug #70172 - Use After Free Vulnerability in unserialize() --FILE-- <?php class obj implements Serializable { - var $data; - function serialize() { - return serialize($this->data); - } - function unserialize($data) { - $this->data = unserialize($data); - } + var $data; + function serialize() { + return serialize($this->data); + } + function unserialize($data) { + $this->data = unserialize($data); + } } $fakezval = ptr2str(1122334455); @@ -25,19 +25,19 @@ $exploit = 'a:2:{i:0;i:1;i:1;C:3:"obj":'.strlen($inner).':{'.$inner.'}}'; $data = unserialize($exploit); for ($i = 0; $i < 5; $i++) { - $v[$i] = $fakezval.$i; + $v[$i] = $fakezval.$i; } var_dump($data); function ptr2str($ptr) { - $out = ''; - for ($i = 0; $i < 8; $i++) { - $out .= chr($ptr & 0xff); - $ptr >>= 8; - } - return $out; + $out = ''; + for ($i = 0; $i < 8; $i++) { + $out .= chr($ptr & 0xff); + $ptr >>= 8; + } + return $out; } ?> --EXPECTF-- diff --git a/ext/standard/tests/serialize/bug70172_2.phpt b/ext/standard/tests/serialize/bug70172_2.phpt index 2b12a78edb..771f9ba1d7 100644 --- a/ext/standard/tests/serialize/bug70172_2.phpt +++ b/ext/standard/tests/serialize/bug70172_2.phpt @@ -3,20 +3,20 @@ Bug #70172 - Use After Free Vulnerability in unserialize() --FILE-- <?php class obj implements Serializable { - var $data; - function serialize() { - return serialize($this->data); - } - function unserialize($data) { - $this->data = unserialize($data); - } + var $data; + function serialize() { + return serialize($this->data); + } + function unserialize($data) { + $this->data = unserialize($data); + } } class obj2 { - var $ryat; - function __wakeup() { - $this->ryat = 1; - } + var $ryat; + function __wakeup() { + $this->ryat = 1; + } } $fakezval = ptr2str(1122334455); @@ -32,19 +32,19 @@ $exploit = 'a:2:{i:0;O:4:"obj2":1:{s:4:"ryat";C:3:"obj":'.strlen($inner).':{'.$i $data = unserialize($exploit); for ($i = 0; $i < 5; $i++) { - $v[$i] = $fakezval.$i; + $v[$i] = $fakezval.$i; } var_dump($data); function ptr2str($ptr) { - $out = ''; - for ($i = 0; $i < 8; $i++) { - $out .= chr($ptr & 0xff); - $ptr >>= 8; - } - return $out; + $out = ''; + for ($i = 0; $i < 8; $i++) { + $out .= chr($ptr & 0xff); + $ptr >>= 8; + } + return $out; } ?> --EXPECTF-- diff --git a/ext/standard/tests/serialize/bug70213.phpt b/ext/standard/tests/serialize/bug70213.phpt index fd7d4001f8..7129fe45f6 100644 --- a/ext/standard/tests/serialize/bug70213.phpt +++ b/ext/standard/tests/serialize/bug70213.phpt @@ -6,7 +6,7 @@ Bug #70213: Unserialize context shared on double class lookup ini_set('unserialize_callback_func', 'evil'); function evil() { - spl_autoload_register(function ($arg) { + spl_autoload_register(function ($arg) { var_dump(unserialize('R:1;')); }); } diff --git a/ext/standard/tests/serialize/bug70436.phpt b/ext/standard/tests/serialize/bug70436.phpt index 1bbf3b98ab..9cd97a689c 100644 --- a/ext/standard/tests/serialize/bug70436.phpt +++ b/ext/standard/tests/serialize/bug70436.phpt @@ -5,17 +5,17 @@ Bug #70436: Use After Free Vulnerability in unserialize() class obj implements Serializable { - var $data; + var $data; - function serialize() - { - return serialize($this->data); - } + function serialize() + { + return serialize($this->data); + } - function unserialize($data) - { - $this->data = unserialize($data); - } + function unserialize($data) + { + $this->data = unserialize($data); + } } $fakezval = ptr2str(1122334455); @@ -34,14 +34,14 @@ var_dump($data); function ptr2str($ptr) { - $out = ''; + $out = ''; - for ($i = 0; $i < 8; $i++) { - $out .= chr($ptr & 0xff); - $ptr >>= 8; - } + for ($i = 0; $i < 8; $i++) { + $out .= chr($ptr & 0xff); + $ptr >>= 8; + } - return $out; + return $out; } ?> DONE diff --git a/ext/standard/tests/serialize/bug70513.phpt b/ext/standard/tests/serialize/bug70513.phpt index cbdbdb8222..4f228b5b7b 100644 --- a/ext/standard/tests/serialize/bug70513.phpt +++ b/ext/standard/tests/serialize/bug70513.phpt @@ -7,12 +7,12 @@ Bug #70513: GMP Deserialization Type Confusion Vulnerability class obj { - var $ryat; + var $ryat; - function __wakeup() - { - $this->ryat = 1; - } + function __wakeup() + { + $this->ryat = 1; + } } $obj = new stdClass; diff --git a/ext/standard/tests/serialize/bug71995.phpt b/ext/standard/tests/serialize/bug71995.phpt index 0f7ac98722..f1c45d25cc 100644 --- a/ext/standard/tests/serialize/bug71995.phpt +++ b/ext/standard/tests/serialize/bug71995.phpt @@ -4,13 +4,13 @@ Bug #71995 (Returning the same var twice from __sleep() produces broken serializ <?php class A { - public $b; - public function __construct() { - $this->b = new StdClass(); - } - public function __sleep() { - return array("b", "b"); - } + public $b; + public function __construct() { + $this->b = new StdClass(); + } + public function __sleep() { + return array("b", "b"); + } } $a = new A(); $s = serialize($a); diff --git a/ext/standard/tests/serialize/bug72731.phpt b/ext/standard/tests/serialize/bug72731.phpt index 020fb3281f..9489928cfb 100644 --- a/ext/standard/tests/serialize/bug72731.phpt +++ b/ext/standard/tests/serialize/bug72731.phpt @@ -4,10 +4,10 @@ Bug #72731: Type Confusion in Object Deserialization <?php class obj { - var $ryat; - function __wakeup() { - $this->ryat = 0x1122334455; - } + var $ryat; + function __wakeup() { + $this->ryat = 0x1122334455; + } } $poc = 'O:8:"stdClass":1:{i:0;O:3:"obj":1:{s:4:"ryat";R:1;}}'; diff --git a/ext/standard/tests/serialize/bug73341.phpt b/ext/standard/tests/serialize/bug73341.phpt index 86fd457c60..2f38949c1a 100644 --- a/ext/standard/tests/serialize/bug73341.phpt +++ b/ext/standard/tests/serialize/bug73341.phpt @@ -6,7 +6,7 @@ try { $token = 'a:2:{i:0;O:1:"0":2:0s:1:"0";i:0;s:1:"0";a:1:{i:0;C:11:"ArrayObject":7:{x:i:0;r}'; $obj = unserialize($token); } catch(Exception $e) { - echo $e->getMessage()."\n"; + echo $e->getMessage()."\n"; } try { @@ -14,7 +14,7 @@ $inner = 'x:i:1;O:8:"stdClass":1:{};m:a:0:{}'; $exploit = 'C:11:"ArrayObject":'.strlen($inner).':{'.$inner.'}'; unserialize($exploit); } catch(Exception $e) { - echo $e->getMessage()."\n"; + echo $e->getMessage()."\n"; } ?> --EXPECTF-- diff --git a/ext/standard/tests/serialize/bug76300.phpt b/ext/standard/tests/serialize/bug76300.phpt index 13e50f0332..156c31a909 100644 --- a/ext/standard/tests/serialize/bug76300.phpt +++ b/ext/standard/tests/serialize/bug76300.phpt @@ -3,19 +3,19 @@ Bug #76300: Unserialize of extended protected member broken --FILE-- <?php class Base { - private $id; - public function __construct($id) - { - $this->id = $id; - } + private $id; + public function __construct($id) + { + $this->id = $id; + } } class Derived extends Base { - protected $id; - public function __construct($id) - { - parent::__construct($id + 20); - $this->id = $id; - } + protected $id; + public function __construct($id) + { + parent::__construct($id + 20); + $this->id = $id; + } } $a = new Derived(44); $s = serialize($a); diff --git a/ext/standard/tests/serialize/precision.phpt b/ext/standard/tests/serialize/precision.phpt index 229c514e69..ec6d8e3408 100644 --- a/ext/standard/tests/serialize/precision.phpt +++ b/ext/standard/tests/serialize/precision.phpt @@ -8,30 +8,30 @@ if (pack('s', 1) != "\x01\x00") <?php $numbers = array( - "0000000000000000", //0 - "2d431cebe2362a3f", //.0002 - "2e431cebe2362a3f", //.0002 + 10^-Accuracy[.0002]*1.01 - "0000000000001000", //2^-1022. (minimum normal double) - "0100000000001000", //2^-1022. + 10^-Accuracy[2^-1022.]*1.01 - "ffffffffffffef7f", //2^1024. (maximum normal double) - "feffffffffffef7f", //2^1024. - 10^-Accuracy[2^1024.] - "0100000000000000", //minimum subnormal double - "0200000000000000", //2nd minimum subnormal double - "fffffffffffff000", //maximum subnormal double - "fefffffffffff000", //2nd maximum subnormal double - "0000000000000f7f", //+inf - "0000000000000fff", //-inf + "0000000000000000", //0 + "2d431cebe2362a3f", //.0002 + "2e431cebe2362a3f", //.0002 + 10^-Accuracy[.0002]*1.01 + "0000000000001000", //2^-1022. (minimum normal double) + "0100000000001000", //2^-1022. + 10^-Accuracy[2^-1022.]*1.01 + "ffffffffffffef7f", //2^1024. (maximum normal double) + "feffffffffffef7f", //2^1024. - 10^-Accuracy[2^1024.] + "0100000000000000", //minimum subnormal double + "0200000000000000", //2nd minimum subnormal double + "fffffffffffff000", //maximum subnormal double + "fefffffffffff000", //2nd maximum subnormal double + "0000000000000f7f", //+inf + "0000000000000fff", //-inf ); foreach ($numbers as $ns) { - $num = unpack("d", pack("H*", $ns)); $num = reset($num); - echo "number: ", sprintf("%.17e", $num), "... "; - $num2 = unserialize(serialize($num)); - $repr = unpack("H*", pack("d", $num2)); $repr = reset($repr); - if ($repr == $ns) - echo "OK\n"; - else - echo "mismatch\n\twas: $ns\n\tbecame: $repr\n"; + $num = unpack("d", pack("H*", $ns)); $num = reset($num); + echo "number: ", sprintf("%.17e", $num), "... "; + $num2 = unserialize(serialize($num)); + $repr = unpack("H*", pack("d", $num2)); $repr = reset($repr); + if ($repr == $ns) + echo "OK\n"; + else + echo "mismatch\n\twas: $ns\n\tbecame: $repr\n"; } --EXPECT-- number: 0.00000000000000000e+0... OK diff --git a/ext/standard/tests/serialize/serialization_arrays_002.phpt b/ext/standard/tests/serialize/serialization_arrays_002.phpt index 9fbf8d4ee7..67ad5b5daa 100644 --- a/ext/standard/tests/serialize/serialization_arrays_002.phpt +++ b/ext/standard/tests/serialize/serialization_arrays_002.phpt @@ -14,18 +14,18 @@ serialization: arrays with references amongst elements */ function check(&$a) { - var_dump($a); - $ser = serialize($a); - var_dump($ser); + var_dump($a); + $ser = serialize($a); + var_dump($ser); - $b = unserialize($ser); - var_dump($b); - $b[0] = "b0.changed"; - var_dump($b); - $b[1] = "b1.changed"; - var_dump($b); - $b[2] = "b2.changed"; - var_dump($b); + $b = unserialize($ser); + var_dump($b); + $b[0] = "b0.changed"; + var_dump($b); + $b[1] = "b1.changed"; + var_dump($b); + $b[2] = "b2.changed"; + var_dump($b); } echo "\n\n--- No references:\n"; diff --git a/ext/standard/tests/serialize/serialization_arrays_003.phpt b/ext/standard/tests/serialize/serialization_arrays_003.phpt index 18238d7b1e..8444f812a5 100644 --- a/ext/standard/tests/serialize/serialization_arrays_003.phpt +++ b/ext/standard/tests/serialize/serialization_arrays_003.phpt @@ -14,18 +14,18 @@ serialization: arrays with references to an external variable */ function check(&$a) { - var_dump($a); - $ser = serialize($a); - var_dump($ser); + var_dump($a); + $ser = serialize($a); + var_dump($ser); - $b = unserialize($ser); - var_dump($b); - $b[0] = "b0.changed"; - var_dump($b); - $b[1] = "b1.changed"; - var_dump($b); - $b[2] = "b2.changed"; - var_dump($b); + $b = unserialize($ser); + var_dump($b); + $b[0] = "b0.changed"; + var_dump($b); + $b[1] = "b1.changed"; + var_dump($b); + $b[2] = "b2.changed"; + var_dump($b); } echo "\n\n--- 0 refs external:\n"; diff --git a/ext/standard/tests/serialize/serialization_arrays_004.phpt b/ext/standard/tests/serialize/serialization_arrays_004.phpt index a6209688ea..e2e383ef82 100644 --- a/ext/standard/tests/serialize/serialization_arrays_004.phpt +++ b/ext/standard/tests/serialize/serialization_arrays_004.phpt @@ -14,18 +14,18 @@ serialization: arrays with references to the containing array */ function check(&$a) { - var_dump($a); - $ser = serialize($a); - var_dump($ser); + var_dump($a); + $ser = serialize($a); + var_dump($ser); - $b = unserialize($ser); - var_dump($b); - $b[0] = "b0.changed"; - var_dump($b); - $b[1] = "b1.changed"; - var_dump($b); - $b[2] = "b2.changed"; - var_dump($b); + $b = unserialize($ser); + var_dump($b); + $b[0] = "b0.changed"; + var_dump($b); + $b[1] = "b1.changed"; + var_dump($b); + $b[2] = "b2.changed"; + var_dump($b); } echo "\n\n--- 1 refs container:\n"; diff --git a/ext/standard/tests/serialize/serialization_arrays_005.phpt b/ext/standard/tests/serialize/serialization_arrays_005.phpt index 9d3bbcabea..b1f300b308 100644 --- a/ext/standard/tests/serialize/serialization_arrays_005.phpt +++ b/ext/standard/tests/serialize/serialization_arrays_005.phpt @@ -14,24 +14,24 @@ serialization: arrays with references, nested */ function check(&$a) { - var_dump($a); - $ser = serialize($a); - var_dump($ser); + var_dump($a); + $ser = serialize($a); + var_dump($ser); - $b = unserialize($ser); + $b = unserialize($ser); - // Change each element and dump result. - foreach($b as $k=>$v) { - if (is_array($v)){ - foreach($b[$k] as $sk=>$sv) { - $b[$k][$sk] = "b$k.$sk.changed"; - var_dump($b); - } - } else { - $b[$k] = "b$k.changed"; - var_dump($b); - } - } + // Change each element and dump result. + foreach($b as $k=>$v) { + if (is_array($v)){ + foreach($b[$k] as $sk=>$sv) { + $b[$k][$sk] = "b$k.$sk.changed"; + var_dump($b); + } + } else { + $b[$k] = "b$k.changed"; + var_dump($b); + } + } } echo "\n\n--- Nested array references 1 element in containing array:\n"; diff --git a/ext/standard/tests/serialize/serialization_objects_007.phpt b/ext/standard/tests/serialize/serialization_objects_007.phpt index ff584a0919..5082b7ff01 100644 --- a/ext/standard/tests/serialize/serialization_objects_007.phpt +++ b/ext/standard/tests/serialize/serialization_objects_007.phpt @@ -14,13 +14,13 @@ Ensure __autoload is called twice if unserialize_callback_func is defined. */ spl_autoload_register(function ($name) { - echo "in autoload($name)\n"; + echo "in autoload($name)\n"; }); ini_set('unserialize_callback_func','check'); function check($name) { - echo "in check($name)\n"; + echo "in check($name)\n"; } $o = unserialize('O:3:"FOO":0:{}'); diff --git a/ext/standard/tests/serialize/serialization_objects_010.phpt b/ext/standard/tests/serialize/serialization_objects_010.phpt index 32205209f7..51938710cd 100644 --- a/ext/standard/tests/serialize/serialization_objects_010.phpt +++ b/ext/standard/tests/serialize/serialization_objects_010.phpt @@ -14,18 +14,18 @@ Serialize() must return a string or NULL */ Class C implements Serializable { - public function serialize() { - return $this; - } + public function serialize() { + return $this; + } - public function unserialize($blah) { - } + public function unserialize($blah) { + } } try { - var_dump(serialize(new C)); + var_dump(serialize(new C)); } catch (Exception $e) { - echo $e->getMessage(). "\n"; + echo $e->getMessage(). "\n"; } echo "Done"; diff --git a/ext/standard/tests/serialize/serialization_objects_011.phpt b/ext/standard/tests/serialize/serialization_objects_011.phpt index a224a13d0c..9f360c2cb9 100644 --- a/ext/standard/tests/serialize/serialization_objects_011.phpt +++ b/ext/standard/tests/serialize/serialization_objects_011.phpt @@ -14,57 +14,57 @@ Object serialization / unserialization with inherited and hidden properties. */ Class A { - private $APriv = "A.APriv"; - protected $AProt = "A.AProt"; - public $APub = "A.APub"; + private $APriv = "A.APriv"; + protected $AProt = "A.AProt"; + public $APub = "A.APub"; - function audit() { - return isset($this->APriv, $this->AProt, $this->APub); - } + function audit() { + return isset($this->APriv, $this->AProt, $this->APub); + } } Class B extends A { - private $BPriv = "B.BPriv"; - protected $BProt = "B.BProt"; - public $BPub = "B.BPub"; - - function audit() { - return parent::audit() && isset($this->AProt, $this->APub, - $this->BPriv, $this->BProt, $this->BPub); - } + private $BPriv = "B.BPriv"; + protected $BProt = "B.BProt"; + public $BPub = "B.BPub"; + + function audit() { + return parent::audit() && isset($this->AProt, $this->APub, + $this->BPriv, $this->BProt, $this->BPub); + } } Class C extends B { - private $APriv = "C.APriv"; - protected $AProt = "C.AProt"; - public $APub = "C.APub"; - - private $CPriv = "C.CPriv"; - protected $CProt = "C.BProt"; - public $CPub = "C.CPub"; - - function audit() { - return parent::audit() && isset($this->APriv, $this->AProt, $this->APub, - $this->BProt, $this->BPub, - $this->CPriv, $this->CProt, $this->CPub); - } + private $APriv = "C.APriv"; + protected $AProt = "C.AProt"; + public $APub = "C.APub"; + + private $CPriv = "C.CPriv"; + protected $CProt = "C.BProt"; + public $CPub = "C.CPub"; + + function audit() { + return parent::audit() && isset($this->APriv, $this->AProt, $this->APub, + $this->BProt, $this->BPub, + $this->CPriv, $this->CProt, $this->CPub); + } } function prettyPrint($obj) { - echo "\n\nBefore serialization:\n"; - var_dump($obj); + echo "\n\nBefore serialization:\n"; + var_dump($obj); - echo "Serialized form:\n"; - $ser = serialize($obj); - $serPrintable = str_replace("\0", '\0', $ser); - var_dump($serPrintable); + echo "Serialized form:\n"; + $ser = serialize($obj); + $serPrintable = str_replace("\0", '\0', $ser); + var_dump($serPrintable); - echo "Unserialized:\n"; - $uobj = unserialize($ser); - var_dump($uobj); + echo "Unserialized:\n"; + $uobj = unserialize($ser); + var_dump($uobj); - echo "Sanity check: "; - var_dump($uobj->audit()); + echo "Sanity check: "; + var_dump($uobj->audit()); } echo "-- Test instance of A --\n"; diff --git a/ext/standard/tests/serialize/serialization_objects_013.phpt b/ext/standard/tests/serialize/serialization_objects_013.phpt index 3ff2d3cc11..547d7f75e8 100644 --- a/ext/standard/tests/serialize/serialization_objects_013.phpt +++ b/ext/standard/tests/serialize/serialization_objects_013.phpt @@ -14,18 +14,18 @@ Object serialization / unserialization: references amongst properties */ function check(&$obj) { - var_dump($obj); - $ser = serialize($obj); - var_dump($ser); + var_dump($obj); + $ser = serialize($obj); + var_dump($ser); - $uobj = unserialize($ser); - var_dump($uobj); - $uobj->a = "obj->a.changed"; - var_dump($uobj); - $uobj->b = "obj->b.changed"; - var_dump($uobj); - $uobj->c = "obj->c.changed"; - var_dump($uobj); + $uobj = unserialize($ser); + var_dump($uobj); + $uobj->a = "obj->a.changed"; + var_dump($uobj); + $uobj->b = "obj->b.changed"; + var_dump($uobj); + $uobj->c = "obj->c.changed"; + var_dump($uobj); } echo "\n\n--- a refs b:\n"; diff --git a/ext/standard/tests/serialize/serialization_objects_014.phpt b/ext/standard/tests/serialize/serialization_objects_014.phpt index fa15a577b0..b8bf6fd3bc 100644 --- a/ext/standard/tests/serialize/serialization_objects_014.phpt +++ b/ext/standard/tests/serialize/serialization_objects_014.phpt @@ -14,18 +14,18 @@ Object serialization / unserialization: references to external values */ function check(&$obj) { - var_dump($obj); - $ser = serialize($obj); - var_dump($ser); + var_dump($obj); + $ser = serialize($obj); + var_dump($ser); - $uobj = unserialize($ser); - var_dump($uobj); - $uobj->a = "obj->a.changed"; - var_dump($uobj); - $uobj->b = "obj->b.changed"; - var_dump($uobj); - $uobj->c = "obj->c.changed"; - var_dump($uobj); + $uobj = unserialize($ser); + var_dump($uobj); + $uobj->a = "obj->a.changed"; + var_dump($uobj); + $uobj->b = "obj->b.changed"; + var_dump($uobj); + $uobj->c = "obj->c.changed"; + var_dump($uobj); } echo "\n\n--- a refs external:\n"; diff --git a/ext/standard/tests/serialize/serialization_objects_015.phpt b/ext/standard/tests/serialize/serialization_objects_015.phpt index c1a6675db4..522450bfc1 100644 --- a/ext/standard/tests/serialize/serialization_objects_015.phpt +++ b/ext/standard/tests/serialize/serialization_objects_015.phpt @@ -4,18 +4,18 @@ Object serialization / unserialization: properties reference containing object <?php function check(&$obj) { - var_dump($obj); - $ser = serialize($obj); - var_dump($ser); + var_dump($obj); + $ser = serialize($obj); + var_dump($ser); - $uobj = unserialize($ser); - var_dump($uobj); - $uobj->a = "obj->a.changed"; - var_dump($uobj); - $uobj->b = "obj->b.changed"; - var_dump($uobj); - $uobj->c = "obj->c.changed"; - var_dump($uobj); + $uobj = unserialize($ser); + var_dump($uobj); + $uobj->a = "obj->a.changed"; + var_dump($uobj); + $uobj->b = "obj->b.changed"; + var_dump($uobj); + $uobj->c = "obj->c.changed"; + var_dump($uobj); } echo "\n\n--- a refs container:\n"; diff --git a/ext/standard/tests/serialize/typed_property_refs.phpt b/ext/standard/tests/serialize/typed_property_refs.phpt index 72bad612b0..3c8096a392 100644 --- a/ext/standard/tests/serialize/typed_property_refs.phpt +++ b/ext/standard/tests/serialize/typed_property_refs.phpt @@ -4,18 +4,18 @@ unserialize with references to typed properties shall skip the references or fai <?php class A { - public int $a; - public $b; + public int $a; + public $b; } class B { - public $a; - public int $b; + public $a; + public int $b; } class C { - public int $a; - public string $b; + public int $a; + public string $b; } class D { diff --git a/ext/standard/tests/serialize/unserialize_mem_leak.phpt b/ext/standard/tests/serialize/unserialize_mem_leak.phpt index 2a295d83b9..ad010df535 100644 --- a/ext/standard/tests/serialize/unserialize_mem_leak.phpt +++ b/ext/standard/tests/serialize/unserialize_mem_leak.phpt @@ -5,7 +5,7 @@ report_memleaks=1 --FILE-- <?php function foo() { - gc_collect_cycles(); + gc_collect_cycles(); } $str = 'a:1:{i:0;R:1;}'; diff --git a/ext/standard/tests/streams/bug40459.phpt b/ext/standard/tests/streams/bug40459.phpt index 9dc501170a..437e44e3d7 100644 --- a/ext/standard/tests/streams/bug40459.phpt +++ b/ext/standard/tests/streams/bug40459.phpt @@ -6,53 +6,53 @@ allow_url_fopen=1 <?php // Test whether the constructor of the user-space stream wrapper is called when stream functions are called class testwrapper { - private $constructorCalled = false; - function __construct() { - $this->constructorCalled = true; - } - - function stream_open($path, $mode, $options, &$opened_path) - { - echo $this->constructorCalled ? 'yes' : 'no'; - return true; - } - - function url_stat($url, $flags) - { - echo $this->constructorCalled ? 'yes' : 'no'; - return array(); - } - - function unlink($url) - { - echo $this->constructorCalled ? 'yes' : 'no'; - } - - function rename($from, $to) - { - echo $this->constructorCalled ? 'yes' : 'no'; - } - - function mkdir($dir, $mode, $options) - { - echo $this->constructorCalled ? 'yes' : 'no'; - } - - function rmdir($dir, $options) - { - echo $this->constructorCalled ? 'yes' : 'no'; - } - - function dir_opendir($url, $options) - { - echo $this->constructorCalled ? 'yes' : 'no'; - return TRUE; - } - function stream_metadata() - { - echo $this->constructorCalled ? 'yes' : 'no'; - return TRUE; - } + private $constructorCalled = false; + function __construct() { + $this->constructorCalled = true; + } + + function stream_open($path, $mode, $options, &$opened_path) + { + echo $this->constructorCalled ? 'yes' : 'no'; + return true; + } + + function url_stat($url, $flags) + { + echo $this->constructorCalled ? 'yes' : 'no'; + return array(); + } + + function unlink($url) + { + echo $this->constructorCalled ? 'yes' : 'no'; + } + + function rename($from, $to) + { + echo $this->constructorCalled ? 'yes' : 'no'; + } + + function mkdir($dir, $mode, $options) + { + echo $this->constructorCalled ? 'yes' : 'no'; + } + + function rmdir($dir, $options) + { + echo $this->constructorCalled ? 'yes' : 'no'; + } + + function dir_opendir($url, $options) + { + echo $this->constructorCalled ? 'yes' : 'no'; + return TRUE; + } + function stream_metadata() + { + echo $this->constructorCalled ? 'yes' : 'no'; + return TRUE; + } } stream_wrapper_register('test', 'testwrapper', STREAM_IS_URL); diff --git a/ext/standard/tests/streams/bug44818.phpt b/ext/standard/tests/streams/bug44818.phpt index 0446dfd3be..2fe14bd0f1 100644 --- a/ext/standard/tests/streams/bug44818.phpt +++ b/ext/standard/tests/streams/bug44818.phpt @@ -3,11 +3,11 @@ Bug #44818 (php://memory writeable when opened read only) --FILE-- <?php function test($url, $mode) { - echo "$url, $mode\n"; - $fd = fopen($url, $mode); - var_dump($fd, fwrite($fd, "foo")); - var_dump(fseek($fd, 0, SEEK_SET), fread($fd, 3)); - fclose($fd); + echo "$url, $mode\n"; + $fd = fopen($url, $mode); + var_dump($fd, fwrite($fd, "foo")); + var_dump(fseek($fd, 0, SEEK_SET), fread($fd, 3)); + fclose($fd); } test("php://memory","r"); test("php://memory","r+"); diff --git a/ext/standard/tests/streams/bug46024.phpt b/ext/standard/tests/streams/bug46024.phpt index 4fb0eee402..145e66c1bd 100644 --- a/ext/standard/tests/streams/bug46024.phpt +++ b/ext/standard/tests/streams/bug46024.phpt @@ -7,13 +7,13 @@ Bug #46024 stream_select() doesn't return the correct number $php = realpath(getenv('TEST_PHP_EXECUTABLE')); $pipes = array(); $proc = proc_open( - "$php -n -i" - ,array(0 => array('pipe', 'r'), 1 => array('pipe', 'w')) - ,$pipes, __DIR__, array(), array() + "$php -n -i" + ,array(0 => array('pipe', 'r'), 1 => array('pipe', 'w')) + ,$pipes, __DIR__, array(), array() ); var_dump($proc); if (!$proc) { - exit(1); + exit(1); } $r = array($pipes[1]); $w = array($pipes[0]); @@ -30,13 +30,13 @@ var_dump($ret === (count($r) + count($w))); foreach($pipes as $pipe) { - fclose($pipe); + fclose($pipe); } proc_terminate($proc); if (defined('SIGKILL')) { - proc_terminate($proc, SIGKILL); + proc_terminate($proc, SIGKILL); } else { - proc_terminate($proc); + proc_terminate($proc); } proc_close($proc); ?> diff --git a/ext/standard/tests/streams/bug53903.phpt b/ext/standard/tests/streams/bug53903.phpt index ca04a5ca14..d4c3586dd9 100644 --- a/ext/standard/tests/streams/bug53903.phpt +++ b/ext/standard/tests/streams/bug53903.phpt @@ -9,11 +9,11 @@ class sw { return true; } - public function stream_stat() { - return array( + public function stream_stat() { + return array( 'atime' => $this->undefined, ); - } + } } stream_wrapper_register('sx', 'sw') or die('failed'); diff --git a/ext/standard/tests/streams/bug60455_01.phpt b/ext/standard/tests/streams/bug60455_01.phpt index 466998201a..453be553c3 100644 --- a/ext/standard/tests/streams/bug60455_01.phpt +++ b/ext/standard/tests/streams/bug60455_01.phpt @@ -8,7 +8,7 @@ Bug #60455: stream_get_line and 1-line noeol input $domain = (strtoupper(substr(PHP_OS, 0, 3)) == 'WIN' ? STREAM_PF_INET : STREAM_PF_UNIX); $sockets = stream_socket_pair($domain, STREAM_SOCK_STREAM, STREAM_IPPROTO_IP) - or die("stream_socket_pair"); + or die("stream_socket_pair"); fwrite($sockets[0], "a"); stream_socket_shutdown($sockets[0], STREAM_SHUT_RDWR); diff --git a/ext/standard/tests/streams/bug60455_02.phpt b/ext/standard/tests/streams/bug60455_02.phpt index c68a1a07ab..632b12085c 100644 --- a/ext/standard/tests/streams/bug60455_02.phpt +++ b/ext/standard/tests/streams/bug60455_02.phpt @@ -3,19 +3,19 @@ Bug #60455: stream_get_line and 1-line followed by eol input --FILE-- <?php class TestStream { - private $s = 0; - function stream_open($path, $mode, $options, &$opened_path) { - return true; - } - function stream_read($count) { - if ($this->s++ == 0) - return "a\n"; + private $s = 0; + function stream_open($path, $mode, $options, &$opened_path) { + return true; + } + function stream_read($count) { + if ($this->s++ == 0) + return "a\n"; - return ""; - } - function stream_eof() { - return $this->s >= 2; - } + return ""; + } + function stream_eof() { + return $this->s >= 2; + } } diff --git a/ext/standard/tests/streams/bug60455_03.phpt b/ext/standard/tests/streams/bug60455_03.phpt index 4cfc373408..d0a48ea780 100644 --- a/ext/standard/tests/streams/bug60455_03.phpt +++ b/ext/standard/tests/streams/bug60455_03.phpt @@ -3,25 +3,25 @@ Bug #60455: stream_get_line and 2 lines, one possibly empty --FILE-- <?php class TestStream { - private $lines = array(); - private $s = 0; - private $eofth = 3; - function stream_open($path, $mode, $options, &$opened_path) { - $this->lines[] = "a\n"; - $this->lines[] = ($path == "test://nonempty2nd" ? "b\n" : "\n"); - if ($path == "test://eofafter2nd") - $this->eofth = 2; - return true; - } - function stream_read($count) { - if (key_exists($this->s++, $this->lines)) - return $this->lines[$this->s - 1]; + private $lines = array(); + private $s = 0; + private $eofth = 3; + function stream_open($path, $mode, $options, &$opened_path) { + $this->lines[] = "a\n"; + $this->lines[] = ($path == "test://nonempty2nd" ? "b\n" : "\n"); + if ($path == "test://eofafter2nd") + $this->eofth = 2; + return true; + } + function stream_read($count) { + if (key_exists($this->s++, $this->lines)) + return $this->lines[$this->s - 1]; - return ""; - } - function stream_eof() { - return $this->s >= $this->eofth; - } + return ""; + } + function stream_eof() { + return $this->s >= $this->eofth; + } } diff --git a/ext/standard/tests/streams/bug60455_04.phpt b/ext/standard/tests/streams/bug60455_04.phpt index 123a8653d3..73d2aadf53 100644 --- a/ext/standard/tests/streams/bug60455_04.phpt +++ b/ext/standard/tests/streams/bug60455_04.phpt @@ -4,19 +4,19 @@ read with EOL indication --FILE-- <?php class TestStream { - private $s = 0; - function stream_open($path, $mode, $options, &$opened_path) { - return true; - } - function stream_read($count) { - if ($this->s++ == 0) - return "a\n"; + private $s = 0; + function stream_open($path, $mode, $options, &$opened_path) { + return true; + } + function stream_read($count) { + if ($this->s++ == 0) + return "a\n"; - return ""; - } - function stream_eof() { - return $this->s >= 2; - } + return ""; + } + function stream_eof() { + return $this->s >= 2; + } } diff --git a/ext/standard/tests/streams/bug60602.phpt b/ext/standard/tests/streams/bug60602.phpt index 396695f772..b97f6f877a 100644 --- a/ext/standard/tests/streams/bug60602.phpt +++ b/ext/standard/tests/streams/bug60602.phpt @@ -4,9 +4,9 @@ Bug #60602 proc_open() modifies environment if it contains arrays <?php $descs = array( - 0 => array('pipe', 'r'), // stdin - 1 => array('pipe', 'w'), // stdout - 2 => array('pipe', 'w'), // strerr + 0 => array('pipe', 'r'), // stdin + 1 => array('pipe', 'w'), // stdout + 2 => array('pipe', 'w'), // strerr ); $environment = array('test' => array(1, 2, 3)); @@ -15,35 +15,35 @@ $cmd = (substr(PHP_OS, 0, 3) == 'WIN') ? 'dir' : 'ls'; $p = proc_open($cmd, $descs, $pipes, '.', $environment); if (is_resource($p)) { - $data = ''; + $data = ''; - while (1) { - $w = $e = NULL; - $n = stream_select($pipes, $w, $e, 300); + while (1) { + $w = $e = NULL; + $n = stream_select($pipes, $w, $e, 300); - if ($n === false) { - echo "no streams \n"; - break; - } else if ($n === 0) { - echo "process timed out\n"; - proc_terminate($p, 9); - break; - } else if ($n > 0) { - $line = fread($pipes[1], 8192); - if (strlen($line) == 0) { - /* EOF */ - break; - } - $data .= $line; - } - } - var_dump(strlen($data)); + if ($n === false) { + echo "no streams \n"; + break; + } else if ($n === 0) { + echo "process timed out\n"; + proc_terminate($p, 9); + break; + } else if ($n > 0) { + $line = fread($pipes[1], 8192); + if (strlen($line) == 0) { + /* EOF */ + break; + } + $data .= $line; + } + } + var_dump(strlen($data)); - $ret = proc_close($p); - var_dump($ret); - var_dump(is_array($environment['test'])); + $ret = proc_close($p); + var_dump($ret); + var_dump(is_array($environment['test'])); } else { - echo "no process\n"; + echo "no process\n"; } ?> --EXPECTF-- diff --git a/ext/standard/tests/streams/bug61019.phpt b/ext/standard/tests/streams/bug61019.phpt index db0bf9d6a5..929de1c2af 100644 --- a/ext/standard/tests/streams/bug61019.phpt +++ b/ext/standard/tests/streams/bug61019.phpt @@ -6,65 +6,65 @@ Bug #61019 (Out of memory on command stream_get_contents) echo "Test\n"; $descriptorspec = array( - 0 => array("pipe", "r"), // stdin is a pipe that the child will read from - 1 => array("pipe", "w"), // stdout is a pipe that the child will write to - 2 => array("pipe", "w") // stderr is a pipe that the child will write to + 0 => array("pipe", "r"), // stdin is a pipe that the child will read from + 1 => array("pipe", "w"), // stdout is a pipe that the child will write to + 2 => array("pipe", "w") // stderr is a pipe that the child will write to ); $process=proc_open("echo testtext",$descriptorspec,$pipes); if(is_resource($process)) { - stream_set_blocking($pipes[0],false); - stream_set_blocking($pipes[1],false); - stream_set_blocking($pipes[2],false); - stream_set_write_buffer($pipes[0],0); - stream_set_read_buffer($pipes[1],0); - stream_set_read_buffer($pipes[2],0); - $stdin_stream=""; - $stderr_stream=""; + stream_set_blocking($pipes[0],false); + stream_set_blocking($pipes[1],false); + stream_set_blocking($pipes[2],false); + stream_set_write_buffer($pipes[0],0); + stream_set_read_buffer($pipes[1],0); + stream_set_read_buffer($pipes[2],0); + $stdin_stream=""; + $stderr_stream=""; - echo "External command executed\n"; - do - { - $process_state=proc_get_status($process); - $tmp_stdin=stream_get_contents($pipes[1]); - if($tmp_stdin) - { - $stdin_stream=$stdin_stream.$tmp_stdin; - } - $tmp_stderr=stream_get_contents($pipes[2]); - if($tmp_stderr) - { - $stderr_stream=$stderr_stream.$tmp_stderr; - } - } while($process_state['running']); + echo "External command executed\n"; + do + { + $process_state=proc_get_status($process); + $tmp_stdin=stream_get_contents($pipes[1]); + if($tmp_stdin) + { + $stdin_stream=$stdin_stream.$tmp_stdin; + } + $tmp_stderr=stream_get_contents($pipes[2]); + if($tmp_stderr) + { + $stderr_stream=$stderr_stream.$tmp_stderr; + } + } while($process_state['running']); - echo "External command exit: ".$process_state['exitcode']."\n"; + echo "External command exit: ".$process_state['exitcode']."\n"; - //read outstanding data - $tmp_stdin=stream_get_contents($pipes[1]); - if($tmp_stdin) - { - $stdin_stream=$stdin_stream.$tmp_stdin; - } - $tmp_stderr=stream_get_contents($pipes[2]); - if($tmp_stderr) - { - $stderr_stream=$stderr_stream.$tmp_stderr; - } + //read outstanding data + $tmp_stdin=stream_get_contents($pipes[1]); + if($tmp_stdin) + { + $stdin_stream=$stdin_stream.$tmp_stdin; + } + $tmp_stderr=stream_get_contents($pipes[2]); + if($tmp_stderr) + { + $stderr_stream=$stderr_stream.$tmp_stderr; + } - fclose ($pipes[0]); - fclose ($pipes[1]); - fclose ($pipes[2]); + fclose ($pipes[0]); + fclose ($pipes[1]); + fclose ($pipes[2]); - proc_close($process); + proc_close($process); - echo "STDOUT: ".$stdin_stream."\n"; - echo "STDERR: ".$stderr_stream."\n"; + echo "STDOUT: ".$stdin_stream."\n"; + echo "STDERR: ".$stderr_stream."\n"; } else { - echo "Can't start external command\n"; + echo "Can't start external command\n"; } ?> --EXPECT-- diff --git a/ext/standard/tests/streams/bug61371-unix.phpt b/ext/standard/tests/streams/bug61371-unix.phpt index 7c64d1d30f..20361095f6 100644 --- a/ext/standard/tests/streams/bug61371-unix.phpt +++ b/ext/standard/tests/streams/bug61371-unix.phpt @@ -11,21 +11,21 @@ function test($doFclose) { $previous = null; $current = null; for($test=1;$test<=3;$test++) { - $current = memory_get_usage(true); - if (!is_null($previous)) { - var_dump($previous == $current); - } - $previous = $current; - echo 'memory: '.round($current / 1024, 0)."kb\n"; - for($i=0;$i<=100;$i++) { - $context = stream_context_create(array()); - $stream = stream_socket_client('udp://0.0.0.0:80', $errno, $errstr, 10, STREAM_CLIENT_CONNECT, $context); - if ($doFclose) fclose($stream); - unset($context); - unset($stream); - unset($errno); - unset($errstr); - } + $current = memory_get_usage(true); + if (!is_null($previous)) { + var_dump($previous == $current); + } + $previous = $current; + echo 'memory: '.round($current / 1024, 0)."kb\n"; + for($i=0;$i<=100;$i++) { + $context = stream_context_create(array()); + $stream = stream_socket_client('udp://0.0.0.0:80', $errno, $errstr, 10, STREAM_CLIENT_CONNECT, $context); + if ($doFclose) fclose($stream); + unset($context); + unset($stream); + unset($errno); + unset($errstr); + } } } diff --git a/ext/standard/tests/streams/bug61371.phpt b/ext/standard/tests/streams/bug61371.phpt index 924219f896..00e6372e85 100644 --- a/ext/standard/tests/streams/bug61371.phpt +++ b/ext/standard/tests/streams/bug61371.phpt @@ -6,21 +6,21 @@ function test($doFclose) { $previous = null; $current = null; for($test=1;$test<=3;$test++) { - $current = memory_get_usage(true); - if (!is_null($previous)) { - var_dump($previous == $current); - } - $previous = $current; - echo 'memory: '.round($current / 1024, 0)."kb\n"; - for($i=0;$i<=100;$i++) { - $context = stream_context_create(array()); - $stream = stream_socket_client('udp://127.0.0.1:80', $errno, $errstr, 10, STREAM_CLIENT_CONNECT, $context); - if ($doFclose) fclose($stream); - unset($context); - unset($stream); - unset($errno); - unset($errstr); - } + $current = memory_get_usage(true); + if (!is_null($previous)) { + var_dump($previous == $current); + } + $previous = $current; + echo 'memory: '.round($current / 1024, 0)."kb\n"; + for($i=0;$i<=100;$i++) { + $context = stream_context_create(array()); + $stream = stream_socket_client('udp://127.0.0.1:80', $errno, $errstr, 10, STREAM_CLIENT_CONNECT, $context); + if ($doFclose) fclose($stream); + unset($context); + unset($stream); + unset($errno); + unset($errstr); + } } } diff --git a/ext/standard/tests/streams/bug64166.phpt b/ext/standard/tests/streams/bug64166.phpt index e725a4b698..f03d9c15ac 100644 --- a/ext/standard/tests/streams/bug64166.phpt +++ b/ext/standard/tests/streams/bug64166.phpt @@ -9,8 +9,8 @@ function test_64166($data) { rewind($fd); $res = stream_filter_append($fd, 'convert.quoted-printable-encode', STREAM_FILTER_READ, array( - 'line-break-chars' => "\n", - 'line-length' => 74 + 'line-break-chars' => "\n", + 'line-length' => 74 )); var_dump(stream_get_contents($fd, -1, 0)); @@ -18,8 +18,8 @@ function test_64166($data) { rewind($fd); stream_filter_append($fd, 'convert.quoted-printable-encode', STREAM_FILTER_READ, array( - 'line-break-chars' => "\n", - 'line-length' => 6 + 'line-break-chars' => "\n", + 'line-length' => 6 )); var_dump(stream_get_contents($fd, -1, 0)); diff --git a/ext/standard/tests/streams/bug64166_2.phpt b/ext/standard/tests/streams/bug64166_2.phpt index b4224662ee..3321978bba 100644 --- a/ext/standard/tests/streams/bug64166_2.phpt +++ b/ext/standard/tests/streams/bug64166_2.phpt @@ -9,8 +9,8 @@ function test_64166($data) { rewind($fd); $res = stream_filter_append($fd, 'convert.quoted-printable-encode', STREAM_FILTER_READ, array( - 'line-break-chars' => "\n", - 'line-length' => 74 + 'line-break-chars' => "\n", + 'line-length' => 74 )); $str = ""; while(($c = fread($fd, 1))!= "") $str .= $c; @@ -20,8 +20,8 @@ function test_64166($data) { rewind($fd); stream_filter_append($fd, 'convert.quoted-printable-encode', STREAM_FILTER_READ, array( - 'line-break-chars' => "\n", - 'line-length' => 6 + 'line-break-chars' => "\n", + 'line-length' => 6 )); $str = ""; while(($c = fread($fd, 1))!= "") $str .= $c; diff --git a/ext/standard/tests/streams/bug64166_3.phpt b/ext/standard/tests/streams/bug64166_3.phpt index d896ba800c..5cc0077f79 100644 --- a/ext/standard/tests/streams/bug64166_3.phpt +++ b/ext/standard/tests/streams/bug64166_3.phpt @@ -6,8 +6,8 @@ Bug #64166: quoted-printable-encode stream filter incorrectly discarding whitesp function test_64166($data) { $fd = fopen('php://temp', 'w+'); $res = stream_filter_append($fd, 'convert.quoted-printable-encode', STREAM_FILTER_WRITE, array( - 'line-break-chars' => "\n", - 'line-length' => 74 + 'line-break-chars' => "\n", + 'line-length' => 74 )); fwrite($fd, $data); rewind($fd); @@ -18,8 +18,8 @@ function test_64166($data) { rewind($fd); stream_filter_append($fd, 'convert.quoted-printable-encode', STREAM_FILTER_WRITE, array( - 'line-break-chars' => "\n", - 'line-length' => 6 + 'line-break-chars' => "\n", + 'line-length' => 6 )); fwrite($fd, $data); rewind($fd); diff --git a/ext/standard/tests/streams/bug64433.phpt b/ext/standard/tests/streams/bug64433.phpt index bb22edee55..d1100c5713 100644 --- a/ext/standard/tests/streams/bug64433.phpt +++ b/ext/standard/tests/streams/bug64433.phpt @@ -20,7 +20,7 @@ echo file_get_contents("http://".PHP_CLI_SERVER_ADDRESS."/index.php"); echo "default\n"; $codes = array(200, 201, 204, 301, 302, 303, 304, 305, 307, 404, 500); foreach($codes as $code) { - echo "$code: ".file_get_contents("http://".PHP_CLI_SERVER_ADDRESS."/index.php?status=$code&loc=1"); + echo "$code: ".file_get_contents("http://".PHP_CLI_SERVER_ADDRESS."/index.php?status=$code&loc=1"); } echo "follow=0\n"; $arr = array('http'=> @@ -30,7 +30,7 @@ $arr = array('http'=> ); $context = stream_context_create($arr); foreach($codes as $code) { - echo "$code: ".file_get_contents("http://".PHP_CLI_SERVER_ADDRESS."/index.php?status=$code&loc=1", false, $context); + echo "$code: ".file_get_contents("http://".PHP_CLI_SERVER_ADDRESS."/index.php?status=$code&loc=1", false, $context); } echo "follow=1\n"; $arr = array('http'=> @@ -40,7 +40,7 @@ $arr = array('http'=> ); $context = stream_context_create($arr); foreach($codes as $code) { - echo "$code: ".file_get_contents("http://".PHP_CLI_SERVER_ADDRESS."/index.php?status=$code&loc=1", false, $context); + echo "$code: ".file_get_contents("http://".PHP_CLI_SERVER_ADDRESS."/index.php?status=$code&loc=1", false, $context); } --EXPECT-- HELLO! diff --git a/ext/standard/tests/streams/bug64433_srv.inc b/ext/standard/tests/streams/bug64433_srv.inc index dcdb1bcbaa..035343369c 100644 --- a/ext/standard/tests/streams/bug64433_srv.inc +++ b/ext/standard/tests/streams/bug64433_srv.inc @@ -1,14 +1,14 @@ if(!empty($_REQUEST["redir"])) { - echo "REDIRECTED\n"; - return; + echo "REDIRECTED\n"; + return; } if(!empty($_REQUEST["loc"])) { - header("Location: index.php?redir=1"); + header("Location: index.php?redir=1"); } if(!empty($_REQUEST["status"])) { - http_response_code($_REQUEST["status"]); + http_response_code($_REQUEST["status"]); } echo "HELLO!\n"; diff --git a/ext/standard/tests/streams/bug64770.phpt b/ext/standard/tests/streams/bug64770.phpt index df25d3f8ca..ba39bb5f84 100644 --- a/ext/standard/tests/streams/bug64770.phpt +++ b/ext/standard/tests/streams/bug64770.phpt @@ -4,9 +4,9 @@ Bug #64770 stream_select() fails with pipes from proc_open() <?php $descs = array( - 0 => array('pipe', 'r'), // stdin - 1 => array('pipe', 'w'), // stdout - 2 => array('pipe', 'w'), // strerr + 0 => array('pipe', 'r'), // stdin + 1 => array('pipe', 'w'), // stdout + 2 => array('pipe', 'w'), // strerr ); $other_opts = array('suppress_errors' => false); @@ -15,34 +15,34 @@ $cmd = (substr(PHP_OS, 0, 3) == 'WIN') ? 'dir' : 'ls'; $p = proc_open($cmd, $descs, $pipes, '.', NULL, $other_opts); if (is_resource($p)) { - $data = ''; + $data = ''; - while (1) { - $w = $e = NULL; - $n = stream_select($pipes, $w, $e, 300); + while (1) { + $w = $e = NULL; + $n = stream_select($pipes, $w, $e, 300); - if ($n === false) { - echo "no streams \n"; - break; - } else if ($n === 0) { - echo "process timed out\n"; - proc_terminate($p, 9); - break; - } else if ($n > 0) { - $line = fread($pipes[1], 8192); - if (strlen($line) == 0) { - /* EOF */ - break; - } - $data .= $line; - } - } - var_dump(strlen($data)); + if ($n === false) { + echo "no streams \n"; + break; + } else if ($n === 0) { + echo "process timed out\n"; + proc_terminate($p, 9); + break; + } else if ($n > 0) { + $line = fread($pipes[1], 8192); + if (strlen($line) == 0) { + /* EOF */ + break; + } + $data .= $line; + } + } + var_dump(strlen($data)); - $ret = proc_close($p); - var_dump($ret); + $ret = proc_close($p); + var_dump($ret); } else { - echo "no process\n"; + echo "no process\n"; } ?> --EXPECTF-- diff --git a/ext/standard/tests/streams/bug67626.phpt b/ext/standard/tests/streams/bug67626.phpt index 79aaed55cb..c251a40b92 100644 --- a/ext/standard/tests/streams/bug67626.phpt +++ b/ext/standard/tests/streams/bug67626.phpt @@ -4,24 +4,24 @@ Bug #67626: Exceptions not properly handled in user stream handlers <?php class MyStream { - public function stream_open() { return true; } + public function stream_open() { return true; } - public function stream_read() - { - throw new Exception('stream_read_exception'); - return 'read'; - } + public function stream_read() + { + throw new Exception('stream_read_exception'); + return 'read'; + } - public function stream_eof() - { - return true; - } + public function stream_eof() + { + return true; + } - public function stream_write() - { - throw new Exception('stream_write_exception'); - return 42; - } + public function stream_write() + { + throw new Exception('stream_write_exception'); + return 42; + } } stream_wrapper_register("my", "MyStream"); @@ -29,15 +29,15 @@ stream_wrapper_register("my", "MyStream"); $fp = fopen('my://foobar', 'r+'); try { - fread($fp, 42); + fread($fp, 42); } catch (Exception $e) { - echo $e->getMessage(); + echo $e->getMessage(); } echo "\n"; try { - fwrite($fp, 'foobar'); + fwrite($fp, 'foobar'); } catch (Exception $e) { - echo $e->getMessage(); + echo $e->getMessage(); } ?> --EXPECT-- diff --git a/ext/standard/tests/streams/bug69521.phpt b/ext/standard/tests/streams/bug69521.phpt index 75e1cdf99d..9ec244f799 100644 --- a/ext/standard/tests/streams/bug69521.phpt +++ b/ext/standard/tests/streams/bug69521.phpt @@ -19,15 +19,15 @@ fclose($link); while (!feof($fp)) { - $read = $write = array($fp); + $read = $write = array($fp); - if ($written === strlen($data)) - $write = array(); + if ($written === strlen($data)) + $write = array(); - $changed = stream_select($read, $write, $except, 0, 500000); + $changed = stream_select($read, $write, $except, 0, 500000); - if (!empty($read)) - echo fread($fp, 4); + if (!empty($read)) + echo fread($fp, 4); } ?> --EXPECT-- diff --git a/ext/standard/tests/streams/bug70198.phpt b/ext/standard/tests/streams/bug70198.phpt index 94585db882..fc9c30f6fe 100644 --- a/ext/standard/tests/streams/bug70198.phpt +++ b/ext/standard/tests/streams/bug70198.phpt @@ -10,9 +10,9 @@ server <?php /* What is checked here is - - start a server and listen - - as soon as client connects, close connection and exit - - on the client side - sleep(1) and check feof() + - start a server and listen + - as soon as client connects, close connection and exit + - on the client side - sleep(1) and check feof() */ $srv_addr = "tcp://127.0.0.1:8964"; @@ -22,15 +22,15 @@ $srv_fl_cont = <<<SRV \$socket = stream_socket_server('$srv_addr', \$errno, \$errstr); if (!\$socket) { - echo "\$errstr (\$errno)\\n"; + echo "\$errstr (\$errno)\\n"; } else { - if (\$conn = stream_socket_accept(\$socket, 3)) { - sleep(1); - /* just close the connection immediately after accepting, - the client side will need wait a bit longer to realize it.*/ - fclose(\$conn); - } - fclose(\$socket); + if (\$conn = stream_socket_accept(\$socket, 3)) { + sleep(1); + /* just close the connection immediately after accepting, + the client side will need wait a bit longer to realize it.*/ + fclose(\$conn); + } + fclose(\$socket); } SRV; file_put_contents($srv_fl, $srv_fl_cont); @@ -42,15 +42,15 @@ $i = 0; sleep(1); $fp = stream_socket_client($srv_addr, $errno, $errstr, 2); if (!$fp) { - echo "$errstr ($errno)\n"; + echo "$errstr ($errno)\n"; } else { - stream_set_blocking($fp, 0); - sleep(2); - while (!feof($fp)) { - ++$i; - } - fclose($fp); - var_dump($i); + stream_set_blocking($fp, 0); + sleep(2); + while (!feof($fp)) { + ++$i; + } + fclose($fp); + var_dump($i); } proc_close($srv_proc); diff --git a/ext/standard/tests/streams/bug71245.phpt b/ext/standard/tests/streams/bug71245.phpt index c9cad0c6d7..3dfda8d00a 100644 --- a/ext/standard/tests/streams/bug71245.phpt +++ b/ext/standard/tests/streams/bug71245.phpt @@ -4,15 +4,15 @@ Bug #71245 (file_get_contents() ignores "header" context option if it's a refere <?php $headers = ['Host: okey.com']; $httpContext = [ - 'http' => [ - 'protocol_version' => '1.1', - 'method' => 'GET', - 'header' => &$headers, - 'follow_location' => 0, - 'max_redirects' => 0, - 'ignore_errors' => true, - 'timeout' => 60, - ], + 'http' => [ + 'protocol_version' => '1.1', + 'method' => 'GET', + 'header' => &$headers, + 'follow_location' => 0, + 'max_redirects' => 0, + 'ignore_errors' => true, + 'timeout' => 60, + ], ]; $context = stream_context_create($httpContext); $headers = ["Host: bad.com"]; diff --git a/ext/standard/tests/streams/bug72853.phpt b/ext/standard/tests/streams/bug72853.phpt index 8de0264ac0..ab06f81e8c 100644 --- a/ext/standard/tests/streams/bug72853.phpt +++ b/ext/standard/tests/streams/bug72853.phpt @@ -10,8 +10,8 @@ if(substr(PHP_OS, 0, 3) == 'WIN' ) { <?php $descs = array( - 0 => array('pipe', 'r'), // stdin - 1 => array('pipe', 'w'), // stdout + 0 => array('pipe', 'r'), // stdin + 1 => array('pipe', 'w'), // stdout ); $p = proc_open("ls", $descs, $pipes, '.', NULL, NULL); diff --git a/ext/standard/tests/streams/bug72857.phpt b/ext/standard/tests/streams/bug72857.phpt index a74dff9c7e..f6addb1a63 100644 --- a/ext/standard/tests/streams/bug72857.phpt +++ b/ext/standard/tests/streams/bug72857.phpt @@ -2,16 +2,16 @@ Bug #72857 stream_socket_recvfrom read access violation --FILE-- <?php - $fname = __DIR__ . DIRECTORY_SEPARATOR . "stream_socket_recvfrom.tmp"; - $fp0 = fopen($fname, 'w'); - $v2=10; - $v3=STREAM_PEEK; - $v4="A"; + $fname = __DIR__ . DIRECTORY_SEPARATOR . "stream_socket_recvfrom.tmp"; + $fp0 = fopen($fname, 'w'); + $v2=10; + $v3=STREAM_PEEK; + $v4="A"; - var_dump(stream_socket_recvfrom($fp0,$v2,$v3,$v4), $v4); + var_dump(stream_socket_recvfrom($fp0,$v2,$v3,$v4), $v4); - fclose($fp0); - unlink($fname); + fclose($fp0); + unlink($fname); ?> --EXPECT-- bool(false) diff --git a/ext/standard/tests/streams/bug77664.phpt b/ext/standard/tests/streams/bug77664.phpt index ff2e317026..01722033b5 100644 --- a/ext/standard/tests/streams/bug77664.phpt +++ b/ext/standard/tests/streams/bug77664.phpt @@ -3,8 +3,8 @@ BUG #77664 (Segmentation fault when using undefined constant in custom wrapper) --FILE-- <?php class ErrorWrapper { - public $context; - public $var = self::INVALID; + public $context; + public $var = self::INVALID; } stream_wrapper_register('error',ErrorWrapper::class); file_get_contents('error://test'); diff --git a/ext/standard/tests/streams/bug78883.phpt b/ext/standard/tests/streams/bug78883.phpt index ed040e0044..7ce440a042 100644 --- a/ext/standard/tests/streams/bug78883.phpt +++ b/ext/standard/tests/streams/bug78883.phpt @@ -20,9 +20,9 @@ $pid = proc_get_status($proc)['pid']; sleep(3);
$bug_is_present = !proc_get_status($proc)['running'];
if (!$bug_is_present) {
- // if the bug is not present, it will hang waiting for stdin,
- // thus cmd is still running and we should kill it
- shell_exec("taskkill /T /F /PID {$pid} 2>nul");
+ // if the bug is not present, it will hang waiting for stdin,
+ // thus cmd is still running and we should kill it
+ shell_exec("taskkill /T /F /PID {$pid} 2>nul");
}
fclose($pipes[0]);
fclose($pipes[1]);
diff --git a/ext/standard/tests/streams/proc_open_bug51800.phpt b/ext/standard/tests/streams/proc_open_bug51800.phpt index d54ba00262..7cf502edd8 100644 --- a/ext/standard/tests/streams/proc_open_bug51800.phpt +++ b/ext/standard/tests/streams/proc_open_bug51800.phpt @@ -47,7 +47,7 @@ exit(0); '); if (!$r) { - die("couldn't create helper script '$callee'"); + die("couldn't create helper script '$callee'"); } $process = proc_open($cmd, $descriptors, $pipes); @@ -56,13 +56,13 @@ if (is_resource($process)) { fclose($pipes[0]); - while (!feof($pipes[1])) - $stdout .= fread($pipes[1], 1024); - fclose($pipes[1]); + while (!feof($pipes[1])) + $stdout .= fread($pipes[1], 1024); + fclose($pipes[1]); - while (!feof($pipes[2])) - $stderr .= fread($pipes[2], 1024); - fclose($pipes[2]); + while (!feof($pipes[2])) + $stderr .= fread($pipes[2], 1024); + fclose($pipes[2]); $status = proc_close($process); } diff --git a/ext/standard/tests/streams/proc_open_bug51800_right.phpt b/ext/standard/tests/streams/proc_open_bug51800_right.phpt index 12871cc1d3..c9e517cc65 100644 --- a/ext/standard/tests/streams/proc_open_bug51800_right.phpt +++ b/ext/standard/tests/streams/proc_open_bug51800_right.phpt @@ -31,7 +31,7 @@ exit(0); '); if (!$r) { - die("couldn't create helper script '$callee'"); + die("couldn't create helper script '$callee'"); } $process = proc_open($cmd, $descriptors, $pipes); diff --git a/ext/standard/tests/streams/proc_open_bug51800_right2.phpt b/ext/standard/tests/streams/proc_open_bug51800_right2.phpt index 1a2f69adbb..71b2fcc71a 100644 --- a/ext/standard/tests/streams/proc_open_bug51800_right2.phpt +++ b/ext/standard/tests/streams/proc_open_bug51800_right2.phpt @@ -27,17 +27,17 @@ $i0 = $i1 = 0; $step = 1024; while ($i0 < strlen($data0) && $i1 < strlen($data1)) { - fwrite(STDOUT, substr($data0, $i0, $step)); - fwrite(STDERR, substr($data1, $i1, $step)); - $i0 += $step; - $i1 += $step; + fwrite(STDOUT, substr($data0, $i0, $step)); + fwrite(STDERR, substr($data1, $i1, $step)); + $i0 += $step; + $i1 += $step; } exit(0); '); if (!$r) { - die("couldn't create helper script '$callee'"); + die("couldn't create helper script '$callee'"); } $process = proc_open($cmd, $descriptors, $pipes); diff --git a/ext/standard/tests/streams/proc_open_bug60120.phpt b/ext/standard/tests/streams/proc_open_bug60120.phpt index 053de2ebe0..9cce5a4c94 100644 --- a/ext/standard/tests/streams/proc_open_bug60120.phpt +++ b/ext/standard/tests/streams/proc_open_bug60120.phpt @@ -32,14 +32,14 @@ $process = proc_open( getcwd(), [], [ - 'suppress_errors' => true, + 'suppress_errors' => true, 'bypass_shell' => false ] ); if (!is_resource($process)) { die(sprintf( - "could not open process \"%s\"", + "could not open process \"%s\"", $command)); } diff --git a/ext/standard/tests/streams/proc_open_bug64438.phpt b/ext/standard/tests/streams/proc_open_bug64438.phpt index c310775a4d..8e4320cae9 100644 --- a/ext/standard/tests/streams/proc_open_bug64438.phpt +++ b/ext/standard/tests/streams/proc_open_bug64438.phpt @@ -6,9 +6,9 @@ Bug #64438 proc_open hangs with stdin/out with 4097+ bytes error_reporting(E_ALL); if (substr(PHP_OS, 0, 3) == 'WIN') { - $cmd = PHP_BINARY . ' -n -r "fwrite(STDOUT, $in = file_get_contents(\'php://stdin\')); fwrite(STDERR, $in);"'; + $cmd = PHP_BINARY . ' -n -r "fwrite(STDOUT, $in = file_get_contents(\'php://stdin\')); fwrite(STDERR, $in);"'; } else { - $cmd = PHP_BINARY . ' -n -r \'fwrite(STDOUT, $in = file_get_contents("php://stdin")); fwrite(STDERR, $in);\''; + $cmd = PHP_BINARY . ' -n -r \'fwrite(STDOUT, $in = file_get_contents("php://stdin")); fwrite(STDERR, $in);\''; } $descriptors = array(array('pipe', 'r'), array('pipe', 'w'), array('pipe', 'w')); $stdin = str_repeat('*', 4097); diff --git a/ext/standard/tests/streams/proc_open_bug69900.phpt b/ext/standard/tests/streams/proc_open_bug69900.phpt index e4d18b1cf8..de13d1bfdd 100644 --- a/ext/standard/tests/streams/proc_open_bug69900.phpt +++ b/ext/standard/tests/streams/proc_open_bug69900.phpt @@ -14,7 +14,7 @@ $in = fopen("php://stdin", "rb", false, stream_context_create(array("pipe" => ar while(!feof($in)){ $s = fgets($in); - fwrite(STDOUT, $s); + fwrite(STDOUT, $s); } ?>'; @@ -27,19 +27,19 @@ $process = proc_open(PHP_BINARY.' -n -f ' . $fl, $descriptorspec, $pipes, NULL, $moreThanLimit = 0; for($i = 0; $i < 10; $i++){ - fwrite($pipes[0], "hello$i\r\n"); - fflush($pipes[0]); + fwrite($pipes[0], "hello$i\r\n"); + fflush($pipes[0]); - $t0 = microtime(1); - $s = fgets($pipes[1]); - $t1 = microtime(1); + $t0 = microtime(1); + $s = fgets($pipes[1]); + $t1 = microtime(1); - echo $s; + echo $s; - $dt_ms = ($t1 - $t0)*1000; - if ($dt_ms > $max_ms) { + $dt_ms = ($t1 - $t0)*1000; + if ($dt_ms > $max_ms) { $moreThanLimit++; - } + } } fclose($pipes[0]); diff --git a/ext/standard/tests/streams/stream_context_tcp_nodelay.phpt b/ext/standard/tests/streams/stream_context_tcp_nodelay.phpt index 1e5b7e31d8..7af03726e6 100644 --- a/ext/standard/tests/streams/stream_context_tcp_nodelay.phpt +++ b/ext/standard/tests/streams/stream_context_tcp_nodelay.phpt @@ -8,16 +8,16 @@ if (!extension_loaded("sockets")) die("skip: need sockets"); --FILE-- <?php $ctxt = stream_context_create([ - "socket" => [ - "tcp_nodelay" => true - ] + "socket" => [ + "tcp_nodelay" => true + ] ]); $stream = stream_socket_client( - "tcp://www.php.net:80", $errno, $errstr, 10, STREAM_CLIENT_CONNECT, $ctxt); + "tcp://www.php.net:80", $errno, $errstr, 10, STREAM_CLIENT_CONNECT, $ctxt); $socket = - socket_import_stream($stream); + socket_import_stream($stream); var_dump(socket_get_option($socket, SOL_TCP, TCP_NODELAY) > 0); ?> diff --git a/ext/standard/tests/streams/stream_context_tcp_nodelay_fopen.phpt b/ext/standard/tests/streams/stream_context_tcp_nodelay_fopen.phpt index 7142dae73b..133b7a94ba 100644 --- a/ext/standard/tests/streams/stream_context_tcp_nodelay_fopen.phpt +++ b/ext/standard/tests/streams/stream_context_tcp_nodelay_fopen.phpt @@ -8,18 +8,18 @@ if (!extension_loaded("sockets")) die("skip: need sockets"); --FILE-- <?php $ctxt = stream_context_create([ - "socket" => [ - "tcp_nodelay" => true - ], - "http" => [ - "follow_location" => 0 - ] + "socket" => [ + "tcp_nodelay" => true + ], + "http" => [ + "follow_location" => 0 + ] ]); $stream = fopen("http://www.php.net", "r", false, $ctxt); $socket = - @socket_import_stream($stream); + @socket_import_stream($stream); var_dump(socket_get_option($socket, STREAM_IPPROTO_TCP, TCP_NODELAY) > 0); ?> diff --git a/ext/standard/tests/streams/stream_context_tcp_nodelay_server.phpt b/ext/standard/tests/streams/stream_context_tcp_nodelay_server.phpt index 420d5ad490..7d685e16df 100644 --- a/ext/standard/tests/streams/stream_context_tcp_nodelay_server.phpt +++ b/ext/standard/tests/streams/stream_context_tcp_nodelay_server.phpt @@ -6,40 +6,40 @@ stream context tcp_nodelay server <?php $serverCode = <<<'CODE' $ctxt = stream_context_create([ - "socket" => [ - "tcp_nodelay" => true - ] - ]); + "socket" => [ + "tcp_nodelay" => true + ] + ]); - $server = stream_socket_server( - "tcp://127.0.0.1:9099", $errno, $errstr, STREAM_SERVER_BIND | STREAM_SERVER_LISTEN, $ctxt); + $server = stream_socket_server( + "tcp://127.0.0.1:9099", $errno, $errstr, STREAM_SERVER_BIND | STREAM_SERVER_LISTEN, $ctxt); - $client = stream_socket_accept($server); + $client = stream_socket_accept($server); - var_dump(socket_get_option( - socket_import_stream($server), - SOL_TCP, TCP_NODELAY) > 0); + var_dump(socket_get_option( + socket_import_stream($server), + SOL_TCP, TCP_NODELAY) > 0); - var_dump(socket_get_option( - socket_import_stream($client), - SOL_TCP, TCP_NODELAY) > 0); + var_dump(socket_get_option( + socket_import_stream($client), + SOL_TCP, TCP_NODELAY) > 0); - fclose($client); - fclose($server); + fclose($client); + fclose($server); CODE; $clientCode = <<<'CODE' $test = stream_socket_client( - "tcp://127.0.0.1:9099", $errno, $errstr, 10); + "tcp://127.0.0.1:9099", $errno, $errstr, 10); - sleep(1); + sleep(1); - fclose($test); + fclose($test); CODE; include sprintf( - "%s/../../../openssl/tests/ServerClientTestCase.inc", - __DIR__); + "%s/../../../openssl/tests/ServerClientTestCase.inc", + __DIR__); ServerClientTestCase::getInstance()->run($serverCode, $clientCode); ?> --EXPECT-- diff --git a/ext/standard/tests/streams/stream_get_line_NUL_delimiter.phpt b/ext/standard/tests/streams/stream_get_line_NUL_delimiter.phpt index 8cdd5c1779..79daabd977 100644 --- a/ext/standard/tests/streams/stream_get_line_NUL_delimiter.phpt +++ b/ext/standard/tests/streams/stream_get_line_NUL_delimiter.phpt @@ -3,19 +3,19 @@ Bug #60455: stream_get_line and \0 as a delimiter --FILE-- <?php class TestStream { - private $s = 0; - function stream_open($path, $mode, $options, &$opened_path) { - return true; - } - function stream_read($count) { - if ($this->s++ == 0) - return "a\0"; + private $s = 0; + function stream_open($path, $mode, $options, &$opened_path) { + return true; + } + function stream_read($count) { + if ($this->s++ == 0) + return "a\0"; - return ""; - } - function stream_eof() { - return $this->s >= 2; - } + return ""; + } + function stream_eof() { + return $this->s >= 2; + } } diff --git a/ext/standard/tests/streams/stream_get_meta_data_file_variation1.phpt b/ext/standard/tests/streams/stream_get_meta_data_file_variation1.phpt index f7ccc7783b..9627367c72 100644 --- a/ext/standard/tests/streams/stream_get_meta_data_file_variation1.phpt +++ b/ext/standard/tests/streams/stream_get_meta_data_file_variation1.phpt @@ -15,13 +15,13 @@ fclose($fp); // open file in each access mode and get meta data foreach ($filemodes as $mode) { - if (strncmp($mode, 'x', 1) == 0) { - // x modes require that file does not exist - unlink($filename); - } - $fp = fopen($filename, $mode); - var_dump(stream_get_meta_data($fp)); - fclose($fp); + if (strncmp($mode, 'x', 1) == 0) { + // x modes require that file does not exist + unlink($filename); + } + $fp = fopen($filename, $mode); + var_dump(stream_get_meta_data($fp)); + fclose($fp); } unlink($filename); diff --git a/ext/standard/tests/streams/stream_get_meta_data_file_variation2.phpt b/ext/standard/tests/streams/stream_get_meta_data_file_variation2.phpt index 6b3fde203a..e0ebaab2ee 100644 --- a/ext/standard/tests/streams/stream_get_meta_data_file_variation2.phpt +++ b/ext/standard/tests/streams/stream_get_meta_data_file_variation2.phpt @@ -10,7 +10,7 @@ $fp = fopen($filename, "w+"); echo "Write some data to the file:\n"; $i = 0; while ($i++ < 20) { - fwrite($fp, "a line of data\n"); + fwrite($fp, "a line of data\n"); } var_dump(stream_get_meta_data($fp)); @@ -30,7 +30,7 @@ var_dump(stream_get_meta_data($fp)); echo "\n\nRead entire file:\n"; while(!feof($fp)) { - fread($fp, 1); + fread($fp, 1); } var_dump(stream_get_meta_data($fp)); diff --git a/ext/standard/tests/streams/stream_get_meta_data_file_variation5.phpt b/ext/standard/tests/streams/stream_get_meta_data_file_variation5.phpt index 22fcee4b6f..202fc7a2ec 100644 --- a/ext/standard/tests/streams/stream_get_meta_data_file_variation5.phpt +++ b/ext/standard/tests/streams/stream_get_meta_data_file_variation5.phpt @@ -10,7 +10,7 @@ $fp = fopen($filename, "w+"); echo "Write some data to the file:\n"; $i = 0; while ($i++ < 20) { - fwrite($fp, "a line of data\n"); + fwrite($fp, "a line of data\n"); } var_dump(stream_get_meta_data($fp)); @@ -20,7 +20,7 @@ rewind($fp); echo "\n\nRead entire file:\n"; while(!feof($fp)) { - fread($fp, 1); + fread($fp, 1); } var_dump(stream_get_meta_data($fp)); diff --git a/ext/standard/tests/streams/stream_get_meta_data_socket_variation1.phpt b/ext/standard/tests/streams/stream_get_meta_data_socket_variation1.phpt index 1c7f1fd256..9db45e8c2f 100644 --- a/ext/standard/tests/streams/stream_get_meta_data_socket_variation1.phpt +++ b/ext/standard/tests/streams/stream_get_meta_data_socket_variation1.phpt @@ -9,7 +9,7 @@ $server = stream_socket_server('tcp://127.0.0.1:31331'); /* Connect to it */ $client = fsockopen('tcp://127.0.0.1:31331'); if (!$client) { - die("Unable to create socket"); + die("Unable to create socket"); } /* Accept that connection */ @@ -31,7 +31,7 @@ echo "\n\nClose the server side socket and read the remaining data from the clie fclose($socket); fclose($server); while(!feof($client)) { - fread($client, 1); + fread($client, 1); } var_dump(stream_get_meta_data($client)); diff --git a/ext/standard/tests/streams/stream_get_meta_data_socket_variation2.phpt b/ext/standard/tests/streams/stream_get_meta_data_socket_variation2.phpt index cb713c8525..f6e6504536 100644 --- a/ext/standard/tests/streams/stream_get_meta_data_socket_variation2.phpt +++ b/ext/standard/tests/streams/stream_get_meta_data_socket_variation2.phpt @@ -9,7 +9,7 @@ $server = stream_socket_server('tcp://127.0.0.1:31332'); /* Connect to it */ $client = fsockopen('tcp://127.0.0.1:31332'); if (!$client) { - die("Unable to create socket"); + die("Unable to create socket"); } /* Accept that connection */ diff --git a/ext/standard/tests/streams/stream_get_meta_data_socket_variation3.phpt b/ext/standard/tests/streams/stream_get_meta_data_socket_variation3.phpt index c7f08cbe12..ef1a22a3a1 100644 --- a/ext/standard/tests/streams/stream_get_meta_data_socket_variation3.phpt +++ b/ext/standard/tests/streams/stream_get_meta_data_socket_variation3.phpt @@ -9,7 +9,7 @@ $server = stream_socket_server('tcp://127.0.0.1:31333'); /* Connect to it */ $client = fsockopen('tcp://127.0.0.1:31333'); if (!$client) { - die("Unable to create socket"); + die("Unable to create socket"); } /* Accept that connection */ diff --git a/ext/standard/tests/streams/stream_get_meta_data_socket_variation4.phpt b/ext/standard/tests/streams/stream_get_meta_data_socket_variation4.phpt index e37e991f16..cd83b1342c 100644 --- a/ext/standard/tests/streams/stream_get_meta_data_socket_variation4.phpt +++ b/ext/standard/tests/streams/stream_get_meta_data_socket_variation4.phpt @@ -9,7 +9,7 @@ $server = stream_socket_server('tcp://127.0.0.1:31334'); /* Connect to it */ $client = fsockopen('tcp://127.0.0.1:31334'); if (!$client) { - die("Unable to create socket"); + die("Unable to create socket"); } /* Accept that connection */ @@ -27,7 +27,7 @@ echo "\n\nClose the server side socket and read the remaining data from the clie fclose($socket); fclose($server); while(!feof($client)) { - fread($client, 1); + fread($client, 1); } var_dump(stream_get_meta_data($client)); diff --git a/ext/standard/tests/streams/stream_multi_filters_close.phpt b/ext/standard/tests/streams/stream_multi_filters_close.phpt index f1eb18a15c..6b955cf1a7 100644 --- a/ext/standard/tests/streams/stream_multi_filters_close.phpt +++ b/ext/standard/tests/streams/stream_multi_filters_close.phpt @@ -4,41 +4,41 @@ Check if multiple filters are closed correctly and never called again after clos <?php class FirstFilter extends php_user_filter { - public function filter($in, $out, &$consumed, $closing) { - static $closed = 0; - - while ($bucket = stream_bucket_make_writeable($in)) { - stream_bucket_append($out, stream_bucket_new($this->stream, $bucket->data)); - } - - if ($closing) { - $closed++; - } - - if ($closed > 0) { - var_dump($closed++); - } - return PSFS_PASS_ON; - } + public function filter($in, $out, &$consumed, $closing) { + static $closed = 0; + + while ($bucket = stream_bucket_make_writeable($in)) { + stream_bucket_append($out, stream_bucket_new($this->stream, $bucket->data)); + } + + if ($closing) { + $closed++; + } + + if ($closed > 0) { + var_dump($closed++); + } + return PSFS_PASS_ON; + } } class SecondFilter extends php_user_filter { - public function filter($in, $out, &$consumed, $closing) { - static $closed = 0; - - while ($bucket = stream_bucket_make_writeable($in)) { - stream_bucket_append($out, stream_bucket_new($this->stream, $bucket->data)); - } - - if ($closing) { - $closed++; - } - - if ($closed > 0) { - var_dump($closed++); - } - return PSFS_PASS_ON; - } + public function filter($in, $out, &$consumed, $closing) { + static $closed = 0; + + while ($bucket = stream_bucket_make_writeable($in)) { + stream_bucket_append($out, stream_bucket_new($this->stream, $bucket->data)); + } + + if ($closing) { + $closed++; + } + + if ($closed > 0) { + var_dump($closed++); + } + return PSFS_PASS_ON; + } } $r = fopen("php://stdout", "w+"); diff --git a/ext/standard/tests/streams/stream_set_chunk_size.phpt b/ext/standard/tests/streams/stream_set_chunk_size.phpt index 6b90f86cd0..ac50db6867 100644 --- a/ext/standard/tests/streams/stream_set_chunk_size.phpt +++ b/ext/standard/tests/streams/stream_set_chunk_size.phpt @@ -3,24 +3,24 @@ stream_set_chunk_size basic tests --FILE-- <?php class test_wrapper { - function stream_open($path, $mode, $openedpath) { - return true; - } - function stream_eof() { - return false; - } - function stream_read($count) { - echo "read with size: ", $count, "\n"; - return str_repeat('a', $count); - } - function stream_write($data) { - echo "write with size: ", strlen($data), "\n"; - return strlen($data); - } - function stream_set_option($option, $arg1, $arg2) { - echo "option: ", $option, ", ", $arg1, ", ", $arg2, "\n"; - return false; - } + function stream_open($path, $mode, $openedpath) { + return true; + } + function stream_eof() { + return false; + } + function stream_read($count) { + echo "read with size: ", $count, "\n"; + return str_repeat('a', $count); + } + function stream_write($data) { + echo "write with size: ", strlen($data), "\n"; + return strlen($data); + } + function stream_set_option($option, $arg1, $arg2) { + echo "option: ", $option, ", ", $arg1, ", ", $arg2, "\n"; + return false; + } } var_dump(stream_wrapper_register('test', 'test_wrapper')); diff --git a/ext/standard/tests/strings/add-and-stripslashes.phpt b/ext/standard/tests/strings/add-and-stripslashes.phpt index 6f01176d4e..4855ff02fe 100644 --- a/ext/standard/tests/strings/add-and-stripslashes.phpt +++ b/ext/standard/tests/strings/add-and-stripslashes.phpt @@ -5,14 +5,14 @@ addslashes() and stripslashes() functions $input = ''; for($i=0; $i<512; $i++) { - $input .= chr($i%256); + $input .= chr($i%256); } echo "Normal: "; if($input === stripslashes(addslashes($input))) { - echo "OK\n"; + echo "OK\n"; } else { - echo "FAILED\n"; + echo "FAILED\n"; } ?> diff --git a/ext/standard/tests/strings/addslashes_variation2.phpt b/ext/standard/tests/strings/addslashes_variation2.phpt index 4de6c75697..d4c0257b6e 100644 --- a/ext/standard/tests/strings/addslashes_variation2.phpt +++ b/ext/standard/tests/strings/addslashes_variation2.phpt @@ -43,7 +43,7 @@ $str_array = array( "", "\"", '"', - "hello\"", + "hello\"", // string with backslash characters 'Is your name Ram\Krishna?', @@ -65,7 +65,7 @@ $str_array = array( '"c:\php\"'.chr(0)."'", '"hello"'."'world'".chr(0).'//', - // string with hexadecimal number + // string with hexadecimal number "0xABCDEF0123456789", "\x00", '!@#$%&*@$%#&/;:,<>', diff --git a/ext/standard/tests/strings/basename.phpt b/ext/standard/tests/strings/basename.phpt Binary files differindex a39a6f9aeb..1f69bf4bce 100644 --- a/ext/standard/tests/strings/basename.phpt +++ b/ext/standard/tests/strings/basename.phpt diff --git a/ext/standard/tests/strings/bin2hex.phpt b/ext/standard/tests/strings/bin2hex.phpt index 42a4f4c594..dbc440c094 100644 --- a/ext/standard/tests/strings/bin2hex.phpt +++ b/ext/standard/tests/strings/bin2hex.phpt @@ -4,7 +4,7 @@ bin2hex() function <?php $s = ''; for($i=0; $i<256; $i++) { - $s .= chr($i); + $s .= chr($i); } echo bin2hex($s)."\n"; echo bin2hex("abc")."\n"; diff --git a/ext/standard/tests/strings/bin2hex_basic.phpt b/ext/standard/tests/strings/bin2hex_basic.phpt index 9079f77323..8842b8fea8 100644 --- a/ext/standard/tests/strings/bin2hex_basic.phpt +++ b/ext/standard/tests/strings/bin2hex_basic.phpt @@ -13,15 +13,15 @@ echo "*** Testing bin2hex() : basic functionality ***\n"; // array with different values for $string $strings = array ( - //double quoted strings + //double quoted strings /*1*/ "Here is a simple string", - "\t This String contains \t\t some control characters\r\n", - "\x90\x91\x00\x93\x94\x90\x91\x95\x96\x97\x98\x99\x9a\x9b\x9c\x9d\x9e\x9f", + "\t This String contains \t\t some control characters\r\n", + "\x90\x91\x00\x93\x94\x90\x91\x95\x96\x97\x98\x99\x9a\x9b\x9c\x9d\x9e\x9f", - //single quoted strings + //single quoted strings /*4*/ 'Here is a simple string', - '\t This String contains \t\t some control characters\r\n', - '\x90\x91\x00\x93\x94\x90\x91\x95\x96\x97\x98\x99\x9a\x9b\x9c\x9d\x9e\x9f', + '\t This String contains \t\t some control characters\r\n', + '\x90\x91\x00\x93\x94\x90\x91\x95\x96\x97\x98\x99\x9a\x9b\x9c\x9d\x9e\x9f', ); // loop through with each element of the $strings array to test bin2hex() function diff --git a/ext/standard/tests/strings/bug20108.phpt b/ext/standard/tests/strings/bug20108.phpt index 6e2219d990..e0be12b242 100644 --- a/ext/standard/tests/strings/bug20108.phpt +++ b/ext/standard/tests/strings/bug20108.phpt @@ -2,9 +2,9 @@ Bug #20108 (Segfault on printf statement) --FILE-- <?php - $a = "boo"; - $z = sprintf("%580.58s\n", $a); - var_dump($z); + $a = "boo"; + $z = sprintf("%580.58s\n", $a); + var_dump($z); ?> --EXPECT-- string(581) " boo diff --git a/ext/standard/tests/strings/bug20169.phpt b/ext/standard/tests/strings/bug20169.phpt index c606578677..fd5de0ee88 100644 --- a/ext/standard/tests/strings/bug20169.phpt +++ b/ext/standard/tests/strings/bug20169.phpt @@ -2,12 +2,12 @@ Bug #20169 (implode() clobbers first argument) --FILE-- <?php - @set_time_limit(5); - $delimiter = "|"; + @set_time_limit(5); + $delimiter = "|"; - echo "delimiter: $delimiter\n"; - implode($delimiter, array("foo", "bar")); - echo "delimiter: $delimiter\n"; + echo "delimiter: $delimiter\n"; + implode($delimiter, array("foo", "bar")); + echo "delimiter: $delimiter\n"; ?> --EXPECT-- delimiter: | diff --git a/ext/standard/tests/strings/bug21338.phpt b/ext/standard/tests/strings/bug21338.phpt index c84576563e..c118ee18de 100644 --- a/ext/standard/tests/strings/bug21338.phpt +++ b/ext/standard/tests/strings/bug21338.phpt @@ -2,8 +2,8 @@ Bug #20934 (html_entity_decode() crash when "" is passed) --FILE-- <?php - var_dump(html_entity_decode(NULL)); - var_dump(html_entity_decode("")); + var_dump(html_entity_decode(NULL)); + var_dump(html_entity_decode("")); ?> --EXPECT-- string(0) "" diff --git a/ext/standard/tests/strings/bug22187.phpt b/ext/standard/tests/strings/bug22187.phpt index dccaccc04d..9b77569b47 100644 --- a/ext/standard/tests/strings/bug22187.phpt +++ b/ext/standard/tests/strings/bug22187.phpt @@ -2,8 +2,8 @@ Bug #22187 (possible crash in number_format() function) --FILE-- <?php - var_dump(number_format(0.0001, 1)); - var_dump(number_format(0.0001, 0)); + var_dump(number_format(0.0001, 1)); + var_dump(number_format(0.0001, 0)); ?> --EXPECT-- string(3) "0.0" diff --git a/ext/standard/tests/strings/bug22207.phpt b/ext/standard/tests/strings/bug22207.phpt index 956acd2103..eddfa942e2 100644 --- a/ext/standard/tests/strings/bug22207.phpt +++ b/ext/standard/tests/strings/bug22207.phpt @@ -2,8 +2,8 @@ Bug #22207 (missing 0 when using the e notation in *printf functions) --FILE-- <?php - printf("%10.5e\n", 1.1); - var_dump(sprintf("%10.5e\n", 1.1)); + printf("%10.5e\n", 1.1); + var_dump(sprintf("%10.5e\n", 1.1)); ?> --EXPECT-- 1.10000e+0 diff --git a/ext/standard/tests/strings/bug22224.phpt b/ext/standard/tests/strings/bug22224.phpt index 0ab00a6c42..c9a669eb46 100644 --- a/ext/standard/tests/strings/bug22224.phpt +++ b/ext/standard/tests/strings/bug22224.phpt @@ -6,10 +6,10 @@ error_reporting=0 <?php class foo { - function __toString() - { - return "Object"; - } + function __toString() + { + return "Object"; + } } diff --git a/ext/standard/tests/strings/bug24098.phpt b/ext/standard/tests/strings/bug24098.phpt index 1998d9ed0a..16d2f7720e 100644 --- a/ext/standard/tests/strings/bug24098.phpt +++ b/ext/standard/tests/strings/bug24098.phpt @@ -4,7 +4,7 @@ Bug #24098 (pathinfo() crash) <?php if (DIRECTORY_SEPARATOR == '\\') die("skip directory separator won't match expected output"); ?> --FILE-- <?php - var_dump(pathinfo("/dsds.asa")); + var_dump(pathinfo("/dsds.asa")); ?> --EXPECT-- array(4) { diff --git a/ext/standard/tests/strings/bug24312.phpt b/ext/standard/tests/strings/bug24312.phpt index 5ec444dd58..fb1f494b18 100644 --- a/ext/standard/tests/strings/bug24312.phpt +++ b/ext/standard/tests/strings/bug24312.phpt @@ -4,8 +4,8 @@ Bug #24208 (base64_decode() not skipping 0xF0 - 0xFF) <?php $data = str_repeat("a", 100); for ($i = 0xF0; $i < 0xFF + 1; $i++) { - $enc = chunk_split(base64_encode($data), 10, chr($i)); - var_dump(base64_decode($enc)); + $enc = chunk_split(base64_encode($data), 10, chr($i)); + var_dump(base64_decode($enc)); } ?> --EXPECT-- diff --git a/ext/standard/tests/strings/bug25671.phpt b/ext/standard/tests/strings/bug25671.phpt index ab26ddf772..cd6dec6641 100644 --- a/ext/standard/tests/strings/bug25671.phpt +++ b/ext/standard/tests/strings/bug25671.phpt @@ -3,12 +3,12 @@ Bug #25671 (subarrays not copied correctly) --FILE-- <?php $arr = array( - "This is string one.", - "This is string two.", - array( - "This is another string.", - "This is a last string."), - "This is a last string."); + "This is string one.", + "This is string two.", + array( + "This is another string.", + "This is a last string."), + "This is a last string."); echo serialize(str_replace("string", "strung", $arr)) . "\n"; echo serialize(str_replace("string", "strung", $arr)) . "\n"; diff --git a/ext/standard/tests/strings/bug26817.phpt b/ext/standard/tests/strings/bug26817.phpt index 2e31d30be9..e3b6539a1c 100644 --- a/ext/standard/tests/strings/bug26817.phpt +++ b/ext/standard/tests/strings/bug26817.phpt @@ -3,18 +3,18 @@ Bug #26817 (http_build_query() did not handle private & protected object propert --FILE-- <?php class test { - protected $foo; - private $bar; - public $test; + protected $foo; + private $bar; + public $test; - function foo() - { - $this->bar = 'meuh'; - $this->foo = 'lala'; - $this->test = 'test'; + function foo() + { + $this->bar = 'meuh'; + $this->foo = 'lala'; + $this->test = 'test'; - var_dump(http_build_query($this)); - } + var_dump(http_build_query($this)); + } } $obj = new test(); diff --git a/ext/standard/tests/strings/bug26878.phpt b/ext/standard/tests/strings/bug26878.phpt index 602f710c83..da6c0a2aa4 100644 --- a/ext/standard/tests/strings/bug26878.phpt +++ b/ext/standard/tests/strings/bug26878.phpt @@ -2,8 +2,8 @@ Bug #26878 (problem with multiple references to the same variable with different types) --FILE-- <?php - printf('Int: %1$d and as string: %1$s', 'some string'); - echo "\n"; + printf('Int: %1$d and as string: %1$s', 'some string'); + echo "\n"; ?> --EXPECT-- Int: 0 and as string: some string diff --git a/ext/standard/tests/strings/bug27278.phpt b/ext/standard/tests/strings/bug27278.phpt index 1a94692d19..f3d8eced90 100644 --- a/ext/standard/tests/strings/bug27278.phpt +++ b/ext/standard/tests/strings/bug27278.phpt @@ -5,8 +5,8 @@ Bug #27278 (*printf() functions treat arguments as if passed by reference) function foo ($a) { - $a=sprintf("%02d",$a); - var_dump($a); + $a=sprintf("%02d",$a); + var_dump($a); } $x="02"; diff --git a/ext/standard/tests/strings/bug27295.phpt b/ext/standard/tests/strings/bug27295.phpt index d23d27049f..b8c53e4906 100644 --- a/ext/standard/tests/strings/bug27295.phpt +++ b/ext/standard/tests/strings/bug27295.phpt @@ -5,8 +5,8 @@ Bug #27295 (memory leak inside sscanf()) $strings = array("foo = bar", "bar = foo"); foreach( $strings as $string ) { - sscanf( $string, "%s = %[^[]]", $var, $val ); - echo "$var = $val\n"; + sscanf( $string, "%s = %[^[]]", $var, $val ); + echo "$var = $val\n"; } ?> --EXPECT-- diff --git a/ext/standard/tests/strings/bug27457.phpt b/ext/standard/tests/strings/bug27457.phpt index 6f5ec05f79..e9ac42e031 100644 --- a/ext/standard/tests/strings/bug27457.phpt +++ b/ext/standard/tests/strings/bug27457.phpt @@ -2,16 +2,16 @@ Bug #27457 (Problem with strtr() and translation array) --FILE-- <?php - $test = "Dot in brackets [.]\n"; - echo $test; - $test = strtr($test, array('.' => '0')); - echo $test; - $test = strtr($test, array('0' => '.')); - echo $test; - $test = strtr($test, '.', '0'); - echo $test; - $test = strtr($test, '0', '.'); - echo $test; + $test = "Dot in brackets [.]\n"; + echo $test; + $test = strtr($test, array('.' => '0')); + echo $test; + $test = strtr($test, array('0' => '.')); + echo $test; + $test = strtr($test, '.', '0'); + echo $test; + $test = strtr($test, '0', '.'); + echo $test; ?> --EXPECT-- Dot in brackets [.] diff --git a/ext/standard/tests/strings/bug28633.phpt b/ext/standard/tests/strings/bug28633.phpt index 5a1c2567fa..9dc83a40ad 100644 --- a/ext/standard/tests/strings/bug28633.phpt +++ b/ext/standard/tests/strings/bug28633.phpt @@ -2,8 +2,8 @@ Bug #28633 (sprintf incorrectly adding padding to floats) --FILE-- <?php - echo sprintf("%05.2f", 0.02) . "\n"; - echo sprintf("%05.2f", 2.02) . "\n"; + echo sprintf("%05.2f", 0.02) . "\n"; + echo sprintf("%05.2f", 2.02) . "\n"; ?> --EXPECT-- 00.02 diff --git a/ext/standard/tests/strings/bug29075.phpt b/ext/standard/tests/strings/bug29075.phpt index 7fe7da6c49..63a4fdb074 100644 --- a/ext/standard/tests/strings/bug29075.phpt +++ b/ext/standard/tests/strings/bug29075.phpt @@ -2,11 +2,11 @@ Bug #29075 (strnatcmp() incorrectly handles whitespace) --FILE-- <?php - var_dump( - strnatcmp('foo ', 'foo '), - strnatcmp('foo', 'foo'), - strnatcmp(' foo', ' foo') - ); + var_dump( + strnatcmp('foo ', 'foo '), + strnatcmp('foo', 'foo'), + strnatcmp(' foo', ' foo') + ); ?> --EXPECT-- int(0) diff --git a/ext/standard/tests/strings/bug29538.phpt b/ext/standard/tests/strings/bug29538.phpt index 6af25fb89a..13065a4e11 100644 --- a/ext/standard/tests/strings/bug29538.phpt +++ b/ext/standard/tests/strings/bug29538.phpt @@ -2,8 +2,8 @@ Bug #29538 (number_format and problem with 0) --FILE-- <?php - echo number_format(0.25, 2, '', ''), "\n"; - echo number_format(1234, 2, '', ','); + echo number_format(0.25, 2, '', ''), "\n"; + echo number_format(1234, 2, '', ','); ?> --EXPECT-- 025 diff --git a/ext/standard/tests/strings/bug36148.phpt b/ext/standard/tests/strings/bug36148.phpt index 06caac3334..2e9a81c5ea 100644 --- a/ext/standard/tests/strings/bug36148.phpt +++ b/ext/standard/tests/strings/bug36148.phpt @@ -4,10 +4,10 @@ Bug #36148 (unpack("H*hex", $data) is adding an extra character to the end of th <?php $values = array("a", "aa", "aaa", "aaaa"); foreach ($values as $value) { - $a = pack("H*", $value); - $b = unpack("H*", $a); - echo $value.": "; - var_dump($b); + $a = pack("H*", $value); + $b = unpack("H*", $a); + echo $value.": "; + var_dump($b); } ?> --EXPECT-- diff --git a/ext/standard/tests/strings/bug36392.phpt b/ext/standard/tests/strings/bug36392.phpt index 8e4cd16c67..b98f7e6293 100644 --- a/ext/standard/tests/strings/bug36392.phpt +++ b/ext/standard/tests/strings/bug36392.phpt @@ -2,11 +2,11 @@ Bug #36392 (wrong number of decimal digits with %e specifier in sprintf) --FILE-- <?php - echo sprintf("%e\n", 1.123456789); - echo sprintf("%.10e\n", 1.123456789); - echo sprintf("%.0e\n", 1.123456789); - echo sprintf("%.1e\n", 1.123456789); - echo sprintf("%5.1e\n", 1.123456789); + echo sprintf("%e\n", 1.123456789); + echo sprintf("%.10e\n", 1.123456789); + echo sprintf("%.0e\n", 1.123456789); + echo sprintf("%.1e\n", 1.123456789); + echo sprintf("%5.1e\n", 1.123456789); ?> --EXPECT-- 1.123457e+0 diff --git a/ext/standard/tests/strings/bug38770.phpt b/ext/standard/tests/strings/bug38770.phpt index 76ec33572b..a349ebff15 100644 --- a/ext/standard/tests/strings/bug38770.phpt +++ b/ext/standard/tests/strings/bug38770.phpt @@ -8,7 +8,7 @@ if (PHP_INT_SIZE != 8) die("skip this test is for 64bit platform only"); <?php foreach (array('N','l') as $v) { - print_r(unpack($v, pack($v, -30000))); + print_r(unpack($v, pack($v, -30000))); } echo "Done\n"; diff --git a/ext/standard/tests/strings/bug39873.phpt b/ext/standard/tests/strings/bug39873.phpt index 527b7d3c92..f264f6bb02 100644 --- a/ext/standard/tests/strings/bug39873.phpt +++ b/ext/standard/tests/strings/bug39873.phpt @@ -8,10 +8,10 @@ if (!setlocale(LC_ALL, "ita","it","Italian","it_IT","it_IT.ISO8859-1","it_IT.ISO ?> --FILE-- <?php - setlocale(LC_ALL, "ita","it","Italian","it_IT","it_IT.ISO8859-1","it_IT.ISO_8859-1"); - $num = 0+"1234.56"; - echo number_format($num,2); - echo "\n"; + setlocale(LC_ALL, "ita","it","Italian","it_IT","it_IT.ISO8859-1","it_IT.ISO_8859-1"); + $num = 0+"1234.56"; + echo number_format($num,2); + echo "\n"; ?> --EXPECT-- 1,234.56 diff --git a/ext/standard/tests/strings/bug45166.phpt b/ext/standard/tests/strings/bug45166.phpt index 0b694518df..2ed07b62f8 100644 --- a/ext/standard/tests/strings/bug45166.phpt +++ b/ext/standard/tests/strings/bug45166.phpt @@ -2,7 +2,7 @@ Bug #45166 (substr() ) --FILE-- <?php - echo substr('cd', -3) . "\n"; + echo substr('cd', -3) . "\n"; ?> --EXPECT-- cd diff --git a/ext/standard/tests/strings/bug48709.phpt b/ext/standard/tests/strings/bug48709.phpt index 6a93b8dae4..9e0789a61f 100644 --- a/ext/standard/tests/strings/bug48709.phpt +++ b/ext/standard/tests/strings/bug48709.phpt @@ -5,18 +5,18 @@ Bug #48709 (metaphone and 'wh') /* Initial letter exceptions */ $exceptions = array( - 'kn', // Drop first letter - 'gn', // ditto - 'pn', // ditto - 'ae', // ditto - 'wr', // ditto - 'x', // s - 'wh', // w - 'wa' // w + 'kn', // Drop first letter + 'gn', // ditto + 'pn', // ditto + 'ae', // ditto + 'wr', // ditto + 'x', // s + 'wh', // w + 'wa' // w ); foreach ($exceptions as $letter) { - printf("%s => %s\n", $letter, metaphone($letter)); + printf("%s => %s\n", $letter, metaphone($letter)); } ?> diff --git a/ext/standard/tests/strings/bug55871.phpt b/ext/standard/tests/strings/bug55871.phpt index 0c8fd4c6e6..60a857ec67 100644 --- a/ext/standard/tests/strings/bug55871.phpt +++ b/ext/standard/tests/strings/bug55871.phpt @@ -3,15 +3,15 @@ Bug #55871 (Interruption in substr_replace()) (PHP7) --FILE-- <?php class test1 { - public function __toString() { - preg_match('//', '', $GLOBALS['my_var']); - return ''; - } + public function __toString() { + preg_match('//', '', $GLOBALS['my_var']); + return ''; + } } class test2 { public function __toString() { - $GLOBALS['my_var'] += 0x08048000; + $GLOBALS['my_var'] += 0x08048000; return ''; } } diff --git a/ext/standard/tests/strings/bug65230.phpt b/ext/standard/tests/strings/bug65230.phpt index 4363462934..1efcc6cf2e 100644 --- a/ext/standard/tests/strings/bug65230.phpt +++ b/ext/standard/tests/strings/bug65230.phpt @@ -13,16 +13,16 @@ date.timezone=Europe/Berlin function test($locale, $value) { - $newlocale = setlocale(LC_ALL, $locale); - $conv = localeconv(); - $sep = $conv['decimal_point']; + $newlocale = setlocale(LC_ALL, $locale); + $conv = localeconv(); + $sep = $conv['decimal_point']; - printf("%s\n--------------------------\n", $newlocale); - printf(" sep: %s\n", $sep); - printf(" %%f: %f\n", $value); - printf(" %%F: %F\n", $value); - printf("date: %s\n", strftime('%x', mktime(0, 0, 0, 12, 5, 2014))); - printf("\n"); + printf("%s\n--------------------------\n", $newlocale); + printf(" sep: %s\n", $sep); + printf(" %%f: %f\n", $value); + printf(" %%F: %F\n", $value); + printf("date: %s\n", strftime('%x', mktime(0, 0, 0, 12, 5, 2014))); + printf("\n"); } test('german', 3.41); diff --git a/ext/standard/tests/strings/bug65769.phpt b/ext/standard/tests/strings/bug65769.phpt index efe5788ce4..31656ee60f 100644 --- a/ext/standard/tests/strings/bug65769.phpt +++ b/ext/standard/tests/strings/bug65769.phpt @@ -15,21 +15,21 @@ if (PHP_WINDOWS_VERSION_MAJOR < 10) { $locales = array('sve', 'french', 'us', 'ru', 'czech', 'serbian'); foreach ($locales as $locale) { - $locale = setlocale(LC_ALL, $locale); - $lconv = localeconv(); - var_dump( - $locale, - $lconv['decimal_point'], - $lconv['thousands_sep'], - $lconv['int_curr_symbol'], - $lconv['currency_symbol'], - $lconv['mon_decimal_point'], - $lconv['mon_thousands_sep'] - ); - if ($locale === 'Swedish_Sweden.1252') { - var_dump(in_array($lconv['mon_thousands_sep'], ['.', ' '])); - } - echo '++++++++++++++++++++++', "\n"; + $locale = setlocale(LC_ALL, $locale); + $lconv = localeconv(); + var_dump( + $locale, + $lconv['decimal_point'], + $lconv['thousands_sep'], + $lconv['int_curr_symbol'], + $lconv['currency_symbol'], + $lconv['mon_decimal_point'], + $lconv['mon_thousands_sep'] + ); + if ($locale === 'Swedish_Sweden.1252') { + var_dump(in_array($lconv['mon_thousands_sep'], ['.', ' '])); + } + echo '++++++++++++++++++++++', "\n"; } ?> diff --git a/ext/standard/tests/strings/bug65947.phpt b/ext/standard/tests/strings/bug65947.phpt index ff7dbf4b8c..3ffecf3cac 100644 --- a/ext/standard/tests/strings/bug65947.phpt +++ b/ext/standard/tests/strings/bug65947.phpt @@ -8,8 +8,8 @@ $csv = base64_decode('6Q=='); $adata = str_getcsv($csv,";"); $b2 = basename($filename); if ($filename != $b2) - print "BUG"; + print "BUG"; else - print "OKEY"; + print "OKEY"; --EXPECT-- OKEY diff --git a/ext/standard/tests/strings/bug71969.phpt b/ext/standard/tests/strings/bug71969.phpt index aafceb09ad..9795186e15 100644 --- a/ext/standard/tests/strings/bug71969.phpt +++ b/ext/standard/tests/strings/bug71969.phpt @@ -3,13 +3,13 @@ Bug #71969 (str_replace returns an incorrect resulting array after a foreach by --FILE-- <?php $a = array( - array("one" => array("a"=>"0000", "b"=>"1111")), + array("one" => array("a"=>"0000", "b"=>"1111")), ); //foreach by reference, changing the array value foreach($a as &$record) { - $record["one"]["a"] = "2222"; + $record["one"]["a"] = "2222"; } var_dump(str_replace("2", "3", $a)); ?> diff --git a/ext/standard/tests/strings/bug72663_3.phpt b/ext/standard/tests/strings/bug72663_3.phpt index 3b949b0239..d8be463887 100644 --- a/ext/standard/tests/strings/bug72663_3.phpt +++ b/ext/standard/tests/strings/bug72663_3.phpt @@ -3,10 +3,10 @@ Bug #72663: Create an Unexpected Object and Don't Invoke __wakeup() in Deseriali --FILE-- <?php class obj { - var $ryat; - function __wakeup() { - $this->ryat = str_repeat('A', 0x112); - } + var $ryat; + function __wakeup() { + $this->ryat = str_repeat('A', 0x112); + } } $poc = 'O:8:"stdClass":1:{i:0;O:3:"obj":1:{s:4:"ryat";R:1;'; diff --git a/ext/standard/tests/strings/bug78612.phpt b/ext/standard/tests/strings/bug78612.phpt index 7dad605e80..13fb324052 100644 --- a/ext/standard/tests/strings/bug78612.phpt +++ b/ext/standard/tests/strings/bug78612.phpt @@ -8,7 +8,7 @@ $_a = 7111222333000001; $_b = 5000001; for ($j=0; $j<10; $j++) { - $find_replace[$_a + $j] = $_b + $j; + $find_replace[$_a + $j] = $_b + $j; } echo strtr('Hello', $find_replace), "\n"; diff --git a/ext/standard/tests/strings/chop_variation3.phpt b/ext/standard/tests/strings/chop_variation3.phpt Binary files differindex 36f81d34c8..1a4568dc28 100644 --- a/ext/standard/tests/strings/chop_variation3.phpt +++ b/ext/standard/tests/strings/chop_variation3.phpt diff --git a/ext/standard/tests/strings/chop_variation4.phpt b/ext/standard/tests/strings/chop_variation4.phpt Binary files differindex 628c87cbce..192e07aa3a 100644 --- a/ext/standard/tests/strings/chop_variation4.phpt +++ b/ext/standard/tests/strings/chop_variation4.phpt diff --git a/ext/standard/tests/strings/chr_variation1.phpt b/ext/standard/tests/strings/chr_variation1.phpt index 7aae1bf905..fbf8e21f49 100644 --- a/ext/standard/tests/strings/chr_variation1.phpt +++ b/ext/standard/tests/strings/chr_variation1.phpt @@ -27,31 +27,31 @@ $file_handle = fopen(__FILE__, "r"); // array with different values for $input $inputs = array ( - // integer values + // integer values /*1*/ 0, - 1, - 255, - 256, + 1, + 255, + 256, - // float values + // float values /*5*/ 10.5, - -20.5, - 1.1234e6, + -20.5, + 1.1234e6, - // boolean values + // boolean values /*11*/ true, - false, - TRUE, - FALSE, + false, + TRUE, + FALSE, - // null values + // null values /*15*/ NULL, - null, + null, - // undefined variable + // undefined variable /*19*/ @$undefined_var, - // unset variable + // unset variable /*20*/ @$unset_var ); diff --git a/ext/standard/tests/strings/convert_uudecode_basic.phpt b/ext/standard/tests/strings/convert_uudecode_basic.phpt index 7422ac06c0..0c378bdb22 100644 --- a/ext/standard/tests/strings/convert_uudecode_basic.phpt +++ b/ext/standard/tests/strings/convert_uudecode_basic.phpt @@ -37,8 +37,8 @@ foreach($strings as $string) { $decode = convert_uudecode($encode); if ($decode != $string) { - var_dump($encode, $decode, $string); - exit("TEST FAILED on iteration $count\n"); + var_dump($encode, $decode, $string); + exit("TEST FAILED on iteration $count\n"); } $count ++; diff --git a/ext/standard/tests/strings/count_chars.phpt b/ext/standard/tests/strings/count_chars.phpt index fe21b656f0..6199461174 100644 --- a/ext/standard/tests/strings/count_chars.phpt +++ b/ext/standard/tests/strings/count_chars.phpt @@ -4,7 +4,7 @@ count_chars() function <?php $s = "het leven is net erwtensoep - je kunt er geen touw aan vastknopen"; for($i=0; $i<3; $i++) { - echo implode(count_chars($s, $i))."\n"; + echo implode(count_chars($s, $i))."\n"; } echo $a = count_chars($s, 3), "\n"; echo (int) strlen(count_chars($s, 4)) == 256-strlen($a),"\n"; diff --git a/ext/standard/tests/strings/crc32.phpt b/ext/standard/tests/strings/crc32.phpt index e1b338f011..2fa8be59d8 100644 --- a/ext/standard/tests/strings/crc32.phpt +++ b/ext/standard/tests/strings/crc32.phpt @@ -4,7 +4,7 @@ crc32() function <?php $input = array("foo", "bar", "baz", "grldsajkopallkjasd"); foreach($input AS $i) { - printf("%u\n", crc32($i)); + printf("%u\n", crc32($i)); } ?> --EXPECT-- diff --git a/ext/standard/tests/strings/crc32_variation4.phpt b/ext/standard/tests/strings/crc32_variation4.phpt index f3f11972fb..6953994a74 100644 --- a/ext/standard/tests/strings/crc32_variation4.phpt +++ b/ext/standard/tests/strings/crc32_variation4.phpt @@ -74,7 +74,7 @@ $heredoc_strings = array( $heredoc_with_alphanumerics, $heredoc_with_embedded_nulls, $heredoc_with_hexa_octal, - $heredoc_with_long_string + $heredoc_with_long_string ); // loop to test the function with each heredoc string in the array diff --git a/ext/standard/tests/strings/crypt_blowfish.phpt b/ext/standard/tests/strings/crypt_blowfish.phpt index 3af9cb77eb..a8eda72120 100644 --- a/ext/standard/tests/strings/crypt_blowfish.phpt +++ b/ext/standard/tests/strings/crypt_blowfish.phpt @@ -4,44 +4,44 @@ Official blowfish tests (http://cvsweb.openwall.com/cgi/cvsweb.cgi/Owl/packages/ <?php $tests =array( - array('$2a$05$CCCCCCCCCCCCCCCCCCCCC.E5YPO9kmyuRGyh0XouQYb4YMJKvyOeW', 'U*U'), - array('$2a$05$CCCCCCCCCCCCCCCCCCCCC.VGOzA784oUp/Z0DY336zx7pLYAy0lwK', 'U*U*'), - array('$2a$05$XXXXXXXXXXXXXXXXXXXXXOAcXxm9kjPGEMsLznoKqmqw7tc8WCx4a', 'U*U*U'), - array('$2a$05$abcdefghijklmnopqrstuu5s2v8.iXieOjg/.AySBTTZIIVFJeBui', '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789chars after 72 are ignored'), - array('$2x$05$/OK.fbVrR/bpIqNJ5ianF.CE5elHaaO4EbggVDjb8P19RukzXSM3e', "\xa3"), - array('$2x$05$/OK.fbVrR/bpIqNJ5ianF.CE5elHaaO4EbggVDjb8P19RukzXSM3e', "\xff\xff\xa3"), - array('$2y$05$/OK.fbVrR/bpIqNJ5ianF.CE5elHaaO4EbggVDjb8P19RukzXSM3e', "\xff\xff\xa3"), - array('$2a$05$/OK.fbVrR/bpIqNJ5ianF.nqd1wy.pTMdcvrRWxyiGL2eMz.2a85.', "\xff\xff\xa3"), - array('$2b$05$/OK.fbVrR/bpIqNJ5ianF.CE5elHaaO4EbggVDjb8P19RukzXSM3e', "\xff\xff\xa3"), - array('$2y$05$/OK.fbVrR/bpIqNJ5ianF.Sa7shbm4.OzKpvFnX1pQLmQW96oUlCq', "\xa3"), - array('$2a$05$/OK.fbVrR/bpIqNJ5ianF.Sa7shbm4.OzKpvFnX1pQLmQW96oUlCq', "\xa3"), - array('$2b$05$/OK.fbVrR/bpIqNJ5ianF.Sa7shbm4.OzKpvFnX1pQLmQW96oUlCq', "\xa3"), - array('$2x$05$/OK.fbVrR/bpIqNJ5ianF.o./n25XVfn6oAPaUvHe.Csk4zRfsYPi', "1\xa3345"), - array('$2x$05$/OK.fbVrR/bpIqNJ5ianF.o./n25XVfn6oAPaUvHe.Csk4zRfsYPi', "\xff\xa3345"), - array('$2x$05$/OK.fbVrR/bpIqNJ5ianF.o./n25XVfn6oAPaUvHe.Csk4zRfsYPi', "\xff\xa334\xff\xff\xff\xa3345"), - array('$2y$05$/OK.fbVrR/bpIqNJ5ianF.o./n25XVfn6oAPaUvHe.Csk4zRfsYPi', "\xff\xa334\xff\xff\xff\xa3345"), - array('$2a$05$/OK.fbVrR/bpIqNJ5ianF.ZC1JEJ8Z4gPfpe1JOr/oyPXTWl9EFd.', "\xff\xa334\xff\xff\xff\xa3345"), - array('$2y$05$/OK.fbVrR/bpIqNJ5ianF.nRht2l/HRhr6zmCp9vYUvvsqynflf9e', "\xff\xa3345"), - array('$2a$05$/OK.fbVrR/bpIqNJ5ianF.nRht2l/HRhr6zmCp9vYUvvsqynflf9e', "\xff\xa3345"), - array('$2a$05$/OK.fbVrR/bpIqNJ5ianF.6IflQkJytoRVc1yuaNtHfiuq.FRlSIS', "\xa3ab"), - array('$2x$05$/OK.fbVrR/bpIqNJ5ianF.6IflQkJytoRVc1yuaNtHfiuq.FRlSIS', "\xa3ab"), - array('$2y$05$/OK.fbVrR/bpIqNJ5ianF.6IflQkJytoRVc1yuaNtHfiuq.FRlSIS', "\xa3ab"), - array('$2x$05$6bNw2HLQYeqHYyBfLMsv/OiwqTymGIGzFsA4hOTWebfehXHNprcAS', "\xd1\x91"), - array('$2x$05$6bNw2HLQYeqHYyBfLMsv/O9LIGgn8OMzuDoHfof8AQimSGfcSWxnS', "\xd0\xc1\xd2\xcf\xcc\xd8"), - array('$2a$05$/OK.fbVrR/bpIqNJ5ianF.swQOIzjOiJ9GHEPuhEkvqrUyvWhEMx6', "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaachars after 72 are ignored as usual"), - array('$2a$05$/OK.fbVrR/bpIqNJ5ianF.R9xrDjiycxMbQE2bp.vgqlYpW5wx2yy', "\xaa\x55\xaa\x55\xaa\x55\xaa\x55\xaa\x55\xaa\x55\xaa\x55\xaa\x55\xaa\x55\xaa\x55\xaa\x55\xaa\x55\xaa\x55\xaa\x55\xaa\x55\xaa\x55\xaa\x55\xaa\x55\xaa\x55\xaa\x55\xaa\x55\xaa\x55\xaa\x55\xaa\x55\xaa\x55\xaa\x55\xaa\x55\xaa\x55\xaa\x55\xaa\x55\xaa\x55\xaa\x55\xaa\x55\xaa\x55\xaa\x55\xaa\x55"), - array('$2a$05$/OK.fbVrR/bpIqNJ5ianF.9tQZzcJfm3uj2NvJ/n5xkhpqLrMpWCe', "\x55\xaa\xff\x55\xaa\xff\x55\xaa\xff\x55\xaa\xff\x55\xaa\xff\x55\xaa\xff\x55\xaa\xff\x55\xaa\xff\x55\xaa\xff\x55\xaa\xff\x55\xaa\xff\x55\xaa\xff\x55\xaa\xff\x55\xaa\xff\x55\xaa\xff\x55\xaa\xff\x55\xaa\xff\x55\xaa\xff\x55\xaa\xff\x55\xaa\xff\x55\xaa\xff\x55\xaa\xff\x55\xaa\xff\x55\xaa\xff"), - array('$2a$05$CCCCCCCCCCCCCCCCCCCCC.7uG0VCzI2bS7j6ymqJi9CdcdxiRTWNy', ''), + array('$2a$05$CCCCCCCCCCCCCCCCCCCCC.E5YPO9kmyuRGyh0XouQYb4YMJKvyOeW', 'U*U'), + array('$2a$05$CCCCCCCCCCCCCCCCCCCCC.VGOzA784oUp/Z0DY336zx7pLYAy0lwK', 'U*U*'), + array('$2a$05$XXXXXXXXXXXXXXXXXXXXXOAcXxm9kjPGEMsLznoKqmqw7tc8WCx4a', 'U*U*U'), + array('$2a$05$abcdefghijklmnopqrstuu5s2v8.iXieOjg/.AySBTTZIIVFJeBui', '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789chars after 72 are ignored'), + array('$2x$05$/OK.fbVrR/bpIqNJ5ianF.CE5elHaaO4EbggVDjb8P19RukzXSM3e', "\xa3"), + array('$2x$05$/OK.fbVrR/bpIqNJ5ianF.CE5elHaaO4EbggVDjb8P19RukzXSM3e', "\xff\xff\xa3"), + array('$2y$05$/OK.fbVrR/bpIqNJ5ianF.CE5elHaaO4EbggVDjb8P19RukzXSM3e', "\xff\xff\xa3"), + array('$2a$05$/OK.fbVrR/bpIqNJ5ianF.nqd1wy.pTMdcvrRWxyiGL2eMz.2a85.', "\xff\xff\xa3"), + array('$2b$05$/OK.fbVrR/bpIqNJ5ianF.CE5elHaaO4EbggVDjb8P19RukzXSM3e', "\xff\xff\xa3"), + array('$2y$05$/OK.fbVrR/bpIqNJ5ianF.Sa7shbm4.OzKpvFnX1pQLmQW96oUlCq', "\xa3"), + array('$2a$05$/OK.fbVrR/bpIqNJ5ianF.Sa7shbm4.OzKpvFnX1pQLmQW96oUlCq', "\xa3"), + array('$2b$05$/OK.fbVrR/bpIqNJ5ianF.Sa7shbm4.OzKpvFnX1pQLmQW96oUlCq', "\xa3"), + array('$2x$05$/OK.fbVrR/bpIqNJ5ianF.o./n25XVfn6oAPaUvHe.Csk4zRfsYPi', "1\xa3345"), + array('$2x$05$/OK.fbVrR/bpIqNJ5ianF.o./n25XVfn6oAPaUvHe.Csk4zRfsYPi', "\xff\xa3345"), + array('$2x$05$/OK.fbVrR/bpIqNJ5ianF.o./n25XVfn6oAPaUvHe.Csk4zRfsYPi', "\xff\xa334\xff\xff\xff\xa3345"), + array('$2y$05$/OK.fbVrR/bpIqNJ5ianF.o./n25XVfn6oAPaUvHe.Csk4zRfsYPi', "\xff\xa334\xff\xff\xff\xa3345"), + array('$2a$05$/OK.fbVrR/bpIqNJ5ianF.ZC1JEJ8Z4gPfpe1JOr/oyPXTWl9EFd.', "\xff\xa334\xff\xff\xff\xa3345"), + array('$2y$05$/OK.fbVrR/bpIqNJ5ianF.nRht2l/HRhr6zmCp9vYUvvsqynflf9e', "\xff\xa3345"), + array('$2a$05$/OK.fbVrR/bpIqNJ5ianF.nRht2l/HRhr6zmCp9vYUvvsqynflf9e', "\xff\xa3345"), + array('$2a$05$/OK.fbVrR/bpIqNJ5ianF.6IflQkJytoRVc1yuaNtHfiuq.FRlSIS', "\xa3ab"), + array('$2x$05$/OK.fbVrR/bpIqNJ5ianF.6IflQkJytoRVc1yuaNtHfiuq.FRlSIS', "\xa3ab"), + array('$2y$05$/OK.fbVrR/bpIqNJ5ianF.6IflQkJytoRVc1yuaNtHfiuq.FRlSIS', "\xa3ab"), + array('$2x$05$6bNw2HLQYeqHYyBfLMsv/OiwqTymGIGzFsA4hOTWebfehXHNprcAS', "\xd1\x91"), + array('$2x$05$6bNw2HLQYeqHYyBfLMsv/O9LIGgn8OMzuDoHfof8AQimSGfcSWxnS', "\xd0\xc1\xd2\xcf\xcc\xd8"), + array('$2a$05$/OK.fbVrR/bpIqNJ5ianF.swQOIzjOiJ9GHEPuhEkvqrUyvWhEMx6', "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaachars after 72 are ignored as usual"), + array('$2a$05$/OK.fbVrR/bpIqNJ5ianF.R9xrDjiycxMbQE2bp.vgqlYpW5wx2yy', "\xaa\x55\xaa\x55\xaa\x55\xaa\x55\xaa\x55\xaa\x55\xaa\x55\xaa\x55\xaa\x55\xaa\x55\xaa\x55\xaa\x55\xaa\x55\xaa\x55\xaa\x55\xaa\x55\xaa\x55\xaa\x55\xaa\x55\xaa\x55\xaa\x55\xaa\x55\xaa\x55\xaa\x55\xaa\x55\xaa\x55\xaa\x55\xaa\x55\xaa\x55\xaa\x55\xaa\x55\xaa\x55\xaa\x55\xaa\x55\xaa\x55\xaa\x55"), + array('$2a$05$/OK.fbVrR/bpIqNJ5ianF.9tQZzcJfm3uj2NvJ/n5xkhpqLrMpWCe', "\x55\xaa\xff\x55\xaa\xff\x55\xaa\xff\x55\xaa\xff\x55\xaa\xff\x55\xaa\xff\x55\xaa\xff\x55\xaa\xff\x55\xaa\xff\x55\xaa\xff\x55\xaa\xff\x55\xaa\xff\x55\xaa\xff\x55\xaa\xff\x55\xaa\xff\x55\xaa\xff\x55\xaa\xff\x55\xaa\xff\x55\xaa\xff\x55\xaa\xff\x55\xaa\xff\x55\xaa\xff\x55\xaa\xff\x55\xaa\xff"), + array('$2a$05$CCCCCCCCCCCCCCCCCCCCC.7uG0VCzI2bS7j6ymqJi9CdcdxiRTWNy', ''), ); $tests2 = array( - array('$2a$03$CCCCCCCCCCCCCCCCCCCCC.', '*0'), - array('$2a$32$CCCCCCCCCCCCCCCCCCCCC.', '*0'), - array('$2c$05$CCCCCCCCCCCCCCCCCCCCC.', '*0'), - array('$2z$05$CCCCCCCCCCCCCCCCCCCCC.', '*0'), - array('$2`$05$CCCCCCCCCCCCCCCCCCCCC.', '*0'), - array('$2{$05$CCCCCCCCCCCCCCCCCCCCC.', '*0'), - array('*0', '*1'), + array('$2a$03$CCCCCCCCCCCCCCCCCCCCC.', '*0'), + array('$2a$32$CCCCCCCCCCCCCCCCCCCCC.', '*0'), + array('$2c$05$CCCCCCCCCCCCCCCCCCCCC.', '*0'), + array('$2z$05$CCCCCCCCCCCCCCCCCCCCC.', '*0'), + array('$2`$05$CCCCCCCCCCCCCCCCCCCCC.', '*0'), + array('$2{$05$CCCCCCCCCCCCCCCCCCCCC.', '*0'), + array('*0', '*1'), ); $i=0; diff --git a/ext/standard/tests/strings/crypt_sha256.phpt b/ext/standard/tests/strings/crypt_sha256.phpt index c361dc48cb..c011984ed9 100644 --- a/ext/standard/tests/strings/crypt_sha256.phpt +++ b/ext/standard/tests/strings/crypt_sha256.phpt @@ -4,51 +4,51 @@ crypt() SHA-256 <?php $tests = array( - 1 => array( - '$5$saltstring', - 'Hello world!', - '$5$saltstring$5B8vYYiY.CVt1RlTTf8KbXBH3hsxY/GNooZaBBGWEc5' - ), - 2 => array( - '$5$rounds=10000$saltstringsaltstring', - 'Hello world!', - '$5$rounds=10000$saltstringsaltst$3xv.VbSHBb41AL9AvLeujZkZRBAwqFMz2.opqey6IcA' - ), - 3 => array( - '$5$rounds=10000$saltstringsaltstring', - 'Hello world!', - '$5$rounds=10000$saltstringsaltst$3xv.VbSHBb41AL9AvLeujZkZRBAwqFMz2.opqey6IcA' - ), - 4 => array( - '$5$rounds=5000$toolongsaltstring', - 'This is just a test', - '$5$rounds=5000$toolongsaltstrin$Un/5jzAHMgOGZ5.mWJpuVolil07guHPvOW8mGRcvxa5' - ), - 5 => array( - '$5$rounds=1400$anotherlongsaltstring', - 'a very much longer text to encrypt. This one even stretches over morethan one line.', - '$5$rounds=1400$anotherlongsalts$Rx.j8H.h8HjEDGomFU8bDkXm3XIUnzyxf12oP84Bnq1' - ), - 6 => array( - '$5$rounds=77777$short', - 'we have a short salt string but not a short password', - '$5$rounds=77777$short$JiO1O3ZpDAxGJeaDIuqCoEFysAe1mZNJRs3pw0KQRd/' - ), - 7 => array( - '$5$rounds=123456$asaltof16chars..', - 'a short string', - '$5$rounds=123456$asaltof16chars..$gP3VQ/6X7UUEW3HkBn2w1/Ptq2jxPyzV/cZKmF/wJvD' - ), - 8 => array( - '$5$rounds=10$roundstoolow', - 'the minimum number is still observed', - '$5$rounds=1000$roundstoolow$yfvwcWrQ8l/K0DAWyuPMDNHpIVlTQebY9l/gL972bIC' - ) + 1 => array( + '$5$saltstring', + 'Hello world!', + '$5$saltstring$5B8vYYiY.CVt1RlTTf8KbXBH3hsxY/GNooZaBBGWEc5' + ), + 2 => array( + '$5$rounds=10000$saltstringsaltstring', + 'Hello world!', + '$5$rounds=10000$saltstringsaltst$3xv.VbSHBb41AL9AvLeujZkZRBAwqFMz2.opqey6IcA' + ), + 3 => array( + '$5$rounds=10000$saltstringsaltstring', + 'Hello world!', + '$5$rounds=10000$saltstringsaltst$3xv.VbSHBb41AL9AvLeujZkZRBAwqFMz2.opqey6IcA' + ), + 4 => array( + '$5$rounds=5000$toolongsaltstring', + 'This is just a test', + '$5$rounds=5000$toolongsaltstrin$Un/5jzAHMgOGZ5.mWJpuVolil07guHPvOW8mGRcvxa5' + ), + 5 => array( + '$5$rounds=1400$anotherlongsaltstring', + 'a very much longer text to encrypt. This one even stretches over morethan one line.', + '$5$rounds=1400$anotherlongsalts$Rx.j8H.h8HjEDGomFU8bDkXm3XIUnzyxf12oP84Bnq1' + ), + 6 => array( + '$5$rounds=77777$short', + 'we have a short salt string but not a short password', + '$5$rounds=77777$short$JiO1O3ZpDAxGJeaDIuqCoEFysAe1mZNJRs3pw0KQRd/' + ), + 7 => array( + '$5$rounds=123456$asaltof16chars..', + 'a short string', + '$5$rounds=123456$asaltof16chars..$gP3VQ/6X7UUEW3HkBn2w1/Ptq2jxPyzV/cZKmF/wJvD' + ), + 8 => array( + '$5$rounds=10$roundstoolow', + 'the minimum number is still observed', + '$5$rounds=1000$roundstoolow$yfvwcWrQ8l/K0DAWyuPMDNHpIVlTQebY9l/gL972bIC' + ) ); foreach ($tests as $iter => $t) { - $res = crypt($t[1], $t[0]); - if ($res != $t[2]) echo "Iteration $iter failed. + $res = crypt($t[1], $t[0]); + if ($res != $t[2]) echo "Iteration $iter failed. Expected: <$t[2]> Got <$res>\n"; } diff --git a/ext/standard/tests/strings/crypt_sha512.phpt b/ext/standard/tests/strings/crypt_sha512.phpt index 408a5a00c7..589a2622de 100644 --- a/ext/standard/tests/strings/crypt_sha512.phpt +++ b/ext/standard/tests/strings/crypt_sha512.phpt @@ -4,51 +4,51 @@ crypt() SHA-512 <?php $tests = array( - 1 => array( - '$6$saltstring', - 'Hello world!', - '$6$saltstring$svn8UoSVapNtMuq1ukKS4tPQd8iKwSMHWjl/O817G3uBnIFNjnQJuesI68u4OTLiBFdcbYEdFCoEOfaS35inz1' - ), - 2 => array( - '$6$rounds=10000$saltstringsaltstring', - 'Hello world!', - '$6$rounds=10000$saltstringsaltst$OW1/O6BYHV6BcXZu8QVeXbDWra3Oeqh0sbHbbMCVNSnCM/UrjmM0Dp8vOuZeHBy/YTBmSK6H9qs/y3RnOaw5v.' - ), - 3 => array( - '$6$rounds=5000$toolongsaltstring', - 'This is just a test', - '$6$rounds=5000$toolongsaltstrin$lQ8jolhgVRVhY4b5pZKaysCLi0QBxGoNeKQzQ3glMhwllF7oGDZxUhx1yxdYcz/e1JSbq3y6JMxxl8audkUEm0' - ), - 4 => array( - '$6$rounds=1400$anotherlongsaltstring', - 'a very much longer text to encrypt. This one even stretches over morethan one line.', - '$6$rounds=1400$anotherlongsalts$POfYwTEok97VWcjxIiSOjiykti.o/pQs.wPvMxQ6Fm7I6IoYN3CmLs66x9t0oSwbtEW7o7UmJEiDwGqd8p4ur1' - ), - 5 => array( - '$6$rounds=77777$short', - 'we have a short salt string but not a short password', - '$6$rounds=77777$short$WuQyW2YR.hBNpjjRhpYD/ifIw05xdfeEyQoMxIXbkvr0gge1a1x3yRULJ5CCaUeOxFmtlcGZelFl5CxtgfiAc0' - ), - 6 => array( - '$6$rounds=123456$asaltof16chars..', - 'a short string', - '$6$rounds=123456$asaltof16chars..$BtCwjqMJGx5hrJhZywWvt0RLE8uZ4oPwcelCjmw2kSYu.Ec6ycULevoBK25fs2xXgMNrCzIMVcgEJAstJeonj1' - ), - 7 => array( - '$6$rounds=10$roundstoolow', - 'the minimum number is still observed', - '$6$rounds=1000$roundstoolow$kUMsbe306n21p9R.FRkW3IGn.S9NPN0x50YhH1xhLsPuWGsUSklZt58jaTfF4ZEQpyUNGc0dqbpBYYBaHHrsX.' - ), - 8 => array( - '$6$$bar$', - 'foo', - '$6$$QMXjqd7rHQZPQ1yHsXkQqC1FBzDiVfTHXL.LaeDAeVV.IzMaV9VU4MQ8kPuZa2SOP1A0RPm772EaFYjpEJtdu.' - ), + 1 => array( + '$6$saltstring', + 'Hello world!', + '$6$saltstring$svn8UoSVapNtMuq1ukKS4tPQd8iKwSMHWjl/O817G3uBnIFNjnQJuesI68u4OTLiBFdcbYEdFCoEOfaS35inz1' + ), + 2 => array( + '$6$rounds=10000$saltstringsaltstring', + 'Hello world!', + '$6$rounds=10000$saltstringsaltst$OW1/O6BYHV6BcXZu8QVeXbDWra3Oeqh0sbHbbMCVNSnCM/UrjmM0Dp8vOuZeHBy/YTBmSK6H9qs/y3RnOaw5v.' + ), + 3 => array( + '$6$rounds=5000$toolongsaltstring', + 'This is just a test', + '$6$rounds=5000$toolongsaltstrin$lQ8jolhgVRVhY4b5pZKaysCLi0QBxGoNeKQzQ3glMhwllF7oGDZxUhx1yxdYcz/e1JSbq3y6JMxxl8audkUEm0' + ), + 4 => array( + '$6$rounds=1400$anotherlongsaltstring', + 'a very much longer text to encrypt. This one even stretches over morethan one line.', + '$6$rounds=1400$anotherlongsalts$POfYwTEok97VWcjxIiSOjiykti.o/pQs.wPvMxQ6Fm7I6IoYN3CmLs66x9t0oSwbtEW7o7UmJEiDwGqd8p4ur1' + ), + 5 => array( + '$6$rounds=77777$short', + 'we have a short salt string but not a short password', + '$6$rounds=77777$short$WuQyW2YR.hBNpjjRhpYD/ifIw05xdfeEyQoMxIXbkvr0gge1a1x3yRULJ5CCaUeOxFmtlcGZelFl5CxtgfiAc0' + ), + 6 => array( + '$6$rounds=123456$asaltof16chars..', + 'a short string', + '$6$rounds=123456$asaltof16chars..$BtCwjqMJGx5hrJhZywWvt0RLE8uZ4oPwcelCjmw2kSYu.Ec6ycULevoBK25fs2xXgMNrCzIMVcgEJAstJeonj1' + ), + 7 => array( + '$6$rounds=10$roundstoolow', + 'the minimum number is still observed', + '$6$rounds=1000$roundstoolow$kUMsbe306n21p9R.FRkW3IGn.S9NPN0x50YhH1xhLsPuWGsUSklZt58jaTfF4ZEQpyUNGc0dqbpBYYBaHHrsX.' + ), + 8 => array( + '$6$$bar$', + 'foo', + '$6$$QMXjqd7rHQZPQ1yHsXkQqC1FBzDiVfTHXL.LaeDAeVV.IzMaV9VU4MQ8kPuZa2SOP1A0RPm772EaFYjpEJtdu.' + ), ); foreach ($tests as $iter => $t) { - $res = crypt($t[1], $t[0]); - if ($res != $t[2]) echo "Iteration $iter failed. + $res = crypt($t[1], $t[0]); + if ($res != $t[2]) echo "Iteration $iter failed. Expected: <$t[2]> Got <$res>\n"; } diff --git a/ext/standard/tests/strings/default_charset.phpt b/ext/standard/tests/strings/default_charset.phpt index 3665132413..3a8e2696d1 100644 --- a/ext/standard/tests/strings/default_charset.phpt +++ b/ext/standard/tests/strings/default_charset.phpt @@ -9,10 +9,10 @@ output_encoding= <?php echo "*** Default php.ini value ***\n"; var_dump(ini_get('default_charset'), - ini_get('internal_encoding'), - ini_get('input_encoding'), - ini_get('output_encoding') - ); + ini_get('internal_encoding'), + ini_get('input_encoding'), + ini_get('output_encoding') + ); echo "*** Runtime change of default_charset ***\n"; @@ -20,10 +20,10 @@ var_dump(ini_set('default_charset', 'cp1252')); echo "*** Test with updated default_charset ***\n"; var_dump(ini_get('default_charset'), - ini_get('internal_encoding'), - ini_get('input_encoding'), - ini_get('output_encoding') - ); + ini_get('internal_encoding'), + ini_get('input_encoding'), + ini_get('output_encoding') + ); var_dump(htmlentities("\xA3", ENT_HTML5)); var_dump(htmlentities("\xA3", ENT_HTML5, 'cp1252')); @@ -35,10 +35,10 @@ var_dump(bin2hex(html_entity_decode("£", ENT_HTML5, 'cp1252'))); echo "*** Change internal_encoding to empty ***\n"; var_dump(ini_set('internal_encoding', '')); var_dump(ini_get('default_charset'), - ini_get('internal_encoding'), - ini_get('input_encoding'), - ini_get('output_encoding') - ); + ini_get('internal_encoding'), + ini_get('input_encoding'), + ini_get('output_encoding') + ); var_dump(htmlentities("\xA3", ENT_HTML5)); var_dump(htmlentities("\xA3", ENT_HTML5, 'cp1252')); @@ -49,10 +49,10 @@ echo "*** Update input/output_encoding ***\n"; var_dump(ini_set('input_encoding', 'ISO-8859-1')); var_dump(ini_set('output_encoding', 'ISO-8859-1')); var_dump(ini_get('default_charset'), - ini_get('internal_encoding'), - ini_get('input_encoding'), - ini_get('output_encoding') - ); + ini_get('internal_encoding'), + ini_get('input_encoding'), + ini_get('output_encoding') + ); // Should not be affected var_dump(htmlentities("\xA3", ENT_HTML5)); diff --git a/ext/standard/tests/strings/dirname_multi.phpt b/ext/standard/tests/strings/dirname_multi.phpt index eb29de39a2..62943fe69a 100644 --- a/ext/standard/tests/strings/dirname_multi.phpt +++ b/ext/standard/tests/strings/dirname_multi.phpt @@ -12,7 +12,7 @@ if((substr(PHP_OS, 0, 3) == "WIN")) */ for ($i=0 ; $i<5 ; $i++) { try { - var_dump(dirname("/foo/bar/baz", $i)); + var_dump(dirname("/foo/bar/baz", $i)); } catch (\ValueError $e) { echo $e->getMessage() . "\n"; } diff --git a/ext/standard/tests/strings/explode1.phpt b/ext/standard/tests/strings/explode1.phpt index 7c1fe0fd5e..cfc203b428 100644 --- a/ext/standard/tests/strings/explode1.phpt +++ b/ext/standard/tests/strings/explode1.phpt @@ -40,17 +40,17 @@ foreach($delimiters as $delimiter) { echo $e->getMessage() . "\n"; } try { - var_dump( explode($delimiter, $string, 0) ); + var_dump( explode($delimiter, $string, 0) ); } catch (\ValueError $e) { echo $e->getMessage() . "\n"; } try { - var_dump( explode($delimiter, $string, 1) ); + var_dump( explode($delimiter, $string, 1) ); } catch (\ValueError $e) { echo $e->getMessage() . "\n"; } try { - var_dump( explode($delimiter, $string, 2) ); + var_dump( explode($delimiter, $string, 2) ); } catch (\ValueError $e) { echo $e->getMessage() . "\n"; } diff --git a/ext/standard/tests/strings/explode_variation6.phpt b/ext/standard/tests/strings/explode_variation6.phpt index 2a823a4a3e..0dcce23077 100644 --- a/ext/standard/tests/strings/explode_variation6.phpt +++ b/ext/standard/tests/strings/explode_variation6.phpt @@ -32,11 +32,11 @@ $e = test_explode("\x00", $str, 100); function test_explode($delim, $string, $limit) { - $e = explode($delim, $string, $limit); - foreach ( $e as $v) - { - var_dump(bin2hex($v)); - } + $e = explode($delim, $string, $limit); + foreach ( $e as $v) + { + var_dump(bin2hex($v)); + } } ?> --EXPECT-- diff --git a/ext/standard/tests/strings/get_meta_tags.phpt b/ext/standard/tests/strings/get_meta_tags.phpt index 406ceb2590..8752117aea 100644 --- a/ext/standard/tests/strings/get_meta_tags.phpt +++ b/ext/standard/tests/strings/get_meta_tags.phpt @@ -47,8 +47,8 @@ DATA; $array = array($data, $data1, $data2, $data3, $data4, "", "<>", "<meta<<<<<"); foreach ($array as $html) { - file_put_contents($filename, $html); - var_dump(get_meta_tags($filename)); + file_put_contents($filename, $html); + var_dump(get_meta_tags($filename)); } @unlink($filename); diff --git a/ext/standard/tests/strings/html_entity_decode_html4.phpt b/ext/standard/tests/strings/html_entity_decode_html4.phpt index 34753396de..dad8a3eb1f 100644 --- a/ext/standard/tests/strings/html_entity_decode_html4.phpt +++ b/ext/standard/tests/strings/html_entity_decode_html4.phpt @@ -3,258 +3,258 @@ html_entity_decode() conformance check (HTML 4) --FILE-- <?php $map = array( - """, - "&", - "<", - ">", - " ", - "¡", - "¢", - "£", - "¤", - "¥", - "¦", - "§", - "¨", - "©", - "ª", - "«", - "¬", - "­", - "®", - "¯", - "°", - "±", - "²", - "³", - "´", - "µ", - "¶", - "·", - "¸", - "¹", - "º", - "»", - "¼", - "½", - "¾", - "¿", - "À", - "Á", - "Â", - "Ã", - "Ä", - "Å", - "Æ", - "Ç", - "È", - "É", - "Ê", - "Ë", - "Ì", - "Í", - "Î", - "Ï", - "Ð", - "Ñ", - "Ò", - "Ó", - "Ô", - "Õ", - "Ö", - "×", - "Ø", - "Ù", - "Ú", - "Û", - "Ü", - "Ý", - "Þ", - "ß", - "à", - "á", - "â", - "ã", - "ä", - "å", - "æ", - "ç", - "è", - "é", - "ê", - "ë", - "ì", - "í", - "î", - "ï", - "ð", - "ñ", - "ò", - "ó", - "ô", - "õ", - "ö", - "÷", - "ø", - "ù", - "ú", - "û", - "ü", - "ý", - "þ", - "ÿ", - "Œ", - "œ", - "Š", - "š", - "Ÿ", - "ƒ", - "ˆ", - "˜", - "Α", - "Β", - "Γ", - "Δ", - "Ε", - "Ζ", - "Η", - "Θ", - "Ι", - "Κ", - "Λ", - "Μ", - "Ν", - "Ξ", - "Ο", - "Π", - "Ρ", - "Σ", - "Τ", - "Υ", - "Φ", - "Χ", - "Ψ", - "Ω", - "α", - "β", - "γ", - "δ", - "ε", - "ζ", - "η", - "θ", - "ι", - "κ", - "λ", - "μ", - "ν", - "ξ", - "ο", - "π", - "ρ", - "ς", - "σ", - "τ", - "υ", - "φ", - "χ", - "ψ", - "ω", - "ϑ", - "ϒ", - "ϖ", - " ", - " ", - " ", - "‌", - "‍", - "‎", - "‏", - "–", - "—", - "‘", - "’", - "‚", - "“", - "”", - "„", - "†", - "‡", - "•", - "…", - "‰", - "′", - "″", - "‹", - "›", - "‾", - "⁄", - "€", - "ℑ", - "℘", - "ℜ", - "™", - "ℵ", - "←", - "↑", - "→", - "↓", - "↔", - "↵", - "⇐", - "⇑", - "⇒", - "⇓", - "⇔", - "∀", - "∂", - "∃", - "∅", - "∇", - "∈", - "∉", - "∋", - "∏", - "∑", - "−", - "∗", - "√", - "∝", - "∞", - "∠", - "∧", - "∨", - "∩", - "∪", - "∫", - "∴", - "∼", - "≅", - "≈", - "≠", - "≡", - "≤", - "≥", - "⊂", - "⊃", - "⊄", - "⊆", - "⊇", - "⊕", - "⊗", - "⊥", - "⋅", - "⌈", - "⌉", - "⌊", - "⌋", - "⟨", - "⟩", - "◊", - "♠", - "♣", - "♥", - "♦" + """, + "&", + "<", + ">", + " ", + "¡", + "¢", + "£", + "¤", + "¥", + "¦", + "§", + "¨", + "©", + "ª", + "«", + "¬", + "­", + "®", + "¯", + "°", + "±", + "²", + "³", + "´", + "µ", + "¶", + "·", + "¸", + "¹", + "º", + "»", + "¼", + "½", + "¾", + "¿", + "À", + "Á", + "Â", + "Ã", + "Ä", + "Å", + "Æ", + "Ç", + "È", + "É", + "Ê", + "Ë", + "Ì", + "Í", + "Î", + "Ï", + "Ð", + "Ñ", + "Ò", + "Ó", + "Ô", + "Õ", + "Ö", + "×", + "Ø", + "Ù", + "Ú", + "Û", + "Ü", + "Ý", + "Þ", + "ß", + "à", + "á", + "â", + "ã", + "ä", + "å", + "æ", + "ç", + "è", + "é", + "ê", + "ë", + "ì", + "í", + "î", + "ï", + "ð", + "ñ", + "ò", + "ó", + "ô", + "õ", + "ö", + "÷", + "ø", + "ù", + "ú", + "û", + "ü", + "ý", + "þ", + "ÿ", + "Œ", + "œ", + "Š", + "š", + "Ÿ", + "ƒ", + "ˆ", + "˜", + "Α", + "Β", + "Γ", + "Δ", + "Ε", + "Ζ", + "Η", + "Θ", + "Ι", + "Κ", + "Λ", + "Μ", + "Ν", + "Ξ", + "Ο", + "Π", + "Ρ", + "Σ", + "Τ", + "Υ", + "Φ", + "Χ", + "Ψ", + "Ω", + "α", + "β", + "γ", + "δ", + "ε", + "ζ", + "η", + "θ", + "ι", + "κ", + "λ", + "μ", + "ν", + "ξ", + "ο", + "π", + "ρ", + "ς", + "σ", + "τ", + "υ", + "φ", + "χ", + "ψ", + "ω", + "ϑ", + "ϒ", + "ϖ", + " ", + " ", + " ", + "‌", + "‍", + "‎", + "‏", + "–", + "—", + "‘", + "’", + "‚", + "“", + "”", + "„", + "†", + "‡", + "•", + "…", + "‰", + "′", + "″", + "‹", + "›", + "‾", + "⁄", + "€", + "ℑ", + "℘", + "ℜ", + "™", + "ℵ", + "←", + "↑", + "→", + "↓", + "↔", + "↵", + "⇐", + "⇑", + "⇒", + "⇓", + "⇔", + "∀", + "∂", + "∃", + "∅", + "∇", + "∈", + "∉", + "∋", + "∏", + "∑", + "−", + "∗", + "√", + "∝", + "∞", + "∠", + "∧", + "∨", + "∩", + "∪", + "∫", + "∴", + "∼", + "≅", + "≈", + "≠", + "≡", + "≤", + "≥", + "⊂", + "⊃", + "⊄", + "⊆", + "⊇", + "⊕", + "⊗", + "⊥", + "⋅", + "⌈", + "⌉", + "⌊", + "⌋", + "⟨", + "⟩", + "◊", + "♠", + "♣", + "♥", + "♦" ); foreach ($map as $str) { diff --git a/ext/standard/tests/strings/html_entity_decode_html5.phpt b/ext/standard/tests/strings/html_entity_decode_html5.phpt index 6e0d4cf167..81f692c5dc 100644 --- a/ext/standard/tests/strings/html_entity_decode_html5.phpt +++ b/ext/standard/tests/strings/html_entity_decode_html5.phpt @@ -3,2131 +3,2131 @@ html_entity_decode() conformance check (HTML 5) --FILE-- <?php $map = array( - "Æ", - "&", - "Á", - "Ă", - "Â", - "А", - "𝔄", - "À", - "Α", - "Ā", - "⩓", - "Ą", - "𝔸", - "⁡", - "Å", - "𝒜", - "≔", - "Ã", - "Ä", - "∖", - "⫧", - "⌆", - "Б", - "∵", - "ℬ", - "Β", - "𝔅", - "𝔹", - "˘", - "ℬ", - "≎", - "Ч", - "©", - "Ć", - "⋒", - "ⅅ", - "ℭ", - "Č", - "Ç", - "Ĉ", - "∰", - "Ċ", - "¸", - "·", - "ℭ", - "Χ", - "⊙", - "⊖", - "⊕", - "⊗", - "∲", - "”", - "’", - "∷", - "⩴", - "≡", - "∯", - "∮", - "ℂ", - "∐", - "∳", - "⨯", - "𝒞", - "⋓", - "≍", - "ⅅ", - "⤑", - "Ђ", - "Ѕ", - "Џ", - "‡", - "↡", - "⫤", - "Ď", - "Д", - "∇", - "Δ", - "𝔇", - "´", - "˙", - "˝", - "`", - "˜", - "⋄", - "ⅆ", - "𝔻", - "¨", - "⃜", - "≐", - "∯", - "¨", - "⇓", - "⇐", - "⇔", - "⫤", - "⟸", - "⟺", - "⟹", - "⇒", - "⊨", - "⇑", - "⇕", - "∥", - "↓", - "⤓", - "⇵", - "̑", - "⥐", - "⥞", - "↽", - "⥖", - "⥟", - "⇁", - "⥗", - "⊤", - "↧", - "⇓", - "𝒟", - "Đ", - "Ŋ", - "Ð", - "É", - "Ě", - "Ê", - "Э", - "Ė", - "𝔈", - "È", - "∈", - "Ē", - "◻", - "▫", - "Ę", - "𝔼", - "Ε", - "⩵", - "≂", - "⇌", - "ℰ", - "⩳", - "Η", - "Ë", - "∃", - "ⅇ", - "Ф", - "𝔉", - "◼", - "▪", - "𝔽", - "∀", - "ℱ", - "ℱ", - "Ѓ", - ">", - "Γ", - "Ϝ", - "Ğ", - "Ģ", - "Ĝ", - "Г", - "Ġ", - "𝔊", - "⋙", - "𝔾", - "≥", - "⋛", - "≧", - "⪢", - "≷", - "⩾", - "≳", - "𝒢", - "≫", - "Ъ", - "ˇ", - "^", - "Ĥ", - "ℌ", - "ℋ", - "ℍ", - "─", - "ℋ", - "Ħ", - "≎", - "≏", - "Е", - "IJ", - "Ё", - "Í", - "Î", - "И", - "İ", - "ℑ", - "Ì", - "ℑ", - "Ī", - "ⅈ", - "⇒", - "∬", - "∫", - "⋂", - "⁣", - "⁢", - "Į", - "𝕀", - "Ι", - "ℐ", - "Ĩ", - "І", - "Ï", - "Ĵ", - "Й", - "𝔍", - "𝕁", - "𝒥", - "Ј", - "Є", - "Х", - "Ќ", - "Κ", - "Ķ", - "К", - "𝔎", - "𝕂", - "𝒦", - "Љ", - "<", - "Ĺ", - "Λ", - "⟪", - "ℒ", - "↞", - "Ľ", - "Ļ", - "Л", - "⟨", - "←", - "⇤", - "⇆", - "⌈", - "⟦", - "⥡", - "⇃", - "⥙", - "⌊", - "↔", - "⥎", - "⊣", - "↤", - "⥚", - "⊲", - "⧏", - "⊴", - "⥑", - "⥠", - "↿", - "⥘", - "↼", - "⥒", - "⇐", - "⇔", - "⋚", - "≦", - "≶", - "⪡", - "⩽", - "≲", - "𝔏", - "⋘", - "⇚", - "Ŀ", - "⟵", - "⟷", - "⟶", - "⟸", - "⟺", - "⟹", - "𝕃", - "↙", - "↘", - "ℒ", - "↰", - "Ł", - "≪", - "⤅", - "М", - " ", - "ℳ", - "𝔐", - "∓", - "𝕄", - "ℳ", - "Μ", - "Њ", - "Ń", - "Ň", - "Ņ", - "Н", - "​", - "​", - "​", - "​", - "≫", - "≪", - "
", - "𝔑", - "⁠", - " ", - "ℕ", - "⫬", - "≢", - "≭", - "∦", - "∉", - "≠", - "≂̸", - "∄", - "≯", - "≱", - "≧̸", - "≫̸", - "≹", - "⩾̸", - "≵", - "≎̸", - "≏̸", - "⋪", - "⧏̸", - "⋬", - "≮", - "≰", - "≸", - "≪̸", - "⩽̸", - "≴", - "⪢̸", - "⪡̸", - "⊀", - "⪯̸", - "⋠", - "∌", - "⋫", - "⧐̸", - "⋭", - "⊏̸", - "⋢", - "⊐̸", - "⋣", - "⊂⃒", - "⊈", - "⊁", - "⪰̸", - "⋡", - "≿̸", - "⊃⃒", - "⊉", - "≁", - "≄", - "≇", - "≉", - "∤", - "𝒩", - "Ñ", - "Ν", - "Œ", - "Ó", - "Ô", - "О", - "Ő", - "𝔒", - "Ò", - "Ō", - "Ω", - "Ο", - "𝕆", - "“", - "‘", - "⩔", - "𝒪", - "Ø", - "Õ", - "⨷", - "Ö", - "‾", - "⏞", - "⎴", - "⏜", - "∂", - "П", - "𝔓", - "Φ", - "Π", - "±", - "ℌ", - "ℙ", - "⪻", - "≺", - "⪯", - "≼", - "≾", - "″", - "∏", - "∷", - "∝", - "𝒫", - "Ψ", - """, - "𝔔", - "ℚ", - "𝒬", - "⤐", - "®", - "Ŕ", - "⟫", - "↠", - "⤖", - "Ř", - "Ŗ", - "Р", - "ℜ", - "∋", - "⇋", - "⥯", - "ℜ", - "Ρ", - "⟩", - "→", - "⇥", - "⇄", - "⌉", - "⟧", - "⥝", - "⇂", - "⥕", - "⌋", - "⊢", - "↦", - "⥛", - "⊳", - "⧐", - "⊵", - "⥏", - "⥜", - "↾", - "⥔", - "⇀", - "⥓", - "⇒", - "ℝ", - "⥰", - "⇛", - "ℛ", - "↱", - "⧴", - "Щ", - "Ш", - "Ь", - "Ś", - "⪼", - "Š", - "Ş", - "Ŝ", - "С", - "𝔖", - "↓", - "←", - "→", - "↑", - "Σ", - "∘", - "𝕊", - "√", - "□", - "⊓", - "⊏", - "⊑", - "⊐", - "⊒", - "⊔", - "𝒮", - "⋆", - "⋐", - "⋐", - "⊆", - "≻", - "⪰", - "≽", - "≿", - "∋", - "∑", - "⋑", - "⊃", - "⊇", - "⋑", - "Þ", - "™", - "Ћ", - "Ц", - "	", - "Τ", - "Ť", - "Ţ", - "Т", - "𝔗", - "∴", - "Θ", - "  ", - " ", - "∼", - "≃", - "≅", - "≈", - "𝕋", - "⃛", - "𝒯", - "Ŧ", - "Ú", - "↟", - "⥉", - "Ў", - "Ŭ", - "Û", - "У", - "Ű", - "𝔘", - "Ù", - "Ū", - "_", - "⏟", - "⎵", - "⏝", - "⋃", - "⊎", - "Ų", - "𝕌", - "↑", - "⤒", - "⇅", - "↕", - "⥮", - "⊥", - "↥", - "⇑", - "⇕", - "↖", - "↗", - "ϒ", - "Υ", - "Ů", - "𝒰", - "Ũ", - "Ü", - "⊫", - "⫫", - "В", - "⊩", - "⫦", - "⋁", - "‖", - "‖", - "∣", - "|", - "❘", - "≀", - " ", - "𝔙", - "𝕍", - "𝒱", - "⊪", - "Ŵ", - "⋀", - "𝔚", - "𝕎", - "𝒲", - "𝔛", - "Ξ", - "𝕏", - "𝒳", - "Я", - "Ї", - "Ю", - "Ý", - "Ŷ", - "Ы", - "𝔜", - "𝕐", - "𝒴", - "Ÿ", - "Ж", - "Ź", - "Ž", - "З", - "Ż", - "​", - "Ζ", - "ℨ", - "ℤ", - "𝒵", - "á", - "ă", - "∾", - "∾̳", - "∿", - "â", - "´", - "а", - "æ", - "⁡", - "𝔞", - "à", - "ℵ", - "ℵ", - "α", - "ā", - "⨿", - "&", - "∧", - "⩕", - "⩜", - "⩘", - "⩚", - "∠", - "⦤", - "∠", - "∡", - "⦨", - "⦩", - "⦪", - "⦫", - "⦬", - "⦭", - "⦮", - "⦯", - "∟", - "⊾", - "⦝", - "∢", - "Å", - "⍼", - "ą", - "𝕒", - "≈", - "⩰", - "⩯", - "≊", - "≋", - "'", - "≈", - "≊", - "å", - "𝒶", - "*", - "≈", - "≍", - "ã", - "ä", - "∳", - "⨑", - "⫭", - "≌", - "϶", - "‵", - "∽", - "⋍", - "⊽", - "⌅", - "⌅", - "⎵", - "⎶", - "≌", - "б", - "„", - "∵", - "∵", - "⦰", - "϶", - "ℬ", - "β", - "ℶ", - "≬", - "𝔟", - "⋂", - "◯", - "⋃", - "⨀", - "⨁", - "⨂", - "⨆", - "★", - "▽", - "△", - "⨄", - "⋁", - "⋀", - "⤍", - "⧫", - "▪", - "▴", - "▾", - "◂", - "▸", - "␣", - "▒", - "░", - "▓", - "█", - "=⃥", - "≡⃥", - "⌐", - "𝕓", - "⊥", - "⊥", - "⋈", - "╗", - "╔", - "╖", - "╓", - "═", - "╦", - "╩", - "╤", - "╧", - "╝", - "╚", - "╜", - "╙", - "║", - "╬", - "╣", - "╠", - "╫", - "╢", - "╟", - "⧉", - "╕", - "╒", - "┐", - "┌", - "─", - "╥", - "╨", - "┬", - "┴", - "⊟", - "⊞", - "⊠", - "╛", - "╘", - "┘", - "└", - "│", - "╪", - "╡", - "╞", - "┼", - "┤", - "├", - "‵", - "˘", - "¦", - "𝒷", - "⁏", - "∽", - "⋍", - "\", - "⧅", - "⟈", - "•", - "•", - "≎", - "⪮", - "≏", - "≏", - "ć", - "∩", - "⩄", - "⩉", - "⩋", - "⩇", - "⩀", - "∩︀", - "⁁", - "ˇ", - "⩍", - "č", - "ç", - "ĉ", - "⩌", - "⩐", - "ċ", - "¸", - "⦲", - "¢", - "·", - "𝔠", - "ч", - "✓", - "✓", - "χ", - "○", - "⧃", - "ˆ", - "≗", - "↺", - "↻", - "®", - "Ⓢ", - "⊛", - "⊚", - "⊝", - "≗", - "⨐", - "⫯", - "⧂", - "♣", - "♣", - ":", - "≔", - "≔", - ",", - "@", - "∁", - "∘", - "∁", - "ℂ", - "≅", - "⩭", - "∮", - "𝕔", - "∐", - "©", - "℗", - "↵", - "✗", - "𝒸", - "⫏", - "⫑", - "⫐", - "⫒", - "⋯", - "⤸", - "⤵", - "⋞", - "⋟", - "↶", - "⤽", - "∪", - "⩈", - "⩆", - "⩊", - "⊍", - "⩅", - "∪︀", - "↷", - "⤼", - "⋞", - "⋟", - "⋎", - "⋏", - "¤", - "↶", - "↷", - "⋎", - "⋏", - "∲", - "∱", - "⌭", - "⇓", - "⥥", - "†", - "ℸ", - "↓", - "‐", - "⊣", - "⤏", - "˝", - "ď", - "д", - "ⅆ", - "‡", - "⇊", - "⩷", - "°", - "δ", - "⦱", - "⥿", - "𝔡", - "⇃", - "⇂", - "⋄", - "⋄", - "♦", - "♦", - "¨", - "ϝ", - "⋲", - "÷", - "÷", - "⋇", - "⋇", - "ђ", - "⌞", - "⌍", - "$", - "𝕕", - "˙", - "≐", - "≑", - "∸", - "∔", - "⊡", - "⌆", - "↓", - "⇊", - "⇃", - "⇂", - "⤐", - "⌟", - "⌌", - "𝒹", - "ѕ", - "⧶", - "đ", - "⋱", - "▿", - "▾", - "⇵", - "⥯", - "⦦", - "џ", - "⟿", - "⩷", - "≑", - "é", - "⩮", - "ě", - "≖", - "ê", - "≕", - "э", - "ė", - "ⅇ", - "≒", - "𝔢", - "⪚", - "è", - "⪖", - "⪘", - "⪙", - "⏧", - "ℓ", - "⪕", - "⪗", - "ē", - "∅", - "∅", - "∅", - " ", - " ", - " ", - "ŋ", - " ", - "ę", - "𝕖", - "⋕", - "⧣", - "⩱", - "ε", - "ε", - "ϵ", - "≖", - "≕", - "≂", - "⪖", - "⪕", - "=", - "≟", - "≡", - "⩸", - "⧥", - "≓", - "⥱", - "ℯ", - "≐", - "≂", - "η", - "ð", - "ë", - "€", - "!", - "∃", - "ℰ", - "ⅇ", - "≒", - "ф", - "♀", - "ffi", - "ff", - "ffl", - "𝔣", - "fi", - "fj", - "♭", - "fl", - "▱", - "ƒ", - "𝕗", - "∀", - "⋔", - "⫙", - "⨍", - "½", - "⅓", - "¼", - "⅕", - "⅙", - "⅛", - "⅔", - "⅖", - "¾", - "⅗", - "⅜", - "⅘", - "⅚", - "⅝", - "⅞", - "⁄", - "⌢", - "𝒻", - "≧", - "⪌", - "ǵ", - "γ", - "ϝ", - "⪆", - "ğ", - "ĝ", - "г", - "ġ", - "≥", - "⋛", - "≥", - "≧", - "⩾", - "⩾", - "⪩", - "⪀", - "⪂", - "⪄", - "⋛︀", - "⪔", - "𝔤", - "≫", - "⋙", - "ℷ", - "ѓ", - "≷", - "⪒", - "⪥", - "⪤", - "≩", - "⪊", - "⪊", - "⪈", - "⪈", - "≩", - "⋧", - "𝕘", - "`", - "ℊ", - "≳", - "⪎", - "⪐", - ">", - "⪧", - "⩺", - "⋗", - "⦕", - "⩼", - "⪆", - "⥸", - "⋗", - "⋛", - "⪌", - "≷", - "≳", - "≩︀", - "≩︀", - "⇔", - " ", - "½", - "ℋ", - "ъ", - "↔", - "⥈", - "↭", - "ℏ", - "ĥ", - "♥", - "♥", - "…", - "⊹", - "𝔥", - "⤥", - "⤦", - "⇿", - "∻", - "↩", - "↪", - "𝕙", - "―", - "𝒽", - "ℏ", - "ħ", - "⁃", - "‐", - "í", - "⁣", - "î", - "и", - "е", - "¡", - "⇔", - "𝔦", - "ì", - "ⅈ", - "⨌", - "∭", - "⧜", - "℩", - "ij", - "ī", - "ℑ", - "ℐ", - "ℑ", - "ı", - "⊷", - "Ƶ", - "∈", - "℅", - "∞", - "⧝", - "ı", - "∫", - "⊺", - "ℤ", - "⊺", - "⨗", - "⨼", - "ё", - "į", - "𝕚", - "ι", - "⨼", - "¿", - "𝒾", - "∈", - "⋹", - "⋵", - "⋴", - "⋳", - "∈", - "⁢", - "ĩ", - "і", - "ï", - "ĵ", - "й", - "𝔧", - "ȷ", - "𝕛", - "𝒿", - "ј", - "є", - "κ", - "ϰ", - "ķ", - "к", - "𝔨", - "ĸ", - "х", - "ќ", - "𝕜", - "𝓀", - "⇚", - "⇐", - "⤛", - "⤎", - "≦", - "⪋", - "⥢", - "ĺ", - "⦴", - "ℒ", - "λ", - "⟨", - "⦑", - "⟨", - "⪅", - "«", - "←", - "⇤", - "⤟", - "⤝", - "↩", - "↫", - "⤹", - "⥳", - "↢", - "⪫", - "⤙", - "⪭", - "⪭︀", - "⤌", - "❲", - "{", - "[", - "⦋", - "⦏", - "⦍", - "ľ", - "ļ", - "⌈", - "{", - "л", - "⤶", - "“", - "„", - "⥧", - "⥋", - "↲", - "≤", - "←", - "↢", - "↽", - "↼", - "⇇", - "↔", - "⇆", - "⇋", - "↭", - "⋋", - "⋚", - "≤", - "≦", - "⩽", - "⩽", - "⪨", - "⩿", - "⪁", - "⪃", - "⋚︀", - "⪓", - "⪅", - "⋖", - "⋚", - "⪋", - "≶", - "≲", - "⥼", - "⌊", - "𝔩", - "≶", - "⪑", - "↽", - "↼", - "⥪", - "▄", - "љ", - "≪", - "⇇", - "⌞", - "⥫", - "◺", - "ŀ", - "⎰", - "⎰", - "≨", - "⪉", - "⪉", - "⪇", - "⪇", - "≨", - "⋦", - "⟬", - "⇽", - "⟦", - "⟵", - "⟷", - "⟼", - "⟶", - "↫", - "↬", - "⦅", - "𝕝", - "⨭", - "⨴", - "∗", - "_", - "◊", - "◊", - "⧫", - "(", - "⦓", - "⇆", - "⌟", - "⇋", - "⥭", - "‎", - "⊿", - "‹", - "𝓁", - "↰", - "≲", - "⪍", - "⪏", - "[", - "‘", - "‚", - "ł", - "<", - "⪦", - "⩹", - "⋖", - "⋋", - "⋉", - "⥶", - "⩻", - "⦖", - "◃", - "⊴", - "◂", - "⥊", - "⥦", - "≨︀", - "≨︀", - "∺", - "¯", - "♂", - "✠", - "✠", - "↦", - "↦", - "↧", - "↤", - "↥", - "▮", - "⨩", - "м", - "—", - "∡", - "𝔪", - "℧", - "µ", - "∣", - "*", - "⫰", - "·", - "−", - "⊟", - "∸", - "⨪", - "⫛", - "…", - "∓", - "⊧", - "𝕞", - "∓", - "𝓂", - "∾", - "μ", - "⊸", - "⊸", - "⋙̸", - "≫⃒", - "≫̸", - "⇍", - "⇎", - "⋘̸", - "≪⃒", - "≪̸", - "⇏", - "⊯", - "⊮", - "∇", - "ń", - "∠⃒", - "≉", - "⩰̸", - "≋̸", - "ʼn", - "≉", - "♮", - "♮", - "ℕ", - " ", - "≎̸", - "≏̸", - "⩃", - "ň", - "ņ", - "≇", - "⩭̸", - "⩂", - "н", - "–", - "≠", - "⇗", - "⤤", - "↗", - "↗", - "≐̸", - "≢", - "⤨", - "≂̸", - "∄", - "∄", - "𝔫", - "≧̸", - "≱", - "≱", - "≧̸", - "⩾̸", - "⩾̸", - "≵", - "≯", - "≯", - "⇎", - "↮", - "⫲", - "∋", - "⋼", - "⋺", - "∋", - "њ", - "⇍", - "≦̸", - "↚", - "‥", - "≰", - "↚", - "↮", - "≰", - "≦̸", - "⩽̸", - "⩽̸", - "≮", - "≴", - "≮", - "⋪", - "⋬", - "∤", - "𝕟", - "¬", - "∉", - "⋹̸", - "⋵̸", - "∉", - "⋷", - "⋶", - "∌", - "∌", - "⋾", - "⋽", - "∦", - "∦", - "⫽⃥", - "∂̸", - "⨔", - "⊀", - "⋠", - "⪯̸", - "⊀", - "⪯̸", - "⇏", - "↛", - "⤳̸", - "↝̸", - "↛", - "⋫", - "⋭", - "⊁", - "⋡", - "⪰̸", - "𝓃", - "∤", - "∦", - "≁", - "≄", - "≄", - "∤", - "∦", - "⋢", - "⋣", - "⊄", - "⫅̸", - "⊈", - "⊂⃒", - "⊈", - "⫅̸", - "⊁", - "⪰̸", - "⊅", - "⫆̸", - "⊉", - "⊃⃒", - "⊉", - "⫆̸", - "≹", - "ñ", - "≸", - "⋪", - "⋬", - "⋫", - "⋭", - "ν", - "#", - "№", - " ", - "⊭", - "⤄", - "≍⃒", - "⊬", - "≥⃒", - ">⃒", - "⧞", - "⤂", - "≤⃒", - "<⃒", - "⊴⃒", - "⤃", - "⊵⃒", - "∼⃒", - "⇖", - "⤣", - "↖", - "↖", - "⤧", - "Ⓢ", - "ó", - "⊛", - "⊚", - "ô", - "о", - "⊝", - "ő", - "⨸", - "⊙", - "⦼", - "œ", - "⦿", - "𝔬", - "˛", - "ò", - "⧁", - "⦵", - "Ω", - "∮", - "↺", - "⦾", - "⦻", - "‾", - "⧀", - "ō", - "ω", - "ο", - "⦶", - "⊖", - "𝕠", - "⦷", - "⦹", - "⊕", - "∨", - "↻", - "⩝", - "ℴ", - "ℴ", - "ª", - "º", - "⊶", - "⩖", - "⩗", - "⩛", - "ℴ", - "ø", - "⊘", - "õ", - "⊗", - "⨶", - "ö", - "⌽", - "∥", - "¶", - "∥", - "⫳", - "⫽", - "∂", - "п", - "%", - ".", - "‰", - "⊥", - "‱", - "𝔭", - "φ", - "ϕ", - "ℳ", - "☎", - "π", - "⋔", - "ϖ", - "ℏ", - "ℎ", - "ℏ", - "+", - "⨣", - "⊞", - "⨢", - "∔", - "⨥", - "⩲", - "±", - "⨦", - "⨧", - "±", - "⨕", - "𝕡", - "£", - "≺", - "⪳", - "⪷", - "≼", - "⪯", - "≺", - "⪷", - "≼", - "⪯", - "⪹", - "⪵", - "⋨", - "≾", - "′", - "ℙ", - "⪵", - "⪹", - "⋨", - "∏", - "⌮", - "⌒", - "⌓", - "∝", - "∝", - "≾", - "⊰", - "𝓅", - "ψ", - " ", - "𝔮", - "⨌", - "𝕢", - "⁗", - "𝓆", - "ℍ", - "⨖", - "?", - "≟", - """, - "⇛", - "⇒", - "⤜", - "⤏", - "⥤", - "∽̱", - "ŕ", - "√", - "⦳", - "⟩", - "⦒", - "⦥", - "⟩", - "»", - "→", - "⥵", - "⇥", - "⤠", - "⤳", - "⤞", - "↪", - "↬", - "⥅", - "⥴", - "↣", - "↝", - "⤚", - "∶", - "ℚ", - "⤍", - "❳", - "}", - "]", - "⦌", - "⦎", - "⦐", - "ř", - "ŗ", - "⌉", - "}", - "р", - "⤷", - "⥩", - "”", - "”", - "↳", - "ℜ", - "ℛ", - "ℜ", - "ℝ", - "▭", - "®", - "⥽", - "⌋", - "𝔯", - "⇁", - "⇀", - "⥬", - "ρ", - "ϱ", - "→", - "↣", - "⇁", - "⇀", - "⇄", - "⇌", - "⇉", - "↝", - "⋌", - "˚", - "≓", - "⇄", - "⇌", - "‏", - "⎱", - "⎱", - "⫮", - "⟭", - "⇾", - "⟧", - "⦆", - "𝕣", - "⨮", - "⨵", - ")", - "⦔", - "⨒", - "⇉", - "›", - "𝓇", - "↱", - "]", - "’", - "’", - "⋌", - "⋊", - "▹", - "⊵", - "▸", - "⧎", - "⥨", - "℞", - "ś", - "‚", - "≻", - "⪴", - "⪸", - "š", - "≽", - "⪰", - "ş", - "ŝ", - "⪶", - "⪺", - "⋩", - "⨓", - "≿", - "с", - "⋅", - "⊡", - "⩦", - "⇘", - "⤥", - "↘", - "↘", - "§", - ";", - "⤩", - "∖", - "∖", - "✶", - "𝔰", - "⌢", - "♯", - "щ", - "ш", - "∣", - "∥", - "­", - "σ", - "ς", - "ς", - "∼", - "⩪", - "≃", - "≃", - "⪞", - "⪠", - "⪝", - "⪟", - "≆", - "⨤", - "⥲", - "←", - "∖", - "⨳", - "⧤", - "∣", - "⌣", - "⪪", - "⪬", - "⪬︀", - "ь", - "/", - "⧄", - "⌿", - "𝕤", - "♠", - "♠", - "∥", - "⊓", - "⊓︀", - "⊔", - "⊔︀", - "⊏", - "⊑", - "⊏", - "⊑", - "⊐", - "⊒", - "⊐", - "⊒", - "□", - "□", - "▪", - "▪", - "→", - "𝓈", - "∖", - "⌣", - "⋆", - "☆", - "★", - "ϵ", - "ϕ", - "¯", - "⊂", - "⫅", - "⪽", - "⊆", - "⫃", - "⫁", - "⫋", - "⊊", - "⪿", - "⥹", - "⊂", - "⊆", - "⫅", - "⊊", - "⫋", - "⫇", - "⫕", - "⫓", - "≻", - "⪸", - "≽", - "⪰", - "⪺", - "⪶", - "⋩", - "≿", - "∑", - "♪", - "⊃", - "¹", - "²", - "³", - "⫆", - "⪾", - "⫘", - "⊇", - "⫄", - "⟉", - "⫗", - "⥻", - "⫂", - "⫌", - "⊋", - "⫀", - "⊃", - "⊇", - "⫆", - "⊋", - "⫌", - "⫈", - "⫔", - "⫖", - "⇙", - "⤦", - "↙", - "↙", - "⤪", - "ß", - "⌖", - "τ", - "⎴", - "ť", - "ţ", - "т", - "⃛", - "⌕", - "𝔱", - "∴", - "∴", - "θ", - "ϑ", - "ϑ", - "≈", - "∼", - " ", - "≈", - "∼", - "þ", - "˜", - "×", - "⊠", - "⨱", - "⨰", - "∭", - "⤨", - "⊤", - "⌶", - "⫱", - "𝕥", - "⫚", - "⤩", - "‴", - "™", - "▵", - "▿", - "◃", - "⊴", - "≜", - "▹", - "⊵", - "◬", - "≜", - "⨺", - "⨹", - "⧍", - "⨻", - "⏢", - "𝓉", - "ц", - "ћ", - "ŧ", - "≬", - "↞", - "↠", - "⇑", - "⥣", - "ú", - "↑", - "ў", - "ŭ", - "û", - "у", - "⇅", - "ű", - "⥮", - "⥾", - "𝔲", - "ù", - "↿", - "↾", - "▀", - "⌜", - "⌜", - "⌏", - "◸", - "ū", - "¨", - "ų", - "𝕦", - "↑", - "↕", - "↿", - "↾", - "⊎", - "υ", - "ϒ", - "υ", - "⇈", - "⌝", - "⌝", - "⌎", - "ů", - "◹", - "𝓊", - "⋰", - "ũ", - "▵", - "▴", - "⇈", - "ü", - "⦧", - "⇕", - "⫨", - "⫩", - "⊨", - "⦜", - "ϵ", - "ϰ", - "∅", - "ϕ", - "ϖ", - "∝", - "↕", - "ϱ", - "ς", - "⊊︀", - "⫋︀", - "⊋︀", - "⫌︀", - "ϑ", - "⊲", - "⊳", - "в", - "⊢", - "∨", - "⊻", - "≚", - "⋮", - "|", - "|", - "𝔳", - "⊲", - "⊂⃒", - "⊃⃒", - "𝕧", - "∝", - "⊳", - "𝓋", - "⫋︀", - "⊊︀", - "⫌︀", - "⊋︀", - "⦚", - "ŵ", - "⩟", - "∧", - "≙", - "℘", - "𝔴", - "𝕨", - "℘", - "≀", - "≀", - "𝓌", - "⋂", - "◯", - "⋃", - "▽", - "𝔵", - "⟺", - "⟷", - "ξ", - "⟸", - "⟵", - "⟼", - "⋻", - "⨀", - "𝕩", - "⨁", - "⨂", - "⟹", - "⟶", - "𝓍", - "⨆", - "⨄", - "△", - "⋁", - "⋀", - "ý", - "я", - "ŷ", - "ы", - "¥", - "𝔶", - "ї", - "𝕪", - "𝓎", - "ю", - "ÿ", - "ź", - "ž", - "з", - "ż", - "ℨ", - "ζ", - "𝔷", - "ж", - "⇝", - "𝕫", - "𝓏", - "‍", - "‌", + "Æ", + "&", + "Á", + "Ă", + "Â", + "А", + "𝔄", + "À", + "Α", + "Ā", + "⩓", + "Ą", + "𝔸", + "⁡", + "Å", + "𝒜", + "≔", + "Ã", + "Ä", + "∖", + "⫧", + "⌆", + "Б", + "∵", + "ℬ", + "Β", + "𝔅", + "𝔹", + "˘", + "ℬ", + "≎", + "Ч", + "©", + "Ć", + "⋒", + "ⅅ", + "ℭ", + "Č", + "Ç", + "Ĉ", + "∰", + "Ċ", + "¸", + "·", + "ℭ", + "Χ", + "⊙", + "⊖", + "⊕", + "⊗", + "∲", + "”", + "’", + "∷", + "⩴", + "≡", + "∯", + "∮", + "ℂ", + "∐", + "∳", + "⨯", + "𝒞", + "⋓", + "≍", + "ⅅ", + "⤑", + "Ђ", + "Ѕ", + "Џ", + "‡", + "↡", + "⫤", + "Ď", + "Д", + "∇", + "Δ", + "𝔇", + "´", + "˙", + "˝", + "`", + "˜", + "⋄", + "ⅆ", + "𝔻", + "¨", + "⃜", + "≐", + "∯", + "¨", + "⇓", + "⇐", + "⇔", + "⫤", + "⟸", + "⟺", + "⟹", + "⇒", + "⊨", + "⇑", + "⇕", + "∥", + "↓", + "⤓", + "⇵", + "̑", + "⥐", + "⥞", + "↽", + "⥖", + "⥟", + "⇁", + "⥗", + "⊤", + "↧", + "⇓", + "𝒟", + "Đ", + "Ŋ", + "Ð", + "É", + "Ě", + "Ê", + "Э", + "Ė", + "𝔈", + "È", + "∈", + "Ē", + "◻", + "▫", + "Ę", + "𝔼", + "Ε", + "⩵", + "≂", + "⇌", + "ℰ", + "⩳", + "Η", + "Ë", + "∃", + "ⅇ", + "Ф", + "𝔉", + "◼", + "▪", + "𝔽", + "∀", + "ℱ", + "ℱ", + "Ѓ", + ">", + "Γ", + "Ϝ", + "Ğ", + "Ģ", + "Ĝ", + "Г", + "Ġ", + "𝔊", + "⋙", + "𝔾", + "≥", + "⋛", + "≧", + "⪢", + "≷", + "⩾", + "≳", + "𝒢", + "≫", + "Ъ", + "ˇ", + "^", + "Ĥ", + "ℌ", + "ℋ", + "ℍ", + "─", + "ℋ", + "Ħ", + "≎", + "≏", + "Е", + "IJ", + "Ё", + "Í", + "Î", + "И", + "İ", + "ℑ", + "Ì", + "ℑ", + "Ī", + "ⅈ", + "⇒", + "∬", + "∫", + "⋂", + "⁣", + "⁢", + "Į", + "𝕀", + "Ι", + "ℐ", + "Ĩ", + "І", + "Ï", + "Ĵ", + "Й", + "𝔍", + "𝕁", + "𝒥", + "Ј", + "Є", + "Х", + "Ќ", + "Κ", + "Ķ", + "К", + "𝔎", + "𝕂", + "𝒦", + "Љ", + "<", + "Ĺ", + "Λ", + "⟪", + "ℒ", + "↞", + "Ľ", + "Ļ", + "Л", + "⟨", + "←", + "⇤", + "⇆", + "⌈", + "⟦", + "⥡", + "⇃", + "⥙", + "⌊", + "↔", + "⥎", + "⊣", + "↤", + "⥚", + "⊲", + "⧏", + "⊴", + "⥑", + "⥠", + "↿", + "⥘", + "↼", + "⥒", + "⇐", + "⇔", + "⋚", + "≦", + "≶", + "⪡", + "⩽", + "≲", + "𝔏", + "⋘", + "⇚", + "Ŀ", + "⟵", + "⟷", + "⟶", + "⟸", + "⟺", + "⟹", + "𝕃", + "↙", + "↘", + "ℒ", + "↰", + "Ł", + "≪", + "⤅", + "М", + " ", + "ℳ", + "𝔐", + "∓", + "𝕄", + "ℳ", + "Μ", + "Њ", + "Ń", + "Ň", + "Ņ", + "Н", + "​", + "​", + "​", + "​", + "≫", + "≪", + "
", + "𝔑", + "⁠", + " ", + "ℕ", + "⫬", + "≢", + "≭", + "∦", + "∉", + "≠", + "≂̸", + "∄", + "≯", + "≱", + "≧̸", + "≫̸", + "≹", + "⩾̸", + "≵", + "≎̸", + "≏̸", + "⋪", + "⧏̸", + "⋬", + "≮", + "≰", + "≸", + "≪̸", + "⩽̸", + "≴", + "⪢̸", + "⪡̸", + "⊀", + "⪯̸", + "⋠", + "∌", + "⋫", + "⧐̸", + "⋭", + "⊏̸", + "⋢", + "⊐̸", + "⋣", + "⊂⃒", + "⊈", + "⊁", + "⪰̸", + "⋡", + "≿̸", + "⊃⃒", + "⊉", + "≁", + "≄", + "≇", + "≉", + "∤", + "𝒩", + "Ñ", + "Ν", + "Œ", + "Ó", + "Ô", + "О", + "Ő", + "𝔒", + "Ò", + "Ō", + "Ω", + "Ο", + "𝕆", + "“", + "‘", + "⩔", + "𝒪", + "Ø", + "Õ", + "⨷", + "Ö", + "‾", + "⏞", + "⎴", + "⏜", + "∂", + "П", + "𝔓", + "Φ", + "Π", + "±", + "ℌ", + "ℙ", + "⪻", + "≺", + "⪯", + "≼", + "≾", + "″", + "∏", + "∷", + "∝", + "𝒫", + "Ψ", + """, + "𝔔", + "ℚ", + "𝒬", + "⤐", + "®", + "Ŕ", + "⟫", + "↠", + "⤖", + "Ř", + "Ŗ", + "Р", + "ℜ", + "∋", + "⇋", + "⥯", + "ℜ", + "Ρ", + "⟩", + "→", + "⇥", + "⇄", + "⌉", + "⟧", + "⥝", + "⇂", + "⥕", + "⌋", + "⊢", + "↦", + "⥛", + "⊳", + "⧐", + "⊵", + "⥏", + "⥜", + "↾", + "⥔", + "⇀", + "⥓", + "⇒", + "ℝ", + "⥰", + "⇛", + "ℛ", + "↱", + "⧴", + "Щ", + "Ш", + "Ь", + "Ś", + "⪼", + "Š", + "Ş", + "Ŝ", + "С", + "𝔖", + "↓", + "←", + "→", + "↑", + "Σ", + "∘", + "𝕊", + "√", + "□", + "⊓", + "⊏", + "⊑", + "⊐", + "⊒", + "⊔", + "𝒮", + "⋆", + "⋐", + "⋐", + "⊆", + "≻", + "⪰", + "≽", + "≿", + "∋", + "∑", + "⋑", + "⊃", + "⊇", + "⋑", + "Þ", + "™", + "Ћ", + "Ц", + "	", + "Τ", + "Ť", + "Ţ", + "Т", + "𝔗", + "∴", + "Θ", + "  ", + " ", + "∼", + "≃", + "≅", + "≈", + "𝕋", + "⃛", + "𝒯", + "Ŧ", + "Ú", + "↟", + "⥉", + "Ў", + "Ŭ", + "Û", + "У", + "Ű", + "𝔘", + "Ù", + "Ū", + "_", + "⏟", + "⎵", + "⏝", + "⋃", + "⊎", + "Ų", + "𝕌", + "↑", + "⤒", + "⇅", + "↕", + "⥮", + "⊥", + "↥", + "⇑", + "⇕", + "↖", + "↗", + "ϒ", + "Υ", + "Ů", + "𝒰", + "Ũ", + "Ü", + "⊫", + "⫫", + "В", + "⊩", + "⫦", + "⋁", + "‖", + "‖", + "∣", + "|", + "❘", + "≀", + " ", + "𝔙", + "𝕍", + "𝒱", + "⊪", + "Ŵ", + "⋀", + "𝔚", + "𝕎", + "𝒲", + "𝔛", + "Ξ", + "𝕏", + "𝒳", + "Я", + "Ї", + "Ю", + "Ý", + "Ŷ", + "Ы", + "𝔜", + "𝕐", + "𝒴", + "Ÿ", + "Ж", + "Ź", + "Ž", + "З", + "Ż", + "​", + "Ζ", + "ℨ", + "ℤ", + "𝒵", + "á", + "ă", + "∾", + "∾̳", + "∿", + "â", + "´", + "а", + "æ", + "⁡", + "𝔞", + "à", + "ℵ", + "ℵ", + "α", + "ā", + "⨿", + "&", + "∧", + "⩕", + "⩜", + "⩘", + "⩚", + "∠", + "⦤", + "∠", + "∡", + "⦨", + "⦩", + "⦪", + "⦫", + "⦬", + "⦭", + "⦮", + "⦯", + "∟", + "⊾", + "⦝", + "∢", + "Å", + "⍼", + "ą", + "𝕒", + "≈", + "⩰", + "⩯", + "≊", + "≋", + "'", + "≈", + "≊", + "å", + "𝒶", + "*", + "≈", + "≍", + "ã", + "ä", + "∳", + "⨑", + "⫭", + "≌", + "϶", + "‵", + "∽", + "⋍", + "⊽", + "⌅", + "⌅", + "⎵", + "⎶", + "≌", + "б", + "„", + "∵", + "∵", + "⦰", + "϶", + "ℬ", + "β", + "ℶ", + "≬", + "𝔟", + "⋂", + "◯", + "⋃", + "⨀", + "⨁", + "⨂", + "⨆", + "★", + "▽", + "△", + "⨄", + "⋁", + "⋀", + "⤍", + "⧫", + "▪", + "▴", + "▾", + "◂", + "▸", + "␣", + "▒", + "░", + "▓", + "█", + "=⃥", + "≡⃥", + "⌐", + "𝕓", + "⊥", + "⊥", + "⋈", + "╗", + "╔", + "╖", + "╓", + "═", + "╦", + "╩", + "╤", + "╧", + "╝", + "╚", + "╜", + "╙", + "║", + "╬", + "╣", + "╠", + "╫", + "╢", + "╟", + "⧉", + "╕", + "╒", + "┐", + "┌", + "─", + "╥", + "╨", + "┬", + "┴", + "⊟", + "⊞", + "⊠", + "╛", + "╘", + "┘", + "└", + "│", + "╪", + "╡", + "╞", + "┼", + "┤", + "├", + "‵", + "˘", + "¦", + "𝒷", + "⁏", + "∽", + "⋍", + "\", + "⧅", + "⟈", + "•", + "•", + "≎", + "⪮", + "≏", + "≏", + "ć", + "∩", + "⩄", + "⩉", + "⩋", + "⩇", + "⩀", + "∩︀", + "⁁", + "ˇ", + "⩍", + "č", + "ç", + "ĉ", + "⩌", + "⩐", + "ċ", + "¸", + "⦲", + "¢", + "·", + "𝔠", + "ч", + "✓", + "✓", + "χ", + "○", + "⧃", + "ˆ", + "≗", + "↺", + "↻", + "®", + "Ⓢ", + "⊛", + "⊚", + "⊝", + "≗", + "⨐", + "⫯", + "⧂", + "♣", + "♣", + ":", + "≔", + "≔", + ",", + "@", + "∁", + "∘", + "∁", + "ℂ", + "≅", + "⩭", + "∮", + "𝕔", + "∐", + "©", + "℗", + "↵", + "✗", + "𝒸", + "⫏", + "⫑", + "⫐", + "⫒", + "⋯", + "⤸", + "⤵", + "⋞", + "⋟", + "↶", + "⤽", + "∪", + "⩈", + "⩆", + "⩊", + "⊍", + "⩅", + "∪︀", + "↷", + "⤼", + "⋞", + "⋟", + "⋎", + "⋏", + "¤", + "↶", + "↷", + "⋎", + "⋏", + "∲", + "∱", + "⌭", + "⇓", + "⥥", + "†", + "ℸ", + "↓", + "‐", + "⊣", + "⤏", + "˝", + "ď", + "д", + "ⅆ", + "‡", + "⇊", + "⩷", + "°", + "δ", + "⦱", + "⥿", + "𝔡", + "⇃", + "⇂", + "⋄", + "⋄", + "♦", + "♦", + "¨", + "ϝ", + "⋲", + "÷", + "÷", + "⋇", + "⋇", + "ђ", + "⌞", + "⌍", + "$", + "𝕕", + "˙", + "≐", + "≑", + "∸", + "∔", + "⊡", + "⌆", + "↓", + "⇊", + "⇃", + "⇂", + "⤐", + "⌟", + "⌌", + "𝒹", + "ѕ", + "⧶", + "đ", + "⋱", + "▿", + "▾", + "⇵", + "⥯", + "⦦", + "џ", + "⟿", + "⩷", + "≑", + "é", + "⩮", + "ě", + "≖", + "ê", + "≕", + "э", + "ė", + "ⅇ", + "≒", + "𝔢", + "⪚", + "è", + "⪖", + "⪘", + "⪙", + "⏧", + "ℓ", + "⪕", + "⪗", + "ē", + "∅", + "∅", + "∅", + " ", + " ", + " ", + "ŋ", + " ", + "ę", + "𝕖", + "⋕", + "⧣", + "⩱", + "ε", + "ε", + "ϵ", + "≖", + "≕", + "≂", + "⪖", + "⪕", + "=", + "≟", + "≡", + "⩸", + "⧥", + "≓", + "⥱", + "ℯ", + "≐", + "≂", + "η", + "ð", + "ë", + "€", + "!", + "∃", + "ℰ", + "ⅇ", + "≒", + "ф", + "♀", + "ffi", + "ff", + "ffl", + "𝔣", + "fi", + "fj", + "♭", + "fl", + "▱", + "ƒ", + "𝕗", + "∀", + "⋔", + "⫙", + "⨍", + "½", + "⅓", + "¼", + "⅕", + "⅙", + "⅛", + "⅔", + "⅖", + "¾", + "⅗", + "⅜", + "⅘", + "⅚", + "⅝", + "⅞", + "⁄", + "⌢", + "𝒻", + "≧", + "⪌", + "ǵ", + "γ", + "ϝ", + "⪆", + "ğ", + "ĝ", + "г", + "ġ", + "≥", + "⋛", + "≥", + "≧", + "⩾", + "⩾", + "⪩", + "⪀", + "⪂", + "⪄", + "⋛︀", + "⪔", + "𝔤", + "≫", + "⋙", + "ℷ", + "ѓ", + "≷", + "⪒", + "⪥", + "⪤", + "≩", + "⪊", + "⪊", + "⪈", + "⪈", + "≩", + "⋧", + "𝕘", + "`", + "ℊ", + "≳", + "⪎", + "⪐", + ">", + "⪧", + "⩺", + "⋗", + "⦕", + "⩼", + "⪆", + "⥸", + "⋗", + "⋛", + "⪌", + "≷", + "≳", + "≩︀", + "≩︀", + "⇔", + " ", + "½", + "ℋ", + "ъ", + "↔", + "⥈", + "↭", + "ℏ", + "ĥ", + "♥", + "♥", + "…", + "⊹", + "𝔥", + "⤥", + "⤦", + "⇿", + "∻", + "↩", + "↪", + "𝕙", + "―", + "𝒽", + "ℏ", + "ħ", + "⁃", + "‐", + "í", + "⁣", + "î", + "и", + "е", + "¡", + "⇔", + "𝔦", + "ì", + "ⅈ", + "⨌", + "∭", + "⧜", + "℩", + "ij", + "ī", + "ℑ", + "ℐ", + "ℑ", + "ı", + "⊷", + "Ƶ", + "∈", + "℅", + "∞", + "⧝", + "ı", + "∫", + "⊺", + "ℤ", + "⊺", + "⨗", + "⨼", + "ё", + "į", + "𝕚", + "ι", + "⨼", + "¿", + "𝒾", + "∈", + "⋹", + "⋵", + "⋴", + "⋳", + "∈", + "⁢", + "ĩ", + "і", + "ï", + "ĵ", + "й", + "𝔧", + "ȷ", + "𝕛", + "𝒿", + "ј", + "є", + "κ", + "ϰ", + "ķ", + "к", + "𝔨", + "ĸ", + "х", + "ќ", + "𝕜", + "𝓀", + "⇚", + "⇐", + "⤛", + "⤎", + "≦", + "⪋", + "⥢", + "ĺ", + "⦴", + "ℒ", + "λ", + "⟨", + "⦑", + "⟨", + "⪅", + "«", + "←", + "⇤", + "⤟", + "⤝", + "↩", + "↫", + "⤹", + "⥳", + "↢", + "⪫", + "⤙", + "⪭", + "⪭︀", + "⤌", + "❲", + "{", + "[", + "⦋", + "⦏", + "⦍", + "ľ", + "ļ", + "⌈", + "{", + "л", + "⤶", + "“", + "„", + "⥧", + "⥋", + "↲", + "≤", + "←", + "↢", + "↽", + "↼", + "⇇", + "↔", + "⇆", + "⇋", + "↭", + "⋋", + "⋚", + "≤", + "≦", + "⩽", + "⩽", + "⪨", + "⩿", + "⪁", + "⪃", + "⋚︀", + "⪓", + "⪅", + "⋖", + "⋚", + "⪋", + "≶", + "≲", + "⥼", + "⌊", + "𝔩", + "≶", + "⪑", + "↽", + "↼", + "⥪", + "▄", + "љ", + "≪", + "⇇", + "⌞", + "⥫", + "◺", + "ŀ", + "⎰", + "⎰", + "≨", + "⪉", + "⪉", + "⪇", + "⪇", + "≨", + "⋦", + "⟬", + "⇽", + "⟦", + "⟵", + "⟷", + "⟼", + "⟶", + "↫", + "↬", + "⦅", + "𝕝", + "⨭", + "⨴", + "∗", + "_", + "◊", + "◊", + "⧫", + "(", + "⦓", + "⇆", + "⌟", + "⇋", + "⥭", + "‎", + "⊿", + "‹", + "𝓁", + "↰", + "≲", + "⪍", + "⪏", + "[", + "‘", + "‚", + "ł", + "<", + "⪦", + "⩹", + "⋖", + "⋋", + "⋉", + "⥶", + "⩻", + "⦖", + "◃", + "⊴", + "◂", + "⥊", + "⥦", + "≨︀", + "≨︀", + "∺", + "¯", + "♂", + "✠", + "✠", + "↦", + "↦", + "↧", + "↤", + "↥", + "▮", + "⨩", + "м", + "—", + "∡", + "𝔪", + "℧", + "µ", + "∣", + "*", + "⫰", + "·", + "−", + "⊟", + "∸", + "⨪", + "⫛", + "…", + "∓", + "⊧", + "𝕞", + "∓", + "𝓂", + "∾", + "μ", + "⊸", + "⊸", + "⋙̸", + "≫⃒", + "≫̸", + "⇍", + "⇎", + "⋘̸", + "≪⃒", + "≪̸", + "⇏", + "⊯", + "⊮", + "∇", + "ń", + "∠⃒", + "≉", + "⩰̸", + "≋̸", + "ʼn", + "≉", + "♮", + "♮", + "ℕ", + " ", + "≎̸", + "≏̸", + "⩃", + "ň", + "ņ", + "≇", + "⩭̸", + "⩂", + "н", + "–", + "≠", + "⇗", + "⤤", + "↗", + "↗", + "≐̸", + "≢", + "⤨", + "≂̸", + "∄", + "∄", + "𝔫", + "≧̸", + "≱", + "≱", + "≧̸", + "⩾̸", + "⩾̸", + "≵", + "≯", + "≯", + "⇎", + "↮", + "⫲", + "∋", + "⋼", + "⋺", + "∋", + "њ", + "⇍", + "≦̸", + "↚", + "‥", + "≰", + "↚", + "↮", + "≰", + "≦̸", + "⩽̸", + "⩽̸", + "≮", + "≴", + "≮", + "⋪", + "⋬", + "∤", + "𝕟", + "¬", + "∉", + "⋹̸", + "⋵̸", + "∉", + "⋷", + "⋶", + "∌", + "∌", + "⋾", + "⋽", + "∦", + "∦", + "⫽⃥", + "∂̸", + "⨔", + "⊀", + "⋠", + "⪯̸", + "⊀", + "⪯̸", + "⇏", + "↛", + "⤳̸", + "↝̸", + "↛", + "⋫", + "⋭", + "⊁", + "⋡", + "⪰̸", + "𝓃", + "∤", + "∦", + "≁", + "≄", + "≄", + "∤", + "∦", + "⋢", + "⋣", + "⊄", + "⫅̸", + "⊈", + "⊂⃒", + "⊈", + "⫅̸", + "⊁", + "⪰̸", + "⊅", + "⫆̸", + "⊉", + "⊃⃒", + "⊉", + "⫆̸", + "≹", + "ñ", + "≸", + "⋪", + "⋬", + "⋫", + "⋭", + "ν", + "#", + "№", + " ", + "⊭", + "⤄", + "≍⃒", + "⊬", + "≥⃒", + ">⃒", + "⧞", + "⤂", + "≤⃒", + "<⃒", + "⊴⃒", + "⤃", + "⊵⃒", + "∼⃒", + "⇖", + "⤣", + "↖", + "↖", + "⤧", + "Ⓢ", + "ó", + "⊛", + "⊚", + "ô", + "о", + "⊝", + "ő", + "⨸", + "⊙", + "⦼", + "œ", + "⦿", + "𝔬", + "˛", + "ò", + "⧁", + "⦵", + "Ω", + "∮", + "↺", + "⦾", + "⦻", + "‾", + "⧀", + "ō", + "ω", + "ο", + "⦶", + "⊖", + "𝕠", + "⦷", + "⦹", + "⊕", + "∨", + "↻", + "⩝", + "ℴ", + "ℴ", + "ª", + "º", + "⊶", + "⩖", + "⩗", + "⩛", + "ℴ", + "ø", + "⊘", + "õ", + "⊗", + "⨶", + "ö", + "⌽", + "∥", + "¶", + "∥", + "⫳", + "⫽", + "∂", + "п", + "%", + ".", + "‰", + "⊥", + "‱", + "𝔭", + "φ", + "ϕ", + "ℳ", + "☎", + "π", + "⋔", + "ϖ", + "ℏ", + "ℎ", + "ℏ", + "+", + "⨣", + "⊞", + "⨢", + "∔", + "⨥", + "⩲", + "±", + "⨦", + "⨧", + "±", + "⨕", + "𝕡", + "£", + "≺", + "⪳", + "⪷", + "≼", + "⪯", + "≺", + "⪷", + "≼", + "⪯", + "⪹", + "⪵", + "⋨", + "≾", + "′", + "ℙ", + "⪵", + "⪹", + "⋨", + "∏", + "⌮", + "⌒", + "⌓", + "∝", + "∝", + "≾", + "⊰", + "𝓅", + "ψ", + " ", + "𝔮", + "⨌", + "𝕢", + "⁗", + "𝓆", + "ℍ", + "⨖", + "?", + "≟", + """, + "⇛", + "⇒", + "⤜", + "⤏", + "⥤", + "∽̱", + "ŕ", + "√", + "⦳", + "⟩", + "⦒", + "⦥", + "⟩", + "»", + "→", + "⥵", + "⇥", + "⤠", + "⤳", + "⤞", + "↪", + "↬", + "⥅", + "⥴", + "↣", + "↝", + "⤚", + "∶", + "ℚ", + "⤍", + "❳", + "}", + "]", + "⦌", + "⦎", + "⦐", + "ř", + "ŗ", + "⌉", + "}", + "р", + "⤷", + "⥩", + "”", + "”", + "↳", + "ℜ", + "ℛ", + "ℜ", + "ℝ", + "▭", + "®", + "⥽", + "⌋", + "𝔯", + "⇁", + "⇀", + "⥬", + "ρ", + "ϱ", + "→", + "↣", + "⇁", + "⇀", + "⇄", + "⇌", + "⇉", + "↝", + "⋌", + "˚", + "≓", + "⇄", + "⇌", + "‏", + "⎱", + "⎱", + "⫮", + "⟭", + "⇾", + "⟧", + "⦆", + "𝕣", + "⨮", + "⨵", + ")", + "⦔", + "⨒", + "⇉", + "›", + "𝓇", + "↱", + "]", + "’", + "’", + "⋌", + "⋊", + "▹", + "⊵", + "▸", + "⧎", + "⥨", + "℞", + "ś", + "‚", + "≻", + "⪴", + "⪸", + "š", + "≽", + "⪰", + "ş", + "ŝ", + "⪶", + "⪺", + "⋩", + "⨓", + "≿", + "с", + "⋅", + "⊡", + "⩦", + "⇘", + "⤥", + "↘", + "↘", + "§", + ";", + "⤩", + "∖", + "∖", + "✶", + "𝔰", + "⌢", + "♯", + "щ", + "ш", + "∣", + "∥", + "­", + "σ", + "ς", + "ς", + "∼", + "⩪", + "≃", + "≃", + "⪞", + "⪠", + "⪝", + "⪟", + "≆", + "⨤", + "⥲", + "←", + "∖", + "⨳", + "⧤", + "∣", + "⌣", + "⪪", + "⪬", + "⪬︀", + "ь", + "/", + "⧄", + "⌿", + "𝕤", + "♠", + "♠", + "∥", + "⊓", + "⊓︀", + "⊔", + "⊔︀", + "⊏", + "⊑", + "⊏", + "⊑", + "⊐", + "⊒", + "⊐", + "⊒", + "□", + "□", + "▪", + "▪", + "→", + "𝓈", + "∖", + "⌣", + "⋆", + "☆", + "★", + "ϵ", + "ϕ", + "¯", + "⊂", + "⫅", + "⪽", + "⊆", + "⫃", + "⫁", + "⫋", + "⊊", + "⪿", + "⥹", + "⊂", + "⊆", + "⫅", + "⊊", + "⫋", + "⫇", + "⫕", + "⫓", + "≻", + "⪸", + "≽", + "⪰", + "⪺", + "⪶", + "⋩", + "≿", + "∑", + "♪", + "⊃", + "¹", + "²", + "³", + "⫆", + "⪾", + "⫘", + "⊇", + "⫄", + "⟉", + "⫗", + "⥻", + "⫂", + "⫌", + "⊋", + "⫀", + "⊃", + "⊇", + "⫆", + "⊋", + "⫌", + "⫈", + "⫔", + "⫖", + "⇙", + "⤦", + "↙", + "↙", + "⤪", + "ß", + "⌖", + "τ", + "⎴", + "ť", + "ţ", + "т", + "⃛", + "⌕", + "𝔱", + "∴", + "∴", + "θ", + "ϑ", + "ϑ", + "≈", + "∼", + " ", + "≈", + "∼", + "þ", + "˜", + "×", + "⊠", + "⨱", + "⨰", + "∭", + "⤨", + "⊤", + "⌶", + "⫱", + "𝕥", + "⫚", + "⤩", + "‴", + "™", + "▵", + "▿", + "◃", + "⊴", + "≜", + "▹", + "⊵", + "◬", + "≜", + "⨺", + "⨹", + "⧍", + "⨻", + "⏢", + "𝓉", + "ц", + "ћ", + "ŧ", + "≬", + "↞", + "↠", + "⇑", + "⥣", + "ú", + "↑", + "ў", + "ŭ", + "û", + "у", + "⇅", + "ű", + "⥮", + "⥾", + "𝔲", + "ù", + "↿", + "↾", + "▀", + "⌜", + "⌜", + "⌏", + "◸", + "ū", + "¨", + "ų", + "𝕦", + "↑", + "↕", + "↿", + "↾", + "⊎", + "υ", + "ϒ", + "υ", + "⇈", + "⌝", + "⌝", + "⌎", + "ů", + "◹", + "𝓊", + "⋰", + "ũ", + "▵", + "▴", + "⇈", + "ü", + "⦧", + "⇕", + "⫨", + "⫩", + "⊨", + "⦜", + "ϵ", + "ϰ", + "∅", + "ϕ", + "ϖ", + "∝", + "↕", + "ϱ", + "ς", + "⊊︀", + "⫋︀", + "⊋︀", + "⫌︀", + "ϑ", + "⊲", + "⊳", + "в", + "⊢", + "∨", + "⊻", + "≚", + "⋮", + "|", + "|", + "𝔳", + "⊲", + "⊂⃒", + "⊃⃒", + "𝕧", + "∝", + "⊳", + "𝓋", + "⫋︀", + "⊊︀", + "⫌︀", + "⊋︀", + "⦚", + "ŵ", + "⩟", + "∧", + "≙", + "℘", + "𝔴", + "𝕨", + "℘", + "≀", + "≀", + "𝓌", + "⋂", + "◯", + "⋃", + "▽", + "𝔵", + "⟺", + "⟷", + "ξ", + "⟸", + "⟵", + "⟼", + "⋻", + "⨀", + "𝕩", + "⨁", + "⨂", + "⟹", + "⟶", + "𝓍", + "⨆", + "⨄", + "△", + "⋁", + "⋀", + "ý", + "я", + "ŷ", + "ы", + "¥", + "𝔶", + "ї", + "𝕪", + "𝓎", + "ю", + "ÿ", + "ź", + "ž", + "з", + "ż", + "ℨ", + "ζ", + "𝔷", + "ж", + "⇝", + "𝕫", + "𝓏", + "‍", + "‌", ); foreach ($map as $str) { diff --git a/ext/standard/tests/strings/htmlentities-utf-2.phpt b/ext/standard/tests/strings/htmlentities-utf-2.phpt index 3c0b9dde71..1fdd05e271 100644 --- a/ext/standard/tests/strings/htmlentities-utf-2.phpt +++ b/ext/standard/tests/strings/htmlentities-utf-2.phpt @@ -6,15 +6,15 @@ output_handler= <?php @setlocale (LC_CTYPE, "C"); $strings = array("<", "\xD0", "\xD0\x90", "\xD0\x90\xD0", "\xD0\x90\xD0\xB0", "\xE0", "A\xE0", "\xE0\x80", "\xE0\x79", "\xE0\x80\xBE", - "Voil\xE0", "Clich\xE9s", - "\xFE", "\xFE\x41", "\xC3\xA9", "\xC3\x79", "\xF7\xBF\xBF\xBF", "\xFB\xBF\xBF\xBF\xBF", "\xFD\xBF\xBF\xBF\xBF\xBF", - "\x41\xF7\xF7\x42", "\x42\xFB\xFB\x42", "\x43\xFD\xFD\x42", "\x44\xF7\xF7", "\x45\xFB\xFB", "\x46\xFD\xFD" - ); + "Voil\xE0", "Clich\xE9s", + "\xFE", "\xFE\x41", "\xC3\xA9", "\xC3\x79", "\xF7\xBF\xBF\xBF", "\xFB\xBF\xBF\xBF\xBF", "\xFD\xBF\xBF\xBF\xBF\xBF", + "\x41\xF7\xF7\x42", "\x42\xFB\xFB\x42", "\x43\xFD\xFD\x42", "\x44\xF7\xF7", "\x45\xFB\xFB", "\x46\xFD\xFD" + ); foreach($strings as $string) { - $sc_encoded = htmlspecialchars ($string, ENT_QUOTES | ENT_IGNORE, "utf-8"); - var_dump(bin2hex($sc_encoded)); - $ent_encoded = htmlentities ($string, ENT_QUOTES | ENT_IGNORE, "utf-8"); - var_dump(bin2hex($ent_encoded)); + $sc_encoded = htmlspecialchars ($string, ENT_QUOTES | ENT_IGNORE, "utf-8"); + var_dump(bin2hex($sc_encoded)); + $ent_encoded = htmlentities ($string, ENT_QUOTES | ENT_IGNORE, "utf-8"); + var_dump(bin2hex($ent_encoded)); } ?> --EXPECT-- diff --git a/ext/standard/tests/strings/htmlentities-utf-3.phpt b/ext/standard/tests/strings/htmlentities-utf-3.phpt index 82693056ef..56d4cdc2f8 100644 --- a/ext/standard/tests/strings/htmlentities-utf-3.phpt +++ b/ext/standard/tests/strings/htmlentities-utf-3.phpt @@ -6,77 +6,77 @@ Test get_next_char(), used by htmlentities()/htmlspecialchars(): validity of UTF /* conformance to Unicode 5.2, section 3.9, D92 */ $val_ranges = array( - array(array(0x00, 0x7F)), - array(array(0xC2, 0xDF), array(0x80, 0xBF)), - array(array(0xE0, 0xE0), array(0xA0, 0xBF), array(0x80, 0xBF)), - array(array(0xE1, 0xEC), array(0x80, 0xBF), array(0x80, 0xBF)), - array(array(0xED, 0xED), array(0x80, 0x9F), array(0x80, 0xBF)), - array(array(0xEE, 0xEF), array(0x80, 0xBF), array(0x80, 0xBF)), - array(array(0xF0, 0xF0), array(0x90, 0xBF), array(0x80, 0xBF), array(0x80, 0xBF)), - array(array(0xF1, 0xF3), array(0x80, 0xBF), array(0x80, 0xBF), array(0x80, 0xBF)), - array(array(0xF4, 0xF4), array(0x80, 0x8F), array(0x80, 0xBF), array(0x80, 0xBF)), + array(array(0x00, 0x7F)), + array(array(0xC2, 0xDF), array(0x80, 0xBF)), + array(array(0xE0, 0xE0), array(0xA0, 0xBF), array(0x80, 0xBF)), + array(array(0xE1, 0xEC), array(0x80, 0xBF), array(0x80, 0xBF)), + array(array(0xED, 0xED), array(0x80, 0x9F), array(0x80, 0xBF)), + array(array(0xEE, 0xEF), array(0x80, 0xBF), array(0x80, 0xBF)), + array(array(0xF0, 0xF0), array(0x90, 0xBF), array(0x80, 0xBF), array(0x80, 0xBF)), + array(array(0xF1, 0xF3), array(0x80, 0xBF), array(0x80, 0xBF), array(0x80, 0xBF)), + array(array(0xF4, 0xF4), array(0x80, 0x8F), array(0x80, 0xBF), array(0x80, 0xBF)), ); function is_valid($seq) { - global $val_ranges; - $b = ord($seq[0]); - foreach ($val_ranges as $l) { - if ($b >= $l[0][0] && $b <= $l[0][1]) { - if (count($l) != strlen($seq)) { - return false; - } - for ($n = 1; $n < strlen($seq); $n++) { - if (ord($seq[$n]) < $l[$n][0] || ord($seq[$n]) > $l[$n][1]) { - return false; - } - } - return true; - } - } - return false; + global $val_ranges; + $b = ord($seq[0]); + foreach ($val_ranges as $l) { + if ($b >= $l[0][0] && $b <= $l[0][1]) { + if (count($l) != strlen($seq)) { + return false; + } + for ($n = 1; $n < strlen($seq); $n++) { + if (ord($seq[$n]) < $l[$n][0] || ord($seq[$n]) > $l[$n][1]) { + return false; + } + } + return true; + } + } + return false; } function concordance($s) { - $vhe = strlen(htmlspecialchars($s, ENT_QUOTES, "UTF-8")) > 0; - $v = is_valid($s); - return ($vhe === $v); + $vhe = strlen(htmlspecialchars($s, ENT_QUOTES, "UTF-8")) > 0; + $v = is_valid($s); + return ($vhe === $v); } for ($b1 = 0xC0; $b1 < 0xE0; $b1++) { - for ($b2 = 0x80; $b2 < 0xBF; $b2++) { - $s = chr($b1).chr($b2); - if (!concordance($s)) - echo "Discordance for ".bin2hex($s),"\n"; - } + for ($b2 = 0x80; $b2 < 0xBF; $b2++) { + $s = chr($b1).chr($b2); + if (!concordance($s)) + echo "Discordance for ".bin2hex($s),"\n"; + } } for ($b1 = 0xE0; $b1 < 0xEF; $b1++) { - for ($b2 = 0x80; $b2 < 0xBF; $b2++) { - $s = chr($b1).chr($b2)."\x80"; - if (!concordance($s)) - echo "Discordance for ".bin2hex($s),"\n"; - $s = chr($b1).chr($b2)."\xBF"; - if (!concordance($s)) - echo "Discordance for ".bin2hex($s),"\n"; - } + for ($b2 = 0x80; $b2 < 0xBF; $b2++) { + $s = chr($b1).chr($b2)."\x80"; + if (!concordance($s)) + echo "Discordance for ".bin2hex($s),"\n"; + $s = chr($b1).chr($b2)."\xBF"; + if (!concordance($s)) + echo "Discordance for ".bin2hex($s),"\n"; + } } for ($b1 = 0xF0; $b1 < 0xFF; $b1++) { - for ($b2 = 0x80; $b2 < 0xBF; $b2++) { - $s = chr($b1).chr($b2)."\x80\x80"; - if (!concordance($s)) - echo "Discordance for ".bin2hex($s),"\n"; - $s = chr($b1).chr($b2)."\xBF\x80"; - if (!concordance($s)) - echo "Discordance for ".bin2hex($s),"\n"; - $s = chr($b1).chr($b2)."\x80\xBF"; - if (!concordance($s)) - echo "Discordance for ".bin2hex($s),"\n"; - $s = chr($b1).chr($b2)."\xBF\xBF"; - if (!concordance($s)) - echo "Discordance for ".bin2hex($s),"\n"; - } + for ($b2 = 0x80; $b2 < 0xBF; $b2++) { + $s = chr($b1).chr($b2)."\x80\x80"; + if (!concordance($s)) + echo "Discordance for ".bin2hex($s),"\n"; + $s = chr($b1).chr($b2)."\xBF\x80"; + if (!concordance($s)) + echo "Discordance for ".bin2hex($s),"\n"; + $s = chr($b1).chr($b2)."\x80\xBF"; + if (!concordance($s)) + echo "Discordance for ".bin2hex($s),"\n"; + $s = chr($b1).chr($b2)."\xBF\xBF"; + if (!concordance($s)) + echo "Discordance for ".bin2hex($s),"\n"; + } } echo "Done.\n"; --EXPECT-- diff --git a/ext/standard/tests/strings/htmlentities-utf.phpt b/ext/standard/tests/strings/htmlentities-utf.phpt index 215f500c91..5325378593 100644 --- a/ext/standard/tests/strings/htmlentities-utf.phpt +++ b/ext/standard/tests/strings/htmlentities-utf.phpt @@ -6,15 +6,15 @@ output_handler= <?php @setlocale (LC_CTYPE, "C"); $strings = array("<", "\xD0", "\xD0\x90", "\xD0\x90\xD0", "\xD0\x90\xD0\xB0", "\xE0", "A\xE0", "\xE0\x80", "\xE0\x79", "\xE0\x80\xBE", - "Voil\xE0", "Clich\xE9s", - "\xFE", "\xFE\x41", "\xC3\xA9", "\xC3\x79", "\xF7\xBF\xBF\xBF", "\xFB\xBF\xBF\xBF\xBF", "\xFD\xBF\xBF\xBF\xBF\xBF", - "\x41\xF7\xF7\x42", "\x42\xFB\xFB\x42", "\x43\xFD\xFD\x42", "\x44\xF7\xF7", "\x45\xFB\xFB", "\x46\xFD\xFD" - ); + "Voil\xE0", "Clich\xE9s", + "\xFE", "\xFE\x41", "\xC3\xA9", "\xC3\x79", "\xF7\xBF\xBF\xBF", "\xFB\xBF\xBF\xBF\xBF", "\xFD\xBF\xBF\xBF\xBF\xBF", + "\x41\xF7\xF7\x42", "\x42\xFB\xFB\x42", "\x43\xFD\xFD\x42", "\x44\xF7\xF7", "\x45\xFB\xFB", "\x46\xFD\xFD" + ); foreach($strings as $string) { - $sc_encoded = htmlspecialchars ($string, ENT_QUOTES, "utf-8"); - var_dump(bin2hex($sc_encoded)); - $ent_encoded = htmlentities ($string, ENT_QUOTES, "utf-8"); - var_dump(bin2hex($ent_encoded)); + $sc_encoded = htmlspecialchars ($string, ENT_QUOTES, "utf-8"); + var_dump(bin2hex($sc_encoded)); + $ent_encoded = htmlentities ($string, ENT_QUOTES, "utf-8"); + var_dump(bin2hex($ent_encoded)); } ?> --EXPECT-- diff --git a/ext/standard/tests/strings/htmlentities01.phpt b/ext/standard/tests/strings/htmlentities01.phpt index 092027a7a4..269bd467b9 100644 --- a/ext/standard/tests/strings/htmlentities01.phpt +++ b/ext/standard/tests/strings/htmlentities01.phpt @@ -5,8 +5,8 @@ output_handler= internal_encoding=pass --FILE-- <?php - var_dump(htmlentities("\x82\x86\x99\x9f", ENT_QUOTES, 'cp1252')); - var_dump(htmlentities("\x80\xa2\xa3\xa4\xa5", ENT_QUOTES, 'cp1252')); + var_dump(htmlentities("\x82\x86\x99\x9f", ENT_QUOTES, 'cp1252')); + var_dump(htmlentities("\x80\xa2\xa3\xa4\xa5", ENT_QUOTES, 'cp1252')); ?> --EXPECT-- string(28) "‚†™Ÿ" diff --git a/ext/standard/tests/strings/htmlentities02.phpt b/ext/standard/tests/strings/htmlentities02.phpt index ad75766ee6..6dcc4de483 100644 --- a/ext/standard/tests/strings/htmlentities02.phpt +++ b/ext/standard/tests/strings/htmlentities02.phpt @@ -13,8 +13,8 @@ default_charset= internal_encoding=pass --FILE-- <?php - setlocale(LC_CTYPE, "fr_FR.ISO-8859-15", "fr_FR.ISO8859-15", 'fr_FR@euro'); - var_dump(htmlentities("\xbc\xbd\xbe", ENT_QUOTES, '')); + setlocale(LC_CTYPE, "fr_FR.ISO-8859-15", "fr_FR.ISO8859-15", 'fr_FR@euro'); + var_dump(htmlentities("\xbc\xbd\xbe", ENT_QUOTES, '')); ?> --EXPECT-- string(20) "ŒœŸ" diff --git a/ext/standard/tests/strings/htmlentities03.phpt b/ext/standard/tests/strings/htmlentities03.phpt index 6b00e8b48c..b7e07fb375 100644 --- a/ext/standard/tests/strings/htmlentities03.phpt +++ b/ext/standard/tests/strings/htmlentities03.phpt @@ -13,8 +13,8 @@ default_charset= internal_encoding=pass --FILE-- <?php - setlocale( LC_CTYPE, "de_DE.ISO-8859-1", "de_DE.ISO8859-1"); - var_dump(htmlentities("\xe4\xf6\xfc", ENT_QUOTES, '')); + setlocale( LC_CTYPE, "de_DE.ISO-8859-1", "de_DE.ISO8859-1"); + var_dump(htmlentities("\xe4\xf6\xfc", ENT_QUOTES, '')); ?> --EXPECT-- string(18) "äöü" diff --git a/ext/standard/tests/strings/htmlentities04.phpt b/ext/standard/tests/strings/htmlentities04.phpt index 33f38682da..7e47d8d4fc 100644 --- a/ext/standard/tests/strings/htmlentities04.phpt +++ b/ext/standard/tests/strings/htmlentities04.phpt @@ -13,8 +13,8 @@ default_charset= internal_encoding=pass --FILE-- <?php - setlocale( LC_CTYPE, "ja_JP.EUC-JP", "ja_JP.eucJP" ); - var_dump(htmlentities("\xa1\xa2\xa1\xa3\xa1\xa4", ENT_QUOTES, '')); + setlocale( LC_CTYPE, "ja_JP.EUC-JP", "ja_JP.eucJP" ); + var_dump(htmlentities("\xa1\xa2\xa1\xa3\xa1\xa4", ENT_QUOTES, '')); ?> --EXPECTF-- Notice: htmlentities(): Only basic entities substitution is supported for multi-byte encodings other than UTF-8; functionality is equivalent to htmlspecialchars in %s line %d diff --git a/ext/standard/tests/strings/htmlentities05.phpt b/ext/standard/tests/strings/htmlentities05.phpt index f65a1a435a..04bf4deb00 100644 --- a/ext/standard/tests/strings/htmlentities05.phpt +++ b/ext/standard/tests/strings/htmlentities05.phpt @@ -8,9 +8,9 @@ internal_encoding=cp1252 extension_loaded("mbstring") or die("skip mbstring not available\n"); --FILE-- <?php - print mb_internal_encoding()."\n"; - var_dump(htmlentities("\x82\x86\x99\x9f", ENT_QUOTES, '')); - var_dump(htmlentities("\x80\xa2\xa3\xa4\xa5", ENT_QUOTES, '')); + print mb_internal_encoding()."\n"; + var_dump(htmlentities("\x82\x86\x99\x9f", ENT_QUOTES, '')); + var_dump(htmlentities("\x80\xa2\xa3\xa4\xa5", ENT_QUOTES, '')); ?> --EXPECT-- Windows-1252 diff --git a/ext/standard/tests/strings/htmlentities06.phpt b/ext/standard/tests/strings/htmlentities06.phpt index 5027c0c193..487b5d33ff 100644 --- a/ext/standard/tests/strings/htmlentities06.phpt +++ b/ext/standard/tests/strings/htmlentities06.phpt @@ -8,9 +8,9 @@ internal_encoding=ISO-8859-15 extension_loaded("mbstring") or die("skip mbstring not available\n"); --FILE-- <?php - mb_internal_encoding('ISO-8859-15'); - print mb_internal_encoding()."\n"; - var_dump(htmlentities("\xbc\xbd\xbe", ENT_QUOTES, '')); + mb_internal_encoding('ISO-8859-15'); + print mb_internal_encoding()."\n"; + var_dump(htmlentities("\xbc\xbd\xbe", ENT_QUOTES, '')); ?> --EXPECT-- ISO-8859-15 diff --git a/ext/standard/tests/strings/htmlentities07.phpt b/ext/standard/tests/strings/htmlentities07.phpt index fe43d32d49..04e138e0c7 100644 --- a/ext/standard/tests/strings/htmlentities07.phpt +++ b/ext/standard/tests/strings/htmlentities07.phpt @@ -8,9 +8,9 @@ internal_encoding=ISO-8859-1 extension_loaded("mbstring") or die("skip mbstring not available\n"); --FILE-- <?php - mb_internal_encoding('ISO-8859-1'); - print mb_internal_encoding()."\n"; - var_dump(htmlentities("\xe4\xf6\xfc", ENT_QUOTES, '')); + mb_internal_encoding('ISO-8859-1'); + print mb_internal_encoding()."\n"; + var_dump(htmlentities("\xe4\xf6\xfc", ENT_QUOTES, '')); ?> --EXPECT-- ISO-8859-1 diff --git a/ext/standard/tests/strings/htmlentities08.phpt b/ext/standard/tests/strings/htmlentities08.phpt index b44796ec80..fdba4ede80 100644 --- a/ext/standard/tests/strings/htmlentities08.phpt +++ b/ext/standard/tests/strings/htmlentities08.phpt @@ -8,9 +8,9 @@ internal_encoding=EUC-JP extension_loaded("mbstring") or die("skip mbstring not available\n"); --FILE-- <?php - mb_internal_encoding('EUC-JP'); - print mb_internal_encoding()."\n"; - var_dump(htmlentities("\xa1\xa2\xa1\xa3\xa1\xa4", ENT_QUOTES, '')); + mb_internal_encoding('EUC-JP'); + print mb_internal_encoding()."\n"; + var_dump(htmlentities("\xa1\xa2\xa1\xa3\xa1\xa4", ENT_QUOTES, '')); ?> --EXPECTF-- EUC-JP diff --git a/ext/standard/tests/strings/htmlentities09.phpt b/ext/standard/tests/strings/htmlentities09.phpt index 11493b62a4..6ca0a1e39e 100644 --- a/ext/standard/tests/strings/htmlentities09.phpt +++ b/ext/standard/tests/strings/htmlentities09.phpt @@ -8,9 +8,9 @@ internal_encoding=Shift_JIS extension_loaded("mbstring") or die("skip mbstring not available\n"); --FILE-- <?php - mb_internal_encoding('Shift_JIS'); - print mb_internal_encoding()."\n"; - var_dump(bin2hex(htmlentities("\x81\x41\x81\x42\x81\x43", ENT_QUOTES, ''))); + mb_internal_encoding('Shift_JIS'); + print mb_internal_encoding()."\n"; + var_dump(bin2hex(htmlentities("\x81\x41\x81\x42\x81\x43", ENT_QUOTES, ''))); ?> --EXPECTF-- SJIS diff --git a/ext/standard/tests/strings/htmlentities10.phpt b/ext/standard/tests/strings/htmlentities10.phpt index 5f6d8ffc57..2f8c42b7e5 100644 --- a/ext/standard/tests/strings/htmlentities10.phpt +++ b/ext/standard/tests/strings/htmlentities10.phpt @@ -6,9 +6,9 @@ internal_encoding=pass default_charset=cp1252 --FILE-- <?php - print ini_get('default_charset')."\n"; - var_dump(htmlentities("\x82\x86\x99\x9f", ENT_QUOTES, '')); - var_dump(htmlentities("\x80\xa2\xa3\xa4\xa5", ENT_QUOTES, '')); + print ini_get('default_charset')."\n"; + var_dump(htmlentities("\x82\x86\x99\x9f", ENT_QUOTES, '')); + var_dump(htmlentities("\x80\xa2\xa3\xa4\xa5", ENT_QUOTES, '')); ?> --EXPECT-- cp1252 diff --git a/ext/standard/tests/strings/htmlentities11.phpt b/ext/standard/tests/strings/htmlentities11.phpt index 0ee1044c13..c803f76a53 100644 --- a/ext/standard/tests/strings/htmlentities11.phpt +++ b/ext/standard/tests/strings/htmlentities11.phpt @@ -6,8 +6,8 @@ internal_encoding=pass default_charset=ISO-8859-15 --FILE-- <?php - print ini_get('default_charset')."\n"; - var_dump(htmlentities("\xbc\xbd\xbe", ENT_QUOTES, '')); + print ini_get('default_charset')."\n"; + var_dump(htmlentities("\xbc\xbd\xbe", ENT_QUOTES, '')); ?> --EXPECT-- ISO-8859-15 diff --git a/ext/standard/tests/strings/htmlentities12.phpt b/ext/standard/tests/strings/htmlentities12.phpt index c3cb7b6440..c2963f1c86 100644 --- a/ext/standard/tests/strings/htmlentities12.phpt +++ b/ext/standard/tests/strings/htmlentities12.phpt @@ -6,8 +6,8 @@ internal_encoding=pass default_charset=ISO-8859-1 --FILE-- <?php - print ini_get('default_charset')."\n"; - var_dump(htmlentities("\xe4\xf6\xfc", ENT_QUOTES, '')); + print ini_get('default_charset')."\n"; + var_dump(htmlentities("\xe4\xf6\xfc", ENT_QUOTES, '')); ?> --EXPECT-- ISO-8859-1 diff --git a/ext/standard/tests/strings/htmlentities13.phpt b/ext/standard/tests/strings/htmlentities13.phpt index bdea7a30ee..ac2c8cd4b0 100644 --- a/ext/standard/tests/strings/htmlentities13.phpt +++ b/ext/standard/tests/strings/htmlentities13.phpt @@ -7,8 +7,8 @@ default_charset=EUC-JP filter.default=unsafe_raw --FILE-- <?php - print ini_get('default_charset')."\n"; - var_dump(htmlentities("\xa1\xa2\xa1\xa3\xa1\xa4", ENT_QUOTES, '')); + print ini_get('default_charset')."\n"; + var_dump(htmlentities("\xa1\xa2\xa1\xa3\xa1\xa4", ENT_QUOTES, '')); ?> --EXPECTF-- EUC-JP diff --git a/ext/standard/tests/strings/htmlentities14.phpt b/ext/standard/tests/strings/htmlentities14.phpt index e39a003726..60226cbe10 100644 --- a/ext/standard/tests/strings/htmlentities14.phpt +++ b/ext/standard/tests/strings/htmlentities14.phpt @@ -7,8 +7,8 @@ default_charset=Shift_JIS filter.default=unsafe_raw --FILE-- <?php - print ini_get('default_charset')."\n"; - var_dump(htmlentities("\x81\x41\x81\x42\x81\x43", ENT_QUOTES, '')); + print ini_get('default_charset')."\n"; + var_dump(htmlentities("\x81\x41\x81\x42\x81\x43", ENT_QUOTES, '')); ?> --EXPECTF-- Shift_JIS diff --git a/ext/standard/tests/strings/htmlentities17.phpt b/ext/standard/tests/strings/htmlentities17.phpt index d9e67a9b87..5e29de5d8e 100644 --- a/ext/standard/tests/strings/htmlentities17.phpt +++ b/ext/standard/tests/strings/htmlentities17.phpt @@ -3,25 +3,25 @@ htmlentities() / html_entity_decode() #8592 - #9002 table test --FILE-- <?php $tests = array( - array(8853, '⊕', "e28a95"), - array(8855, '⊗', "e28a97"), - array(8869, '⊥', "e28aa5"), - array(8901, '⋅', "e28b85"), - array(8968, '⌈', "e28c88"), - array(8969, '⌉', "e28c89"), - array(8970, '⌊', "e28c8a"), - array(8971, '⌋', "e28c8b"), - array(9001, '⟨', "e28ca9"), - array(9002, '⟩', "e28caa") + array(8853, '⊕', "e28a95"), + array(8855, '⊗', "e28a97"), + array(8869, '⊥', "e28aa5"), + array(8901, '⋅', "e28b85"), + array(8968, '⌈', "e28c88"), + array(8969, '⌉', "e28c89"), + array(8970, '⌊', "e28c8a"), + array(8971, '⌋', "e28c8b"), + array(9001, '⟨', "e28ca9"), + array(9002, '⟩', "e28caa") ); foreach ($tests as $test) { - var_dump(htmlentities(pack('H*', $test[2]), ENT_QUOTES, 'UTF-8')); + var_dump(htmlentities(pack('H*', $test[2]), ENT_QUOTES, 'UTF-8')); } foreach ($tests as $test) { - list(,$result) = unpack('H6', html_entity_decode($test[1], ENT_QUOTES, 'UTF-8')); - var_dump($result); + list(,$result) = unpack('H6', html_entity_decode($test[1], ENT_QUOTES, 'UTF-8')); + var_dump($result); } ?> --EXPECT-- diff --git a/ext/standard/tests/strings/htmlentities18.phpt b/ext/standard/tests/strings/htmlentities18.phpt index d7bd2302c1..d9582e7dbc 100644 --- a/ext/standard/tests/strings/htmlentities18.phpt +++ b/ext/standard/tests/strings/htmlentities18.phpt @@ -3,21 +3,21 @@ htmlentities() / htmlspecialchars() "don't double encode" flag support --FILE-- <?php $tests = array( - "abc", - "abc&sfdsa", - "test+s & some more D", - "test+s & some more D", - "&; & &#a; &9; &#xyz;", - "&kffjadfdhsjfhjasdhffasdfas;", - "�", - "&", - "&&&", - "&ab&&", + "abc", + "abc&sfdsa", + "test+s & some more D", + "test+s & some more D", + "&; & &#a; &9; &#xyz;", + "&kffjadfdhsjfhjasdhffasdfas;", + "�", + "&", + "&&&", + "&ab&&", ); foreach ($tests as $test) { - var_dump(htmlentities($test, ENT_QUOTES, NULL, FALSE)); - var_dump(htmlspecialchars($test, ENT_QUOTES, NULL, FALSE)); + var_dump(htmlentities($test, ENT_QUOTES, NULL, FALSE)); + var_dump(htmlspecialchars($test, ENT_QUOTES, NULL, FALSE)); } ?> --EXPECT-- diff --git a/ext/standard/tests/strings/htmlentities19.phpt b/ext/standard/tests/strings/htmlentities19.phpt index a90358c613..bc607ad240 100644 --- a/ext/standard/tests/strings/htmlentities19.phpt +++ b/ext/standard/tests/strings/htmlentities19.phpt @@ -3,16 +3,16 @@ htmlentities() / htmlspecialchars() ENT_SUBSTITUTE --FILE-- <?php $tests = array( - "\x41\xC2\x3E\x42", // Unicode TR #36, 3.1.1; do not consume valid successor bytes - "\xE3\x80\x22", // Unicode TR #36, 3.6.1; use strategy #2 + "\x41\xC2\x3E\x42", // Unicode TR #36, 3.1.1; do not consume valid successor bytes + "\xE3\x80\x22", // Unicode TR #36, 3.6.1; use strategy #2 "\x41\x98\xBA\x42\xE2\x98\x43\xE2\x98\xBA\xE2\x98", // example from HTML5, section 2.4 ); foreach ($tests as $test) { $a = htmlentities($test, ENT_QUOTES | ENT_SUBSTITUTE, "UTF-8"); - var_dump($a, bin2hex($a)); + var_dump($a, bin2hex($a)); $a = htmlspecialchars($test, ENT_QUOTES | ENT_SUBSTITUTE, "UTF-8"); - var_dump($a, bin2hex($a)); + var_dump($a, bin2hex($a)); } ?> --EXPECT-- diff --git a/ext/standard/tests/strings/htmlentities20.phpt b/ext/standard/tests/strings/htmlentities20.phpt index ff52aca07a..956ecfc1b9 100644 --- a/ext/standard/tests/strings/htmlentities20.phpt +++ b/ext/standard/tests/strings/htmlentities20.phpt @@ -3,25 +3,25 @@ htmlentities() / htmlspecialchars() ENT_DISALLOWED --FILE-- <?php function codepoint_to_utf8($k) { - if ($k < 0x80) { - $retval = pack('C', $k); - } else if ($k < 0x800) { - $retval = pack('C2', + if ($k < 0x80) { + $retval = pack('C', $k); + } else if ($k < 0x800) { + $retval = pack('C2', 0xc0 | ($k >> 6), 0x80 | ($k & 0x3f)); - } else if ($k < 0x10000) { + } else if ($k < 0x10000) { $retval = pack('C3', 0xe0 | ($k >> 12), 0x80 | (($k >> 6) & 0x3f), 0x80 | ($k & 0x3f)); - } else { + } else { $retval = pack('C4', 0xf0 | ($k >> 18), 0x80 | (($k >> 12) & 0x3f), 0x80 | (($k >> 6) & 0x3f), 0x80 | ($k & 0x3f)); - } - return $retval; + } + return $retval; } $tests = array( diff --git a/ext/standard/tests/strings/htmlentities23.phpt b/ext/standard/tests/strings/htmlentities23.phpt index 68e6e9439e..3b33e382e5 100644 --- a/ext/standard/tests/strings/htmlentities23.phpt +++ b/ext/standard/tests/strings/htmlentities23.phpt @@ -20,9 +20,9 @@ $tests = array( foreach ($tests as $test) { $a = htmlentities($test, ENT_QUOTES | ENT_SUBSTITUTE, "EUC-JP"); - var_dump($a, bin2hex($a)); + var_dump($a, bin2hex($a)); $a = htmlspecialchars($test, ENT_QUOTES | ENT_SUBSTITUTE, "EUC-JP"); - var_dump($a, bin2hex($a)); + var_dump($a, bin2hex($a)); echo "\n"; } ?> diff --git a/ext/standard/tests/strings/htmlentities_html4.phpt b/ext/standard/tests/strings/htmlentities_html4.phpt index 5d784c2af5..8e23fbaeca 100644 --- a/ext/standard/tests/strings/htmlentities_html4.phpt +++ b/ext/standard/tests/strings/htmlentities_html4.phpt @@ -3,31 +3,31 @@ htmlentities() conformance check (HTML 4) --FILE-- <?php function utf32_utf8($k) { - if ($k < 0x80) { - $retval = pack('C', $k); - } else if ($k < 0x800) { - $retval = pack('C2', + if ($k < 0x80) { + $retval = pack('C', $k); + } else if ($k < 0x800) { + $retval = pack('C2', 0xc0 | ($k >> 6), 0x80 | ($k & 0x3f)); - } else if ($k < 0x10000) { + } else if ($k < 0x10000) { $retval = pack('C3', 0xe0 | ($k >> 12), 0x80 | (($k >> 6) & 0x3f), 0x80 | ($k & 0x3f)); - } else if ($k < 0x200000) { + } else if ($k < 0x200000) { $retval = pack('C4', 0xf0 | ($k >> 18), 0x80 | (($k >> 12) & 0x3f), 0x80 | (($k >> 6) & 0x3f), 0x80 | ($k & 0x3f)); - } else if ($k < 0x4000000) { + } else if ($k < 0x4000000) { $retval = pack('C5', 0xf8 | ($k >> 24), 0x80 | (($k >> 18) & 0x3f), 0x80 | (($k >> 12) & 0x3f), 0x80 | (($k >> 6) & 0x3f), 0x80 | ($k & 0x3f)); - } else { + } else { $retval = pack('C6', 0xfc | ($k >> 30), 0x80 | (($k >> 24) & 0x3f), @@ -35,8 +35,8 @@ function utf32_utf8($k) { 0x80 | (($k >> 12) & 0x3f), 0x80 | (($k >> 6) & 0x3f), 0x80 | ($k & 0x3f)); - } - return $retval; + } + return $retval; } $table = get_html_translation_table(HTML_ENTITIES, ENT_QUOTES, 'UTF-8'); @@ -45,15 +45,15 @@ for ($i = 0; $i < 0x2710; $i++) { if ($i >= 0xd800 && $i < 0xe000) continue; $str = utf32_utf8($i); - if (isset($table[$str])) { - printf("%s\tU+%05X\n", $table[$str], $i); - unset($table[$str]); - } + if (isset($table[$str])) { + printf("%s\tU+%05X\n", $table[$str], $i); + unset($table[$str]); + } } if (!empty($table)) { - echo "Not matched entities: "; - var_dump($table); + echo "Not matched entities: "; + var_dump($table); } ?> diff --git a/ext/standard/tests/strings/htmlentities_html5.phpt b/ext/standard/tests/strings/htmlentities_html5.phpt index 4a91012bd7..d3e94d5dba 100644 --- a/ext/standard/tests/strings/htmlentities_html5.phpt +++ b/ext/standard/tests/strings/htmlentities_html5.phpt @@ -3,25 +3,25 @@ htmlentities() conformance check (HTML 5) --FILE-- <?php function utf32_utf8($k) { - if ($k < 0x80) { - $retval = pack('C', $k); - } else if ($k < 0x800) { - $retval = pack('C2', + if ($k < 0x80) { + $retval = pack('C', $k); + } else if ($k < 0x800) { + $retval = pack('C2', 0xc0 | ($k >> 6), 0x80 | ($k & 0x3f)); - } else if ($k < 0x10000) { + } else if ($k < 0x10000) { $retval = pack('C3', 0xe0 | ($k >> 12), 0x80 | (($k >> 6) & 0x3f), 0x80 | ($k & 0x3f)); - } else { + } else { $retval = pack('C4', 0xf0 | ($k >> 18), 0x80 | (($k >> 12) & 0x3f), 0x80 | (($k >> 6) & 0x3f), 0x80 | ($k & 0x3f)); - } - return $retval; + } + return $retval; } for ($i = 0; $i < 0x1DFFF; $i++) { diff --git a/ext/standard/tests/strings/htmlspecialchars_decode_variation6.phpt b/ext/standard/tests/strings/htmlspecialchars_decode_variation6.phpt Binary files differindex 596a883be2..8a6100ac45 100644 --- a/ext/standard/tests/strings/htmlspecialchars_decode_variation6.phpt +++ b/ext/standard/tests/strings/htmlspecialchars_decode_variation6.phpt diff --git a/ext/standard/tests/strings/lcfirst.phpt b/ext/standard/tests/strings/lcfirst.phpt Binary files differindex ed25d329b2..5f754d7b2b 100644 --- a/ext/standard/tests/strings/lcfirst.phpt +++ b/ext/standard/tests/strings/lcfirst.phpt diff --git a/ext/standard/tests/strings/md5_basic2.phpt b/ext/standard/tests/strings/md5_basic2.phpt index f302753cd3..0e2db58e95 100644 --- a/ext/standard/tests/strings/md5_basic2.phpt +++ b/ext/standard/tests/strings/md5_basic2.phpt @@ -15,10 +15,10 @@ var_dump(bin2hex($md5_raw)); $md5 = md5($str, false); if (strcmp(bin2hex($md5_raw), $md5) == 0 ) { - echo "TEST PASSED\n"; + echo "TEST PASSED\n"; } else { - echo "TEST FAILED\n"; - var_dump($md5_raw, $md5); + echo "TEST FAILED\n"; + var_dump($md5_raw, $md5); } ?> diff --git a/ext/standard/tests/strings/metaphone.phpt b/ext/standard/tests/strings/metaphone.phpt index c70b4846a1..2bc16b3248 100644 --- a/ext/standard/tests/strings/metaphone.phpt +++ b/ext/standard/tests/strings/metaphone.phpt @@ -19,7 +19,7 @@ $array = array( ); foreach($array as $str) { - var_dump(metaphone($str)); + var_dump(metaphone($str)); } echo "Done\n"; diff --git a/ext/standard/tests/strings/nl2br.phpt b/ext/standard/tests/strings/nl2br.phpt index 728f3339a0..b2ff9cf090 100644 --- a/ext/standard/tests/strings/nl2br.phpt +++ b/ext/standard/tests/strings/nl2br.phpt @@ -2,17 +2,17 @@ nl2br() function --FILE-- <?php - var_dump(nl2br("test")); - var_dump(nl2br("")); - var_dump(nl2br(NULL)); - var_dump(nl2br("\r\n")); - var_dump(nl2br("\n")); - var_dump(nl2br("\r")); - var_dump(nl2br("\n\r")); + var_dump(nl2br("test")); + var_dump(nl2br("")); + var_dump(nl2br(NULL)); + var_dump(nl2br("\r\n")); + var_dump(nl2br("\n")); + var_dump(nl2br("\r")); + var_dump(nl2br("\n\r")); - var_dump(nl2br("\n\r\r\n\r\r\r\r")); - var_dump(nl2br("\n\r\n\n\r\n\r\r\n\r\n")); - var_dump(nl2br("\n\r\n\n\n\n\r\r\r\r\n\r")); + var_dump(nl2br("\n\r\r\n\r\r\r\r")); + var_dump(nl2br("\n\r\n\n\r\n\r\r\n\r\n")); + var_dump(nl2br("\n\r\n\n\n\n\r\r\r\r\n\r")); ?> --EXPECT-- diff --git a/ext/standard/tests/strings/number_format_basic.phpt b/ext/standard/tests/strings/number_format_basic.phpt index 4eb4d51086..f06a55cb63 100644 --- a/ext/standard/tests/strings/number_format_basic.phpt +++ b/ext/standard/tests/strings/number_format_basic.phpt @@ -11,40 +11,40 @@ Test number_format() - basic function test number_format() echo "*** Testing number_format() : basic functionality ***\n"; $values = array(1234.5678, - -1234.5678, - 1234.6578e4, - -1234.56789e4, - 0x1234CDEF, - 02777777777, - "123456789", - "123.456789", - "12.3456789e1", - null, - true, - false); + -1234.5678, + 1234.6578e4, + -1234.56789e4, + 0x1234CDEF, + 02777777777, + "123456789", + "123.456789", + "12.3456789e1", + null, + true, + false); echo "\n-- number_format tests.....default --\n"; for ($i = 0; $i < count($values); $i++) { - $res = number_format($values[$i]); - var_dump($res); + $res = number_format($values[$i]); + var_dump($res); } echo "\n-- number_format tests.....with two dp --\n"; for ($i = 0; $i < count($values); $i++) { - $res = number_format($values[$i], 2); - var_dump($res); + $res = number_format($values[$i], 2); + var_dump($res); } echo "\n-- number_format tests.....English format --\n"; for ($i = 0; $i < count($values); $i++) { - $res = number_format($values[$i], 2, '.', ' '); - var_dump($res); + $res = number_format($values[$i], 2, '.', ' '); + var_dump($res); } echo "\n-- number_format tests.....French format --\n"; for ($i = 0; $i < count($values); $i++) { - $res = number_format($values[$i], 2, ',' , ' '); - var_dump($res); + $res = number_format($values[$i], 2, ',' , ' '); + var_dump($res); } ?> --EXPECT-- diff --git a/ext/standard/tests/strings/ord_basic.phpt b/ext/standard/tests/strings/ord_basic.phpt index a7c93fc6d3..c7d6891a09 100644 --- a/ext/standard/tests/strings/ord_basic.phpt +++ b/ext/standard/tests/strings/ord_basic.phpt @@ -24,9 +24,9 @@ var_dump(ord("Hello")); // Make sure all valid ascii chars round trip for ($i = 0; $i < 255; $i++) { - if (ord(chr($i)) != $i) { - exit("TEST FAILED: $i does not round trip\n"); - } + if (ord(chr($i)) != $i) { + exit("TEST FAILED: $i does not round trip\n"); + } } ?> diff --git a/ext/standard/tests/strings/pack_A.phpt b/ext/standard/tests/strings/pack_A.phpt index b5a7b97fc3..abc12ac1b1 100644 --- a/ext/standard/tests/strings/pack_A.phpt +++ b/ext/standard/tests/strings/pack_A.phpt @@ -3,11 +3,11 @@ pack()/unpack(): "A" modifier --FILE-- <?php var_dump( - pack("A5", "foo "), - pack("A4", "fooo"), - pack("A4", "foo"), - unpack("A*", "foo\0\rbar\0 \t\r\n"), - unpack("A4", "foo\0\rbar\0 \t\r\n") + pack("A5", "foo "), + pack("A4", "fooo"), + pack("A4", "foo"), + unpack("A*", "foo\0\rbar\0 \t\r\n"), + unpack("A4", "foo\0\rbar\0 \t\r\n") ); ?> --EXPECTF-- diff --git a/ext/standard/tests/strings/pack_Z.phpt b/ext/standard/tests/strings/pack_Z.phpt index 4fd007ae0f..5a7c5d95a6 100644 --- a/ext/standard/tests/strings/pack_Z.phpt +++ b/ext/standard/tests/strings/pack_Z.phpt @@ -3,11 +3,11 @@ pack()/unpack(): "Z" format --FILE-- <?php var_dump( - pack("Z0", "f"), + pack("Z0", "f"), pack("Z5", "foo\0"), pack("Z4", "fooo"), pack("Z4", "foo"), - pack("Z*", "foo"), + pack("Z*", "foo"), unpack("Z*", "foo\0\rbar\0 \t\r\n"), unpack("Z9", "foo\0\rbar\0 \t\r\n"), unpack("Z2", "\0"), diff --git a/ext/standard/tests/strings/php_strip_whitespace.phpt b/ext/standard/tests/strings/php_strip_whitespace.phpt index cdc599fc91..9f22daa9eb 100644 --- a/ext/standard/tests/strings/php_strip_whitespace.phpt +++ b/ext/standard/tests/strings/php_strip_whitespace.phpt @@ -19,15 +19,15 @@ $data = '<?php /* test class */ class test { - /* function foo () */ + /* function foo () */ - function foo () /* {{{ */ - { + function foo () /* {{{ */ + { - echo $var; //does not exist - } - /* }}} */ + echo $var; //does not exist + } + /* }}} */ } ?>'; diff --git a/ext/standard/tests/strings/print_variation1.phpt b/ext/standard/tests/strings/print_variation1.phpt index f06b83ee8f..e5849ecfdf 100644 --- a/ext/standard/tests/strings/print_variation1.phpt +++ b/ext/standard/tests/strings/print_variation1.phpt @@ -28,43 +28,43 @@ $file_handle = fopen(__FILE__, "r"); // array with different values for $input $inputs = array ( - // integer values + // integer values /*1*/ 0, - 1, - -2, - 2147483647, - -2147483648, + 1, + -2, + 2147483647, + -2147483648, - // float values + // float values /*6*/ 10.5, - -20.5, - 10.1234567e10, + -20.5, + 10.1234567e10, - // array values + // array values /*9*/ array(), - array(0), - array(1, 2), + array(0), + array(1, 2), - // boolean values + // boolean values /*12*/ true, - false, - TRUE, - FALSE, + false, + TRUE, + FALSE, - // null values + // null values /*16*/ NULL, - null, + null, - // objects + // objects /*18*/ new sample(), - // resource + // resource /*19*/ $file_handle, - // undefined variable + // undefined variable /*20*/ @$undefined_var, - // unset variable + // unset variable /*21*/ @$unset_var ); diff --git a/ext/standard/tests/strings/printf_variation1.phpt b/ext/standard/tests/strings/printf_variation1.phpt index 4ec032f9ce..d6fad7e97a 100644 --- a/ext/standard/tests/strings/printf_variation1.phpt +++ b/ext/standard/tests/strings/printf_variation1.phpt @@ -35,50 +35,50 @@ $file_handle = fopen(__FILE__, 'r'); //array of values to iterate over $values = array( - // int data + // int data /*1*/ 0, - 1, - 12345, - -2345, + 1, + 12345, + -2345, - // float data + // float data /*5*/ 10.5, - -10.5, - 10.1234567e10, - 10.7654321E-10, - .5, + -10.5, + 10.1234567e10, + 10.7654321E-10, + .5, - // array data + // array data /*10*/ array(), - array(0), - array(1), - array(1, 2), - array('color' => 'red', 'item' => 'pen'), + array(0), + array(1), + array(1, 2), + array('color' => 'red', 'item' => 'pen'), - // null data + // null data /*15*/ NULL, - null, + null, - // boolean data + // boolean data /*17*/ true, - false, - TRUE, - FALSE, + false, + TRUE, + FALSE, - // empty data + // empty data /*21*/ "", - '', + '', - // object data + // object data /*23*/ new sample(), - // undefined data + // undefined data /*24*/ @$undefined_var, - // unset data + // unset data /*25*/ @$unset_var, - // resource data + // resource data /*26*/ $file_handle ); diff --git a/ext/standard/tests/strings/printf_variation2.phpt b/ext/standard/tests/strings/printf_variation2.phpt index 3c3d92cbe3..d0335b455e 100644 --- a/ext/standard/tests/strings/printf_variation2.phpt +++ b/ext/standard/tests/strings/printf_variation2.phpt @@ -31,54 +31,54 @@ $file_handle = fopen(__FILE__, 'r'); //array of values to iterate over $values = array( - // int data + // int data /*1*/ 0, - 1, - 12345, - -2345, + 1, + 12345, + -2345, - // float data + // float data /*5*/ 10.5, - -10.5, - 10.1234567e10, - 10.7654321E-10, - .5, + -10.5, + 10.1234567e10, + 10.7654321E-10, + .5, - // array data + // array data /*10*/ array(), - array(0), - array(1), - array(1, 2), - array('color' => 'red', 'item' => 'pen'), + array(0), + array(1), + array(1, 2), + array('color' => 'red', 'item' => 'pen'), - // null data + // null data /*15*/ NULL, - null, + null, - // boolean data + // boolean data /*17*/ true, - false, - TRUE, - FALSE, + false, + TRUE, + FALSE, - // empty data + // empty data /*21*/ "", - '', + '', - // string data + // string data /*23*/ "string", - 'string', + 'string', - // object data + // object data /*25*/ new sample(), - // undefined data + // undefined data /*26*/ @$undefined_var, - // unset data + // unset data /*27*/ @$unset_var, - // resource data + // resource data /*28*/ $file_handle ); diff --git a/ext/standard/tests/strings/quoted_printable_decode_basic.phpt b/ext/standard/tests/strings/quoted_printable_decode_basic.phpt index 09bcd343d0..b40080cdf3 100644 --- a/ext/standard/tests/strings/quoted_printable_decode_basic.phpt +++ b/ext/standard/tests/strings/quoted_printable_decode_basic.phpt @@ -9,9 +9,9 @@ Test quoted_printable_decode() function : basic functionality echo "*** Testing quoted_printable_decode() : basic functionality ***\n"; -$str = "=FAwow-factor=C1=d0=D5=DD=C5=CE=CE=D9=C5=0A= -=20=D4=cf=D2=C7=CF=D7=D9=C5= -=20= +$str = "=FAwow-factor=C1=d0=D5=DD=C5=CE=CE=D9=C5=0A= +=20=D4=cf=D2=C7=CF=D7=D9=C5= +=20= =D0= =D2=CF=C5=CB=D4=D9"; diff --git a/ext/standard/tests/strings/quoted_printable_encode_002.phpt b/ext/standard/tests/strings/quoted_printable_encode_002.phpt Binary files differindex aaf5608f33..b01b6957c9 100644 --- a/ext/standard/tests/strings/quoted_printable_encode_002.phpt +++ b/ext/standard/tests/strings/quoted_printable_encode_002.phpt diff --git a/ext/standard/tests/strings/setlocale_variation2.phpt b/ext/standard/tests/strings/setlocale_variation2.phpt index fad3298cc7..41a706c8bf 100644 --- a/ext/standard/tests/strings/setlocale_variation2.phpt +++ b/ext/standard/tests/strings/setlocale_variation2.phpt @@ -22,7 +22,7 @@ function good_locale($locale) { /** * Note: no_NO is a bogus locale and should not be used, see https://bugzilla.redhat.com/971416 **/ - return $locale !== 'tt_RU@iqtelif.UTF-8' && $locale !== 'no_NO.ISO-8859-1'; + return $locale !== 'tt_RU@iqtelif.UTF-8' && $locale !== 'no_NO.ISO-8859-1'; } /* Prototype : array list_system_locales( void ) diff --git a/ext/standard/tests/strings/sha1.phpt b/ext/standard/tests/strings/sha1.phpt index 4473598d06..1fea3566b5 100644 --- a/ext/standard/tests/strings/sha1.phpt +++ b/ext/standard/tests/strings/sha1.phpt @@ -5,18 +5,18 @@ sha1() with ASCII output $filename = __DIR__."/sha1.dat"; $a = array( - "abc", - "abcdbcdecdefdefgefghfghighijhijkijkljklmklmnlmnomnopnopq", - "a", - "0123456701234567012345670123456701234567012345670123456701234567", - "" + "abc", + "abcdbcdecdefdefgefghfghighijhijkijkljklmklmnlmnomnopnopq", + "a", + "0123456701234567012345670123456701234567012345670123456701234567", + "" ); foreach ($a as $str) { - var_dump($val1 = sha1($str)); - file_put_contents($filename, $str); - var_dump($val2 = sha1_file($filename)); - var_dump($val1 === $val2); + var_dump($val1 = sha1($str)); + file_put_contents($filename, $str); + var_dump($val2 = sha1_file($filename)); + var_dump($val1 === $val2); } var_dump(sha1($str, true)); diff --git a/ext/standard/tests/strings/soundex.phpt b/ext/standard/tests/strings/soundex.phpt index 744f71c17a..ef61ac495e 100644 --- a/ext/standard/tests/strings/soundex.phpt +++ b/ext/standard/tests/strings/soundex.phpt @@ -25,7 +25,7 @@ $array = array( ); foreach ($array as $str) { - var_dump(soundex($str)); + var_dump(soundex($str)); } echo "Done\n"; diff --git a/ext/standard/tests/strings/str_pad_variation2.phpt b/ext/standard/tests/strings/str_pad_variation2.phpt index 1ebf1b2825..0bf8ad3ad8 100644 --- a/ext/standard/tests/strings/str_pad_variation2.phpt +++ b/ext/standard/tests/strings/str_pad_variation2.phpt @@ -11,7 +11,7 @@ $string = chr(0).chr(255).chr(128).chr(234).chr(143); /* different pad_lengths */ $pad_lengths = [ -PHP_INT_MAX, // huge negative value - -1, // negative value + -1, // negative value 0, // pad_length < sizeof(input_string) 9, // pad_length <= sizeof(input_string) 10, // pad_length > sizeof(input_string) diff --git a/ext/standard/tests/strings/str_replace_variation3.phpt b/ext/standard/tests/strings/str_replace_variation3.phpt index d52c0676c9..f1bbf89b9f 100644 --- a/ext/standard/tests/strings/str_replace_variation3.phpt +++ b/ext/standard/tests/strings/str_replace_variation3.phpt @@ -16,10 +16,10 @@ echo "\n*** Testing Miscellaneous input data ***\n"; /* If replace has fewer values than search, then an empty string is used for the rest of replacement values */ var_dump( str_replace(array("a", "a", "b"), - array("q", "q"), - "aaabb", $count - ) - ); + array("q", "q"), + "aaabb", $count + ) + ); var_dump($count); var_dump( str_replace(array("a", "a", "b"), array("q", "q"), diff --git a/ext/standard/tests/strings/str_rot13_basic.phpt b/ext/standard/tests/strings/str_rot13_basic.phpt index b90e86fd4f..bc071be2b4 100644 --- a/ext/standard/tests/strings/str_rot13_basic.phpt +++ b/ext/standard/tests/strings/str_rot13_basic.phpt @@ -14,16 +14,16 @@ var_dump(str_rot13("abcdefghijklmnopqrstuvwxyz")); echo "\nEnsure numeric characters are left untouched\n"; if (strcmp(str_rot13("0123456789"), "0123456789") == 0) { - echo "Strings equal : TEST PASSED\n"; + echo "Strings equal : TEST PASSED\n"; } else { - echo "Strings unequal : TEST FAILED\n"; + echo "Strings unequal : TEST FAILED\n"; } echo "\nEnsure non-alphabetic characters are left untouched\n"; if (strcmp(str_rot13("!%^&*()_-+={}[]:;@~#<,>.?"), "!%^&*()_-+={}[]:;@~#<,>.?")) { - echo "Strings equal : TEST PASSED\n"; + echo "Strings equal : TEST PASSED\n"; } else { - echo "Strings unequal : TEST FAILED\n"; + echo "Strings unequal : TEST FAILED\n"; } echo "\nEnsure strings round trip\n"; @@ -31,9 +31,9 @@ $str = "str_rot13() tests starting"; $encode = str_rot13($str); $decode = str_rot13($encode); if (strcmp($str, $decode) == 0) { - echo "Strings equal : TEST PASSED\n"; + echo "Strings equal : TEST PASSED\n"; } else { - echo "Strings unequal : TEST FAILED\n"; + echo "Strings unequal : TEST FAILED\n"; } ?> --EXPECT-- diff --git a/ext/standard/tests/strings/str_shuffle_basic.phpt b/ext/standard/tests/strings/str_shuffle_basic.phpt index 037d65ac0e..8e857ff4ec 100644 --- a/ext/standard/tests/strings/str_shuffle_basic.phpt +++ b/ext/standard/tests/strings/str_shuffle_basic.phpt @@ -29,13 +29,13 @@ for ($i = 0; $i < $trys; $i++) { $op = str_shuffle($ip); if (!is_string($op) || strlen($op) != $len_ip) { - echo "TEST FAILED\n"; + echo "TEST FAILED\n"; } // Combination already hit ? if (empty($a[$op])) { - // No first time init - $a[$op] = 0; + // No first time init + $a[$op] = 0; } // Increment count for this combination @@ -45,9 +45,9 @@ for ($i = 0; $i < $trys; $i++) { $combinations = count($a); if ($combinations != 24) { - echo "TEST FAILED.. Only $combinations out of a possible 24 combinations used\n"; + echo "TEST FAILED.. Only $combinations out of a possible 24 combinations used\n"; } else { - echo "TEST PASSED\n"; + echo "TEST PASSED\n"; } ?> diff --git a/ext/standard/tests/strings/str_split_variation6.phpt b/ext/standard/tests/strings/str_split_variation6.phpt index 2d73a06d10..270fcad05a 100644 --- a/ext/standard/tests/strings/str_split_variation6.phpt +++ b/ext/standard/tests/strings/str_split_variation6.phpt @@ -38,7 +38,7 @@ for($count = 0; $count < count($values); $count++) { echo "-- Iteration ".($count + 1)." --\n"; try { - var_dump( str_split($str, $values[$count]) ); + var_dump( str_split($str, $values[$count]) ); } catch (\ValueError $e) { echo $e->getMessage() . "\n"; } diff --git a/ext/standard/tests/strings/str_split_variation7.phpt b/ext/standard/tests/strings/str_split_variation7.phpt index 4d28b765ac..097607bf8b 100644 --- a/ext/standard/tests/strings/str_split_variation7.phpt +++ b/ext/standard/tests/strings/str_split_variation7.phpt @@ -40,7 +40,7 @@ for($count = 0; $count < count($values); $count++) { echo "-- Iteration ".($count + 1)." --\n"; try { - var_dump( str_split($str, $values[$count]) ); + var_dump( str_split($str, $values[$count]) ); } catch (\ValueError $e) { echo $e->getMessage() . "\n"; } diff --git a/ext/standard/tests/strings/strcasecmp.phpt b/ext/standard/tests/strings/strcasecmp.phpt Binary files differindex 7c4fe920ad..4258f11ee3 100644 --- a/ext/standard/tests/strings/strcasecmp.phpt +++ b/ext/standard/tests/strings/strcasecmp.phpt diff --git a/ext/standard/tests/strings/strcmp.phpt b/ext/standard/tests/strings/strcmp.phpt Binary files differindex e18a854244..d4110601af 100644 --- a/ext/standard/tests/strings/strcmp.phpt +++ b/ext/standard/tests/strings/strcmp.phpt diff --git a/ext/standard/tests/strings/strcoll.phpt b/ext/standard/tests/strings/strcoll.phpt index 37fe251b66..d1d3df11fc 100644 --- a/ext/standard/tests/strings/strcoll.phpt +++ b/ext/standard/tests/strings/strcoll.phpt @@ -13,7 +13,7 @@ Testfest 2009 Munich setlocale (LC_COLLATE, 'C'); $result = strcoll($a, $b); if($result > 0) { - echo "Pass\n"; + echo "Pass\n"; } ?> --EXPECT-- diff --git a/ext/standard/tests/strings/strcspn_variation10.phpt b/ext/standard/tests/strings/strcspn_variation10.phpt index 1ad369f5dd..0b933b8049 100644 --- a/ext/standard/tests/strings/strcspn_variation10.phpt +++ b/ext/standard/tests/strings/strcspn_variation10.phpt @@ -18,35 +18,35 @@ echo "*** Testing strcspn() : with different mask strings and default start and // initialing required variables $strings = array( "", - '', - "\n", - '\n', - "hello\tworld\nhello\nworld\n", - 'hello\tworld\nhello\nworld\n', - "1234hello45world\t123", - '1234hello45world\t123', - "hello\0world\012", - 'hello\0world\012', - chr(0).chr(0), - chr(0)."hello\0world".chr(0), - chr(0).'hello\0world'.chr(0), - "hello".chr(0)."world", - 'hello'.chr(0).'world', - "hello\0\100\xaaaworld", - 'hello\0\100\xaaaworld' + '', + "\n", + '\n', + "hello\tworld\nhello\nworld\n", + 'hello\tworld\nhello\nworld\n', + "1234hello45world\t123", + '1234hello45world\t123', + "hello\0world\012", + 'hello\0world\012', + chr(0).chr(0), + chr(0)."hello\0world".chr(0), + chr(0).'hello\0world'.chr(0), + "hello".chr(0)."world", + 'hello'.chr(0).'world', + "hello\0\100\xaaaworld", + 'hello\0\100\xaaaworld' ); // defining array of mask strings $mask_array = array( - "", - '', - "\n\trsti \l", - '\n\trsti \l', - "\t", - "t\ ", - '\t', - "\t\ ", - " \t", + "", + '', + "\n\trsti \l", + '\n\trsti \l', + "\t", + "t\ ", + '\t', + "\t\ ", + " \t", "\t\i\100\xa" ); diff --git a/ext/standard/tests/strings/strcspn_variation12.phpt b/ext/standard/tests/strings/strcspn_variation12.phpt index 4495e7c26d..83530aee71 100644 --- a/ext/standard/tests/strings/strcspn_variation12.phpt +++ b/ext/standard/tests/strings/strcspn_variation12.phpt @@ -43,22 +43,22 @@ $mask_array = array( //defining array of start values $start_array = array( - 0, - 1, - 2, - -1, - 2147483647, // max positive integer - -2147483648 // min negative integer + 0, + 1, + 2, + -1, + 2147483647, // max positive integer + -2147483648 // min negative integer ); //defining array of len values $len_array = array( - 0, - 1, - 2, - -1, - 2147483647, // max positive integer - -2147483648 // min negative integer + 0, + 1, + 2, + -1, + 2147483647, // max positive integer + -2147483648 // min negative integer ); diff --git a/ext/standard/tests/strings/strcspn_variation6.phpt b/ext/standard/tests/strings/strcspn_variation6.phpt index 4d6c81d0fb..dc8ceb6ddf 100644 --- a/ext/standard/tests/strings/strcspn_variation6.phpt +++ b/ext/standard/tests/strings/strcspn_variation6.phpt @@ -62,15 +62,15 @@ $heredoc_strings = array( // defining array of mask strings $mask_array = array( - "", - '', - "\n\trsti \l", - '\n\trsti \l', - "\t", - "t\ ", - '\t', - "\t\ ", - " \t", + "", + '', + "\n\trsti \l", + '\n\trsti \l', + "\t", + "t\ ", + '\t', + "\t\ ", + " \t", "\t\i\100\xaa" ); diff --git a/ext/standard/tests/strings/strcspn_variation7.phpt b/ext/standard/tests/strings/strcspn_variation7.phpt index 1f53e20d6f..6c88b45f28 100644 --- a/ext/standard/tests/strings/strcspn_variation7.phpt +++ b/ext/standard/tests/strings/strcspn_variation7.phpt @@ -57,34 +57,34 @@ $heredoc_strings = array( $heredoc_with_newline_and_tabs, $heredoc_with_alphanumerics, $heredoc_with_embedded_nulls, - $heredoc_with_hexa_octal - ); + $heredoc_with_hexa_octal + ); // defining array of mask strings $mask_array = array( - "", - '', - "\n\trsti \l", - '\n\trsti \l', - "\t", - "t\ ", - '\t', - "\t\ ", - " \t", + "", + '', + "\n\trsti \l", + '\n\trsti \l', + "\t", + "t\ ", + '\t', + "\t\ ", + " \t", "\t\i\100\xaa" ); // definig array of start values $start_array = array( - 0, - 1, - 2, - -1, - -2, - 2147483647, // max positive integer - -2147483648, // min negative integer + 0, + 1, + 2, + -1, + -2, + 2147483647, // max positive integer + -2147483648, // min negative integer ); diff --git a/ext/standard/tests/strings/strcspn_variation8.phpt b/ext/standard/tests/strings/strcspn_variation8.phpt index 10c42731e7..388d9156a5 100644 --- a/ext/standard/tests/strings/strcspn_variation8.phpt +++ b/ext/standard/tests/strings/strcspn_variation8.phpt @@ -57,38 +57,38 @@ $heredoc_strings = array( $heredoc_with_newline_and_tabs, $heredoc_with_alphanumerics, $heredoc_with_embedded_nulls, - $heredoc_with_hexa_octal - ); + $heredoc_with_hexa_octal + ); // defining array of mask strings $mask_array = array( - "", - '', - "\n\trsti \l", - "\t", - "t\ ", - " \t", + "", + '', + "\n\trsti \l", + "\t", + "t\ ", + " \t", "\t\i\100\xaa" ); // definig array of start values $start_array = array( - 0, - 1, - 2, - -1, - 2147483647, // max positive integer - -2147483648, // min negative integer + 0, + 1, + 2, + -1, + 2147483647, // max positive integer + -2147483648, // min negative integer ); // defining array of len values $len_array = array( - 0, - 1, - 2, - -1, - 2147483647, // max positive integer - -2147483648, // min negative integer + 0, + 1, + 2, + -1, + 2147483647, // max positive integer + -2147483648, // min negative integer ); diff --git a/ext/standard/tests/strings/strcspn_variation9.phpt b/ext/standard/tests/strings/strcspn_variation9.phpt Binary files differindex 632aaa4b5d..6fd70827a5 100644 --- a/ext/standard/tests/strings/strcspn_variation9.phpt +++ b/ext/standard/tests/strings/strcspn_variation9.phpt diff --git a/ext/standard/tests/strings/strip_tags.phpt b/ext/standard/tests/strings/strip_tags.phpt index 7beebf1b0c..e594e1793c 100644 --- a/ext/standard/tests/strings/strip_tags.phpt +++ b/ext/standard/tests/strings/strip_tags.phpt @@ -2,20 +2,20 @@ strip_tags() function --FILE-- <?php - echo strip_tags('NEAT <? cool < blah ?> STUFF'); - echo "\n"; - echo strip_tags('NEAT <? cool > blah ?> STUFF'); - echo "\n"; - echo strip_tags('NEAT <!-- cool < blah --> STUFF'); - echo "\n"; - echo strip_tags('NEAT <!-- cool > blah --> STUFF'); - echo "\n"; - echo strip_tags('NEAT <? echo \"\\\"\"?> STUFF'); - echo "\n"; - echo strip_tags('NEAT <? echo \'\\\'\'?> STUFF'); - echo "\n"; - echo strip_tags('TESTS ?!!?!?!!!?!!'); - echo "\n"; + echo strip_tags('NEAT <? cool < blah ?> STUFF'); + echo "\n"; + echo strip_tags('NEAT <? cool > blah ?> STUFF'); + echo "\n"; + echo strip_tags('NEAT <!-- cool < blah --> STUFF'); + echo "\n"; + echo strip_tags('NEAT <!-- cool > blah --> STUFF'); + echo "\n"; + echo strip_tags('NEAT <? echo \"\\\"\"?> STUFF'); + echo "\n"; + echo strip_tags('NEAT <? echo \'\\\'\'?> STUFF'); + echo "\n"; + echo strip_tags('TESTS ?!!?!?!!!?!!'); + echo "\n"; ?> --EXPECT-- NEAT STUFF diff --git a/ext/standard/tests/strings/stripos.phpt b/ext/standard/tests/strings/stripos.phpt index bc2a7bc8e5..f56d38d3de 100644 --- a/ext/standard/tests/strings/stripos.phpt +++ b/ext/standard/tests/strings/stripos.phpt @@ -2,29 +2,29 @@ stripos() function test --FILE-- <?php - var_dump(stripos("test string", "TEST")); - var_dump(stripos("test string", "strIng")); - var_dump(stripos("test string", "stRin")); - var_dump(stripos("test string", "t S")); - var_dump(stripos("test string", "G")); - var_dump(stripos("te".chr(0)."st", chr(0))); - var_dump(stripos("tEst", "test")); - var_dump(stripos("teSt", "test")); - var_dump(stripos("", "")); - var_dump(stripos("a", "")); - var_dump(stripos("", "a")); - var_dump(stripos("a", " ")); - var_dump(stripos("a", "a")); - var_dump(stripos("", 1)); - var_dump(stripos("", false)); - var_dump(stripos("", true)); - var_dump(stripos("a", 1)); - var_dump(stripos("a", false)); - var_dump(stripos("a", true)); - var_dump(stripos("1", 1)); - var_dump(stripos("0", false)); - var_dump(stripos("1", true)); - var_dump(stripos("\\\\a", "\\a")); + var_dump(stripos("test string", "TEST")); + var_dump(stripos("test string", "strIng")); + var_dump(stripos("test string", "stRin")); + var_dump(stripos("test string", "t S")); + var_dump(stripos("test string", "G")); + var_dump(stripos("te".chr(0)."st", chr(0))); + var_dump(stripos("tEst", "test")); + var_dump(stripos("teSt", "test")); + var_dump(stripos("", "")); + var_dump(stripos("a", "")); + var_dump(stripos("", "a")); + var_dump(stripos("a", " ")); + var_dump(stripos("a", "a")); + var_dump(stripos("", 1)); + var_dump(stripos("", false)); + var_dump(stripos("", true)); + var_dump(stripos("a", 1)); + var_dump(stripos("a", false)); + var_dump(stripos("a", true)); + var_dump(stripos("1", 1)); + var_dump(stripos("0", false)); + var_dump(stripos("1", true)); + var_dump(stripos("\\\\a", "\\a")); ?> DONE diff --git a/ext/standard/tests/strings/stripslashes_variation2.phpt b/ext/standard/tests/strings/stripslashes_variation2.phpt Binary files differindex 5bfe5ce1fd..fdca660c4d 100644 --- a/ext/standard/tests/strings/stripslashes_variation2.phpt +++ b/ext/standard/tests/strings/stripslashes_variation2.phpt diff --git a/ext/standard/tests/strings/stripslashes_variation3.phpt b/ext/standard/tests/strings/stripslashes_variation3.phpt index 61af9db836..54a8b3d02e 100644 --- a/ext/standard/tests/strings/stripslashes_variation3.phpt +++ b/ext/standard/tests/strings/stripslashes_variation3.phpt @@ -28,22 +28,22 @@ EOT; $str_array = array( // string with newline character "\n", - "\\n", + "\\n", "Hello \nworld", "Hello \\nworld", '\n', - '\\n', + '\\n', 'Hello \nworld', 'Hello \\nworld', $heredoc_string_with_newline, // string with tab character - "\t", - "\\t", + "\t", + "\\t", "Hello \tworld", "Hello \\tworld", - '\t', - '\\t', + '\t', + '\\t', 'Hello \tworld', 'Hello \\tworld', $heredoc_string_with_tab diff --git a/ext/standard/tests/strings/stristr.phpt b/ext/standard/tests/strings/stristr.phpt index 0d47e80bcb..7b1b5312a1 100644 --- a/ext/standard/tests/strings/stristr.phpt +++ b/ext/standard/tests/strings/stristr.phpt @@ -2,17 +2,17 @@ stristr() function --FILE-- <?php - var_dump(stristr("tEsT sTrInG", "tEsT")); - var_dump(stristr("tEsT sTrInG", "stRiNg")); - var_dump(stristr("tEsT sTrInG", "stRiN")); - var_dump(stristr("tEsT sTrInG", "t S")); - var_dump(stristr("tEsT sTrInG", "g")); - var_dump(md5(stristr("te".chr(0)."st", chr(0)))); - var_dump(stristr("", "")); - var_dump(stristr("a", "")); - var_dump(stristr("", "a")); - var_dump(md5(stristr("\\\\a\\", "\\a"))); - var_dump(stristr("tEsT sTrInG", " ")); + var_dump(stristr("tEsT sTrInG", "tEsT")); + var_dump(stristr("tEsT sTrInG", "stRiNg")); + var_dump(stristr("tEsT sTrInG", "stRiN")); + var_dump(stristr("tEsT sTrInG", "t S")); + var_dump(stristr("tEsT sTrInG", "g")); + var_dump(md5(stristr("te".chr(0)."st", chr(0)))); + var_dump(stristr("", "")); + var_dump(stristr("a", "")); + var_dump(stristr("", "a")); + var_dump(md5(stristr("\\\\a\\", "\\a"))); + var_dump(stristr("tEsT sTrInG", " ")); ?> --EXPECTF-- string(11) "tEsT sTrInG" diff --git a/ext/standard/tests/strings/stristr_variation2.phpt b/ext/standard/tests/strings/stristr_variation2.phpt index 553c462097..8448292802 100644 --- a/ext/standard/tests/strings/stristr_variation2.phpt +++ b/ext/standard/tests/strings/stristr_variation2.phpt @@ -26,42 +26,42 @@ $file_handle = fopen(__FILE__, "r"); // array with different values for $input $inputs = array ( - // integer values + // integer values /*1*/ 0, - 1, - -2, - -PHP_INT_MAX, + 1, + -2, + -PHP_INT_MAX, - // float values + // float values /*5*/ 10.5, - -20.5, - 10.1234567e10, + -20.5, + 10.1234567e10, - // array values + // array values /*8*/ array(), - array(0), - array(1, 2), + array(0), + array(1, 2), - // boolean values + // boolean values /*11*/ true, - false, - TRUE, - FALSE, + false, + TRUE, + FALSE, - // null values + // null values /*15*/ NULL, - null, + null, - // objects + // objects /*17*/ new sample(), - // resource + // resource /*18*/ $file_handle, - // undefined variable + // undefined variable /*19*/ @$undefined_var, - // unset variable + // unset variable /*20*/ @$unset_var ); diff --git a/ext/standard/tests/strings/strlen.phpt b/ext/standard/tests/strings/strlen.phpt Binary files differindex 14aa687a1a..6be163d8fe 100644 --- a/ext/standard/tests/strings/strlen.phpt +++ b/ext/standard/tests/strings/strlen.phpt diff --git a/ext/standard/tests/strings/strnatcasecmp_basic.phpt b/ext/standard/tests/strings/strnatcasecmp_basic.phpt index 043ad43d37..5968980642 100644 --- a/ext/standard/tests/strings/strnatcasecmp_basic.phpt +++ b/ext/standard/tests/strings/strnatcasecmp_basic.phpt @@ -11,7 +11,7 @@ Felix De Vliegher <felix.devliegher@gmail.com> */ function str_dump($one, $two) { - var_dump(strnatcasecmp($one, $two)); + var_dump(strnatcasecmp($one, $two)); } echo "*** Testing strnatcasecmp() : basic functionality ***\n"; diff --git a/ext/standard/tests/strings/strnatcasecmp_variation1.phpt b/ext/standard/tests/strings/strnatcasecmp_variation1.phpt index 7f6d4579c3..44d2a09c5a 100644 --- a/ext/standard/tests/strings/strnatcasecmp_variation1.phpt +++ b/ext/standard/tests/strings/strnatcasecmp_variation1.phpt @@ -13,25 +13,25 @@ Felix De Vliegher <felix.devliegher@gmail.com> /* Preparation */ class a { - function __toString() - { - return "Hello WORLD"; - } + function __toString() + { + return "Hello WORLD"; + } } class b { - function __toString() - { - return "HELLO world"; - } + function __toString() + { + return "HELLO world"; + } } $a = new a(); $b = new b(); function str_dump($a, $b) { - var_dump(strnatcasecmp($a, $b)); + var_dump(strnatcasecmp($a, $b)); } echo "*** Testing strnatcasecmp() : variation ***\n"; diff --git a/ext/standard/tests/strings/strrev.phpt b/ext/standard/tests/strings/strrev.phpt index 92c66817d9..6303fccc20 100644 --- a/ext/standard/tests/strings/strrev.phpt +++ b/ext/standard/tests/strings/strrev.phpt @@ -2,16 +2,16 @@ strrev() function --FILE-- <?php - $i = 0; - $str = ''; + $i = 0; + $str = ''; - while ($i<256) { - $str .= chr($i++); - } + while ($i<256) { + $str .= chr($i++); + } - var_dump(md5(strrev($str))); - var_dump(strrev(NULL)); - var_dump(strrev("")); + var_dump(md5(strrev($str))); + var_dump(strrev(NULL)); + var_dump(strrev("")); ?> --EXPECT-- string(32) "ec6df70f2569891eae50321a9179eb82" diff --git a/ext/standard/tests/strings/strripos.phpt b/ext/standard/tests/strings/strripos.phpt index c343e92731..81881c3796 100644 --- a/ext/standard/tests/strings/strripos.phpt +++ b/ext/standard/tests/strings/strripos.phpt @@ -2,19 +2,19 @@ strripos() function --FILE-- <?php - var_dump(strripos("test test string", "test")); - var_dump(strripos("test string sTring", "string")); - var_dump(strripos("test strip string strand", "str")); - var_dump(strripos("I am what I am and that's all what I am", "am", -3)); - var_dump(strripos("test string", "g")); - var_dump(strripos("te".chr(0)."st", chr(0))); - var_dump(strripos("tEst", "test")); - var_dump(strripos("teSt", "test")); - var_dump(strripos("foo", "f", 1)); - var_dump(strripos("", "")); - var_dump(strripos("a", "")); - var_dump(strripos("", "a")); - var_dump(strripos("\\\\a", "\\a")); + var_dump(strripos("test test string", "test")); + var_dump(strripos("test string sTring", "string")); + var_dump(strripos("test strip string strand", "str")); + var_dump(strripos("I am what I am and that's all what I am", "am", -3)); + var_dump(strripos("test string", "g")); + var_dump(strripos("te".chr(0)."st", chr(0))); + var_dump(strripos("tEst", "test")); + var_dump(strripos("teSt", "test")); + var_dump(strripos("foo", "f", 1)); + var_dump(strripos("", "")); + var_dump(strripos("a", "")); + var_dump(strripos("", "a")); + var_dump(strripos("\\\\a", "\\a")); ?> --EXPECT-- int(5) diff --git a/ext/standard/tests/strings/strripos_variation1.phpt b/ext/standard/tests/strings/strripos_variation1.phpt index 5c143d2564..d8188bdd87 100644 --- a/ext/standard/tests/strings/strripos_variation1.phpt +++ b/ext/standard/tests/strings/strripos_variation1.phpt @@ -12,54 +12,54 @@ Test strripos() function : usage variations - double quoted strings for 'haystac echo "*** Testing strripos() function: with double quoted strings ***\n"; $haystack = "Hello,\t\n\0\n $&!#%()*<=>?@hello123456he \x234 \101 "; $needles = array( - //regular strings + //regular strings /*1*/ "l", - "L", - "HELLO", - "hEllo", + "L", + "HELLO", + "hEllo", - //escape characters + //escape characters /*5*/ "\t", - "\T", //invalid input - " ", - "\n", - "\N", //invalid input - " + "\T", //invalid input + " ", + "\n", + "\N", //invalid input + " ", //new line - //nulls + //nulls /*11*/ "\0", - NULL, - null, + NULL, + null, - //boolean false + //boolean false /*14*/ FALSE, - false, + false, - //empty string + //empty string /*16*/ "", - //special chars + //special chars /*17*/ " ", - "$", - " $", - "&", - "!#", - "()", - "<=>", - ">", - "=>", - "?", - "@", - "@hEllo", + "$", + " $", + "&", + "!#", + "()", + "<=>", + ">", + "=>", + "?", + "@", + "@hEllo", /*29*/ "12345", //decimal numeric string - "\x23", //hexadecimal numeric string - "#", //respective ASCII char of \x23 - "\101", //octal numeric string - "A", //respective ASCII char of \101 - "456HEE", //numerics + chars - $haystack //haystack as needle + "\x23", //hexadecimal numeric string + "#", //respective ASCII char of \x23 + "\101", //octal numeric string + "A", //respective ASCII char of \101 + "456HEE", //numerics + chars + $haystack //haystack as needle ); /* loop through to get the position of the needle in haystack string */ diff --git a/ext/standard/tests/strings/strripos_variation2.phpt b/ext/standard/tests/strings/strripos_variation2.phpt index 273215b616..55753c5c9b 100644 --- a/ext/standard/tests/strings/strripos_variation2.phpt +++ b/ext/standard/tests/strings/strripos_variation2.phpt @@ -12,55 +12,55 @@ Test strripos() function : usage variations - single quoted strings for 'haystac echo "*** Testing strripos() function: with single quoted strings ***\n"; $haystack = 'Hello,\t\n\0\n $&!#%()*<=>?@hello123456he \x234 \101 '; $needles = array( - //regular strings + //regular strings /*1*/ 'l', - 'L', - 'HELLO', - 'hEllo', + 'L', + 'HELLO', + 'hEllo', - //escape characters + //escape characters /*5*/ '\t', - '\T', - ' ', - '\n', - '\N', - ' - ', //new line + '\T', + ' ', + '\n', + '\N', + ' + ', //new line - //nulls + //nulls /*11*/ '\0', - NULL, - null, + NULL, + null, - //boolean false + //boolean false /*14*/ FALSE, - false, + false, - //empty string + //empty string /*16*/ '', - //special chars + //special chars /*17*/ ' ', - '$', - ' $', - '&', - '!#', - '()', - '<=>', - '>', - '=>', - '?', - '@', - '@hEllo', + '$', + ' $', + '&', + '!#', + '()', + '<=>', + '>', + '=>', + '?', + '@', + '@hEllo', /*29*/ '12345', //decimal numeric string - '\x23', //hexadecimal numeric string - '#', //respective ASCII char of \x23 - '\101', //octal numeric string - 'A', // respective ASCII char for \101 - '456HEE', //numerics + chars - 42, //needle as int(ASCII value of '*') - $haystack //haystack as needle + '\x23', //hexadecimal numeric string + '#', //respective ASCII char of \x23 + '\101', //octal numeric string + 'A', // respective ASCII char for \101 + '456HEE', //numerics + chars + 42, //needle as int(ASCII value of '*') + $haystack //haystack as needle ); /* loop through to get the position of the needle in haystack string */ diff --git a/ext/standard/tests/strings/strrpos.phpt b/ext/standard/tests/strings/strrpos.phpt index f672d93a2a..d374175b5a 100644 --- a/ext/standard/tests/strings/strrpos.phpt +++ b/ext/standard/tests/strings/strrpos.phpt @@ -2,19 +2,19 @@ strrpos() function --FILE-- <?php - var_dump(strrpos("test test string", "test")); - var_dump(strrpos("test string sTring", "string")); - var_dump(strrpos("test strip string strand", "str")); - var_dump(strrpos("I am what I am and that's all what I am", "am", -3)); - var_dump(strrpos("test string", "g")); - var_dump(strrpos("te".chr(0)."st", chr(0))); - var_dump(strrpos("tEst", "test")); - var_dump(strrpos("teSt", "test")); - var_dump(strrpos("foo", "f", 1)); - var_dump(strrpos("", "")); - var_dump(strrpos("a", "")); - var_dump(strrpos("", "a")); - var_dump(strrpos("\\\\a", "\\a")); + var_dump(strrpos("test test string", "test")); + var_dump(strrpos("test string sTring", "string")); + var_dump(strrpos("test strip string strand", "str")); + var_dump(strrpos("I am what I am and that's all what I am", "am", -3)); + var_dump(strrpos("test string", "g")); + var_dump(strrpos("te".chr(0)."st", chr(0))); + var_dump(strrpos("tEst", "test")); + var_dump(strrpos("teSt", "test")); + var_dump(strrpos("foo", "f", 1)); + var_dump(strrpos("", "")); + var_dump(strrpos("a", "")); + var_dump(strrpos("", "a")); + var_dump(strrpos("\\\\a", "\\a")); ?> --EXPECT-- int(5) diff --git a/ext/standard/tests/strings/strrpos_negative_offset.phpt b/ext/standard/tests/strings/strrpos_negative_offset.phpt index 17560f18f7..41b2b16b56 100644 --- a/ext/standard/tests/strings/strrpos_negative_offset.phpt +++ b/ext/standard/tests/strings/strrpos_negative_offset.phpt @@ -2,28 +2,28 @@ strr[i]pos() function with negative offset --FILE-- <?php - var_dump(strrpos("haysthack", 'ha', -9)); - var_dump(strrpos("haystack", 'h', -8)); - var_dump(strrpos("haystack", 'k', -1)); - var_dump(strrpos("haystack", "ka", -1)); - var_dump(strrpos("haystack", 'a', -3)); - var_dump(strrpos("haystack", 'a', -4)); - try { - strrpos("haystack", 'h', -9); - } catch (ValueError $exception) { - echo $exception->getMessage() . "\n"; - } - var_dump(strripos("HAYSTHACk", 'ha', -9)); - var_dump(strripos("HAYSTACK", 'h', -8)); - var_dump(strripos("HAYSTACK", 'k', -1)); - var_dump(strripos("HAYSTACK", "ka", -1)); - var_dump(strripos("HAYSTACK", 'a', -3)); - var_dump(strripos("HAYSTACK", 'a', -4)); - try { - strripos("HAYSTACK", 'h', -9); - } catch (ValueError $exception) { + var_dump(strrpos("haysthack", 'ha', -9)); + var_dump(strrpos("haystack", 'h', -8)); + var_dump(strrpos("haystack", 'k', -1)); + var_dump(strrpos("haystack", "ka", -1)); + var_dump(strrpos("haystack", 'a', -3)); + var_dump(strrpos("haystack", 'a', -4)); + try { + strrpos("haystack", 'h', -9); + } catch (ValueError $exception) { echo $exception->getMessage() . "\n"; - } + } + var_dump(strripos("HAYSTHACk", 'ha', -9)); + var_dump(strripos("HAYSTACK", 'h', -8)); + var_dump(strripos("HAYSTACK", 'k', -1)); + var_dump(strripos("HAYSTACK", "ka", -1)); + var_dump(strripos("HAYSTACK", 'a', -3)); + var_dump(strripos("HAYSTACK", 'a', -4)); + try { + strripos("HAYSTACK", 'h', -9); + } catch (ValueError $exception) { + echo $exception->getMessage() . "\n"; + } ?> --EXPECT-- int(0) diff --git a/ext/standard/tests/strings/strspn_variation10.phpt b/ext/standard/tests/strings/strspn_variation10.phpt index d8eb52aa6f..952110880f 100644 --- a/ext/standard/tests/strings/strspn_variation10.phpt +++ b/ext/standard/tests/strings/strspn_variation10.phpt @@ -19,35 +19,35 @@ echo "*** Testing strspn() : with different mask strings and default start and l // defining different strings $strings = array( "", - '', - "\n", - '\n', - "hello\tworld\nhello\nworld\n", - 'hello\tworld\nhello\nworld\n', - "1234hello45world\t123", - '1234hello45world\t123', - "hello\0world\012", - 'hello\0world\012', - chr(0).chr(0), - chr(0)."hello\0world".chr(0), - chr(0).'hello\0world'.chr(0), - "hello".chr(0)."world", - 'hello'.chr(0).'world', - "hello\0\100\xaaaworld", - 'hello\0\100\xaaaworld' + '', + "\n", + '\n', + "hello\tworld\nhello\nworld\n", + 'hello\tworld\nhello\nworld\n', + "1234hello45world\t123", + '1234hello45world\t123', + "hello\0world\012", + 'hello\0world\012', + chr(0).chr(0), + chr(0)."hello\0world".chr(0), + chr(0).'hello\0world'.chr(0), + "hello".chr(0)."world", + 'hello'.chr(0).'world', + "hello\0\100\xaaaworld", + 'hello\0\100\xaaaworld' ); // define the array of mask strings $mask_array = array( - "", - '', - "f\n\trelshti \l", - 'f\n\trelsthi \l', - "\telh", - "t\ ", - '\telh', - "felh\t\ ", - " \t", + "", + '', + "f\n\trelshti \l", + 'f\n\trelsthi \l', + "\telh", + "t\ ", + '\telh', + "felh\t\ ", + " \t", "fhel\t\i\100\xa" ); diff --git a/ext/standard/tests/strings/strspn_variation11.phpt b/ext/standard/tests/strings/strspn_variation11.phpt index ecbe6a4967..1737155a7a 100644 --- a/ext/standard/tests/strings/strspn_variation11.phpt +++ b/ext/standard/tests/strings/strspn_variation11.phpt @@ -19,47 +19,47 @@ echo "*** Testing strspn() : with different start and default len values ***\n"; // defining different strings $strings = array( "", - '', - "\n", - '\n', - "hello\tworld\nhello\nworld\n", - 'hello\tworld\nhello\nworld\n', - "1234hello45world\t123", - '1234hello45world\t123', - "hello\0world\012", - 'hello\0world\012', - chr(0).chr(0), - chr(0)."hello\0world".chr(0), - chr(0).'hello\0world'.chr(0), - "hello".chr(0)."world", - 'hello'.chr(0).'world', - "hello\0\100\xaaaworld", - 'hello\0\100\xaaaworld' + '', + "\n", + '\n', + "hello\tworld\nhello\nworld\n", + 'hello\tworld\nhello\nworld\n', + "1234hello45world\t123", + '1234hello45world\t123', + "hello\0world\012", + 'hello\0world\012', + chr(0).chr(0), + chr(0)."hello\0world".chr(0), + chr(0).'hello\0world'.chr(0), + "hello".chr(0)."world", + 'hello'.chr(0).'world', + "hello\0\100\xaaaworld", + 'hello\0\100\xaaaworld' ); // define the array of mask strings $mask_array = array( - "", - '', - "f\n\trelshti \l", - 'f\n\trelsthi \l', - "\telh", - "t\ ", - '\telh', - "felh\t\ ", - " \t", + "", + '', + "f\n\trelshti \l", + 'f\n\trelsthi \l', + "\telh", + "t\ ", + '\telh', + "felh\t\ ", + " \t", "fhel\t\i\100\xa" ); // defining the array for start values $start_array = array( - 0, - 1, + 0, + 1, 2, - -1, - -2, - 2147483647, // max positive integer - -2147483648, // min negative integer + -1, + -2, + 2147483647, // max positive integer + -2147483648, // min negative integer ); diff --git a/ext/standard/tests/strings/strspn_variation12.phpt b/ext/standard/tests/strings/strspn_variation12.phpt index 1c404c1914..e5615c9532 100644 --- a/ext/standard/tests/strings/strspn_variation12.phpt +++ b/ext/standard/tests/strings/strspn_variation12.phpt @@ -19,47 +19,47 @@ echo "*** Testing strspn() : with different start and len values ***\n"; // defining different strings $strings = array( "", - '', - "\n", - '\n', - "hello\tworld\nhello\nworld\n", - "1234hello45world\t123", - "hello\0world\012", - chr(0).chr(0), - chr(0)."hello\0world".chr(0), - "hello".chr(0)."world", - "hello\0\100\xaaaworld", + '', + "\n", + '\n', + "hello\tworld\nhello\nworld\n", + "1234hello45world\t123", + "hello\0world\012", + chr(0).chr(0), + chr(0)."hello\0world".chr(0), + "hello".chr(0)."world", + "hello\0\100\xaaaworld", ); // define the array of mask strings $mask_array = array( - "", - '', - "f\n\trelshti \l", - 'f\n\trelsthi \l', - "\telh", - "felh\t\ ", + "", + '', + "f\n\trelshti \l", + 'f\n\trelsthi \l', + "\telh", + "felh\t\ ", "fhel\t\i\100\xa" ); // defining the array for start values $start_array = array( - 0, - 1, - 2, - -1, - 2147483647, // max positive integer - -2147483648, // min negative integer + 0, + 1, + 2, + -1, + 2147483647, // max positive integer + -2147483648, // min negative integer ); // defining an array of len values $len_array = array( - 0, - 1, - 2, - -1, - 2147483647, // max positive integer - -2147483648, // min negative integer + 0, + 1, + 2, + -1, + 2147483647, // max positive integer + -2147483648, // min negative integer ); diff --git a/ext/standard/tests/strings/strspn_variation6.phpt b/ext/standard/tests/strings/strspn_variation6.phpt index b202bb8234..8c75e89775 100644 --- a/ext/standard/tests/strings/strspn_variation6.phpt +++ b/ext/standard/tests/strings/strspn_variation6.phpt @@ -63,15 +63,15 @@ $heredoc_strings = array( // defining array of different mask strings $mask_array = array( - "", - '', - "fh\ne\trlsti \l", - 'fieh\n\trlsti \l', - "\t", - "lt\ ", - 'l\t', - "fl\t\eh ", - "l \te", + "", + '', + "fh\ne\trlsti \l", + 'fieh\n\trlsti \l', + "\t", + "lt\ ", + 'l\t', + "fl\t\eh ", + "l \te", "lf\the\i\100\xaa" ); diff --git a/ext/standard/tests/strings/strspn_variation7.phpt b/ext/standard/tests/strings/strspn_variation7.phpt index bbfe5d4868..962c180c40 100644 --- a/ext/standard/tests/strings/strspn_variation7.phpt +++ b/ext/standard/tests/strings/strspn_variation7.phpt @@ -63,27 +63,27 @@ $heredoc_strings = array( // defining array of different mask strings $mask_array = array( - "", - '', - "f\nh\trstie \l", - 'f\n\thrstei \l', - "\t", - "t\ e", - '\t', - "f\te\h ", - " \t", + "", + '', + "f\nh\trstie \l", + 'f\n\thrstei \l', + "\t", + "t\ e", + '\t', + "f\te\h ", + " \t", "f\t\ih\100e\xa" ); // defining array of different start values $start_array = array( - 0, - 1, - 2, - -1, - -2, - 2147483647, // max positive integer - -2147483648, // min negative integer + 0, + 1, + 2, + -1, + -2, + 2147483647, // max positive integer + -2147483648, // min negative integer ); diff --git a/ext/standard/tests/strings/strspn_variation8.phpt b/ext/standard/tests/strings/strspn_variation8.phpt index 0ff0000132..a3486908b7 100644 --- a/ext/standard/tests/strings/strspn_variation8.phpt +++ b/ext/standard/tests/strings/strspn_variation8.phpt @@ -63,33 +63,33 @@ $heredoc_strings = array( // defining array of different mask strings $mask_array = array( - "", - '', - "f\n\\0htersti \l", - "\t", - "het\ ", - "fel\th\ ", + "", + '', + "f\n\\0htersti \l", + "\t", + "het\ ", + "fel\th\ ", "f\t\hiel\100\xaa" ); // defining array of different start values $start_array = array( - 0, - 1, - 2, - -1, - 2147483647, // max positive integer - -2147483648, // min negative integer + 0, + 1, + 2, + -1, + 2147483647, // max positive integer + -2147483648, // min negative integer ); // defining array of different len values $len_array = array( - 0, - 1, - 2, - -1, - 2147483647, // max positive integer - -2147483648, // min negative integer + 0, + 1, + 2, + -1, + 2147483647, // max positive integer + -2147483648, // min negative integer ); diff --git a/ext/standard/tests/strings/strspn_variation9.phpt b/ext/standard/tests/strings/strspn_variation9.phpt Binary files differindex 0835047ff5..49d590bee8 100644 --- a/ext/standard/tests/strings/strspn_variation9.phpt +++ b/ext/standard/tests/strings/strspn_variation9.phpt diff --git a/ext/standard/tests/strings/strtok_variation4.phpt b/ext/standard/tests/strings/strtok_variation4.phpt index 5db1d39650..fb34639f48 100644 --- a/ext/standard/tests/strings/strtok_variation4.phpt +++ b/ext/standard/tests/strings/strtok_variation4.phpt @@ -15,8 +15,8 @@ echo "*** Testing strtok() : with embedded nulls in the strings ***\n"; // defining varous strings with embedded nulls $strings_with_nulls = array( - "\0", - '\0', + "\0", + '\0', "hello\0world", "\0hel\0lo", "hello\0", diff --git a/ext/standard/tests/strings/strtok_variation5.phpt b/ext/standard/tests/strings/strtok_variation5.phpt index a99d13eb7a..e844f97eef 100644 --- a/ext/standard/tests/strings/strtok_variation5.phpt +++ b/ext/standard/tests/strings/strtok_variation5.phpt @@ -15,31 +15,31 @@ echo "*** Testing strtok() : with miscellaneous inputs ***\n"; // defining arrays for input strings and tokens $string_array = array( - "HELLO WORLD", - "hello world", - "_HELLO_WORLD_", - "/thello/t/wor/ttld", - "hel/lo/t/world", + "HELLO WORLD", + "hello world", + "_HELLO_WORLD_", + "/thello/t/wor/ttld", + "hel/lo/t/world", "one:$:two:!:three:#:four", - "\rhello/r/wor\rrld", - chr(0), + "\rhello/r/wor\rrld", + chr(0), chr(0).chr(0), chr(0).'hello'.chr(0), 'hello'.chr(0).'world' - ); + ); $token_array = array( - "wr", - "hello world", - "__", + "wr", + "hello world", + "__", "t/", - '/t', - ":", - "\r", - "\0", - "\0", - "\0", - "\0", - ); + '/t', + ":", + "\r", + "\0", + "\0", + "\0", + "\0", + ); // loop through each element of the array and check the working of strtok() // when supplied with different string and token values diff --git a/ext/standard/tests/strings/strtok_variation6.phpt b/ext/standard/tests/strings/strtok_variation6.phpt index cd7f3b3041..4d435dcef4 100644 --- a/ext/standard/tests/strings/strtok_variation6.phpt +++ b/ext/standard/tests/strings/strtok_variation6.phpt @@ -15,18 +15,18 @@ echo "*** Testing strtok() : with invalid escape sequences in token ***\n"; // defining arrays for input strings and tokens $string_array = array( - "khellok worldk", - "\khello\k world\k", - "/khello\k world/k", - "/hellok/ world" - ); + "khellok worldk", + "\khello\k world\k", + "/khello\k world/k", + "/hellok/ world" + ); $token_array = array( - "k", - "/ ", - "/k", - "\k", - "\\\\\\\k\h\\e\l\o\w\r\l\d" - ); + "k", + "/ ", + "/k", + "\k", + "\\\\\\\k\h\\e\l\o\w\r\l\d" + ); // loop through each element of the array and check the working of strtok() // when supplied with different string and token values diff --git a/ext/standard/tests/strings/strtr_variation6.phpt b/ext/standard/tests/strings/strtr_variation6.phpt index e0c2458ede..9956acaca8 100644 --- a/ext/standard/tests/strings/strtr_variation6.phpt +++ b/ext/standard/tests/strings/strtr_variation6.phpt @@ -34,41 +34,41 @@ $str = "012atm"; // array of values for 'from' $from_arr = array ( - // integer values + // integer values /*1*/ 0, - 1, - -2, + 1, + -2, - // float values + // float values /*4*/ 10.5, - -20.5, - 10.1234567e10, + -20.5, + 10.1234567e10, - // array values + // array values /*7*/ array(), - array(0), - array(1, 2), + array(0), + array(1, 2), - // boolean values + // boolean values /*10*/ true, - false, - TRUE, - FALSE, + false, + TRUE, + FALSE, - // null values + // null values /*14*/ NULL, - null, + null, - // objects + // objects /*16*/ new sample(), - // resource + // resource /*17*/ $file_handle, - // undefined variable + // undefined variable /*18*/ @$undefined_var, - // unset variable + // unset variable /*19*/ @$unset_var ); diff --git a/ext/standard/tests/strings/strval_basic.phpt b/ext/standard/tests/strings/strval_basic.phpt index ac89554527..9e26446c4c 100644 --- a/ext/standard/tests/strings/strval_basic.phpt +++ b/ext/standard/tests/strings/strval_basic.phpt @@ -18,23 +18,23 @@ EOT; //array of values to iterate over $values = array( - // Simple strings + // Simple strings /*1*/ "Hello World", - 'Hello World', + 'Hello World', - // String with control chars + // String with control chars /*3*/ "String\nwith\ncontrol\ncharacters\r\n", - // String with quotes + // String with quotes /*4*/ "String with \"quotes\"", - //Numeric String + //Numeric String /*5*/ "123456", - // Hexadecimal string + // Hexadecimal string /*6*/ "0xABC", - //Heredoc String + //Heredoc String /*7*/ $simple_heredoc ); diff --git a/ext/standard/tests/strings/strval_error.phpt b/ext/standard/tests/strings/strval_error.phpt index 18d502eb2b..a363e26f24 100644 --- a/ext/standard/tests/strings/strval_error.phpt +++ b/ext/standard/tests/strings/strval_error.phpt @@ -13,7 +13,7 @@ error_reporting(E_ALL ^ E_NOTICE); class MyClass { - // no toString() method defined + // no toString() method defined } // Testing strval with a object which has no toString() method diff --git a/ext/standard/tests/strings/strval_variation1.phpt b/ext/standard/tests/strings/strval_variation1.phpt index 068e1e2649..d64a7c4ab0 100644 --- a/ext/standard/tests/strings/strval_variation1.phpt +++ b/ext/standard/tests/strings/strval_variation1.phpt @@ -25,59 +25,59 @@ class MyClass //array of values to iterate over $values = array( - //Decimal values + //Decimal values /*1*/ 0, - 1, - 12345, - -12345, + 1, + 12345, + -12345, - //Octal values + //Octal values /*5*/ 02, - 010, - 030071, - -030071, + 010, + 030071, + -030071, - //Hexadecimal values + //Hexadecimal values /*9*/ 0x0, - 0x1, - 0xABCD, - -0xABCD, + 0x1, + 0xABCD, + -0xABCD, - // float data + // float data /*13*/ 100.5, - -100.5, - 100.1234567e10, - 100.7654321E-10, - .5, + -100.5, + 100.1234567e10, + 100.7654321E-10, + .5, - // array data + // array data /*18*/ array(), - array('color' => 'red', 'item' => 'pen'), + array('color' => 'red', 'item' => 'pen'), - // null data + // null data /*20*/ NULL, - null, + null, - // boolean data + // boolean data /*22*/ true, - false, - TRUE, - FALSE, + false, + TRUE, + FALSE, - // empty data + // empty data /*26*/ "", - '', + '', - // object data + // object data /*28*/ new MyClass(), - // resource + // resource /*29*/ $file_handle, - // undefined data + // undefined data /*30*/ @$undefined_var, - // unset data + // unset data /*31*/ @$unset_var, ); diff --git a/ext/standard/tests/strings/ucfirst.phpt b/ext/standard/tests/strings/ucfirst.phpt Binary files differindex c5c7ce3c87..e7c0373a3c 100644 --- a/ext/standard/tests/strings/ucfirst.phpt +++ b/ext/standard/tests/strings/ucfirst.phpt diff --git a/ext/standard/tests/strings/unpack.phpt b/ext/standard/tests/strings/unpack.phpt index 3a6068be71..435361cca5 100644 --- a/ext/standard/tests/strings/unpack.phpt +++ b/ext/standard/tests/strings/unpack.phpt @@ -2,8 +2,8 @@ Invalid format type validation --FILE-- <?php - var_dump(unpack("-2222", 1)); - echo "Done\n"; + var_dump(unpack("-2222", 1)); + echo "Done\n"; ?> --EXPECTF-- Warning: unpack(): Invalid format type - in %sunpack.php on line %d diff --git a/ext/standard/tests/strings/unpack_offset.phpt b/ext/standard/tests/strings/unpack_offset.phpt index 64cb089bc3..451dd36724 100644 --- a/ext/standard/tests/strings/unpack_offset.phpt +++ b/ext/standard/tests/strings/unpack_offset.phpt @@ -8,8 +8,8 @@ $a = unpack("l2", $data, 3); printf("0x%08x 0x%08x\n", $a[1], $a[2]); printf("0x%08x 0x%08x\n", - unpack("l", $data, 3)[1], - unpack("@4/l", $data, 3)[1]); + unpack("l", $data, 3)[1], + unpack("@4/l", $data, 3)[1]); ?> --EXPECT-- 0x01020304 0x05060708 diff --git a/ext/standard/tests/strings/url_t.phpt b/ext/standard/tests/strings/url_t.phpt index 1ff7baff90..caa93cb9cf 100644 --- a/ext/standard/tests/strings/url_t.phpt +++ b/ext/standard/tests/strings/url_t.phpt @@ -81,7 +81,7 @@ $sample_urls = array ( $url = 'http://secret:hideout@www.php.net:80/index.php?test=1&test2=char&test3=mixesCI#some_page_ref123'; foreach (array(PHP_URL_SCHEME,PHP_URL_HOST,PHP_URL_PORT,PHP_URL_USER,PHP_URL_PASS,PHP_URL_PATH,PHP_URL_QUERY,PHP_URL_FRAGMENT) as $v) { - var_dump(parse_url($url, $v)); + var_dump(parse_url($url, $v)); } ?> --EXPECT-- diff --git a/ext/standard/tests/strings/vfprintf_basic.phpt b/ext/standard/tests/strings/vfprintf_basic.phpt index 16a0014425..3219371594 100644 --- a/ext/standard/tests/strings/vfprintf_basic.phpt +++ b/ext/standard/tests/strings/vfprintf_basic.phpt @@ -14,12 +14,12 @@ precision=14 function writeAndDump($fp, $format, $args) { - ftruncate( $fp, 0 ); - $length = vfprintf( $fp, $format, $args ); - rewind( $fp ); - $content = stream_get_contents( $fp ); - var_dump( $content ); - var_dump( $length ); + ftruncate( $fp, 0 ); + $length = vfprintf( $fp, $format, $args ); + rewind( $fp ); + $content = stream_get_contents( $fp ); + var_dump( $content ); + var_dump( $length ); } echo "*** Testing vfprintf() : basic functionality ***\n"; diff --git a/ext/standard/tests/strings/vfprintf_variation1.phpt b/ext/standard/tests/strings/vfprintf_variation1.phpt index 744d9e2fd8..d7120e41c0 100644 --- a/ext/standard/tests/strings/vfprintf_variation1.phpt +++ b/ext/standard/tests/strings/vfprintf_variation1.phpt @@ -23,21 +23,21 @@ unset( $funset ); class FooClass { - public function __toString() - { - return "Object"; - } + public function __toString() + { + return "Object"; + } } // Output facilitating function function writeAndDump($fp, $format, $args) { - ftruncate( $fp, 0 ); - $length = vfprintf( $fp, $format, $args ); - rewind( $fp ); - $content = stream_get_contents( $fp ); - var_dump( $content ); - var_dump( $length ); + ftruncate( $fp, 0 ); + $length = vfprintf( $fp, $format, $args ); + rewind( $fp ); + $content = stream_get_contents( $fp ); + var_dump( $content ); + var_dump( $length ); } // Test vfprintf() diff --git a/ext/standard/tests/strings/vfprintf_variation20.phpt b/ext/standard/tests/strings/vfprintf_variation20.phpt index 17426c7af7..95477f6c25 100644 --- a/ext/standard/tests/strings/vfprintf_variation20.phpt +++ b/ext/standard/tests/strings/vfprintf_variation20.phpt @@ -36,50 +36,50 @@ $file_handle = fopen(__FILE__, 'r'); //array of values to iterate over $values = array( - // int data + // int data /*1*/ 0, - 1, - 12345, - -2345, + 1, + 12345, + -2345, - // float data + // float data /*5*/ 10.5, - -10.5, - 10.1234567e10, - 10.7654321E-10, - .5, + -10.5, + 10.1234567e10, + 10.7654321E-10, + .5, - // array data + // array data /*10*/ array(), - array(0), - array(1), - array(1,2), - array('color' => 'red', 'item' => 'pen'), + array(0), + array(1), + array(1,2), + array('color' => 'red', 'item' => 'pen'), - // null data + // null data /*15*/ NULL, - null, + null, - // boolean data + // boolean data /*17*/ true, - false, - TRUE, - FALSE, + false, + TRUE, + FALSE, - // empty data + // empty data /*21*/ "", - '', + '', - // object data + // object data /*23*/ new sample(), - // undefined data + // undefined data /*24*/ @$undefined_var, - // unset data + // unset data /*25*/ @$unset_var, - // resource data + // resource data /*26*/ $file_handle ); diff --git a/ext/standard/tests/strings/vfprintf_variation21.phpt b/ext/standard/tests/strings/vfprintf_variation21.phpt index 9b9c3c12ae..f44cc36a2c 100644 --- a/ext/standard/tests/strings/vfprintf_variation21.phpt +++ b/ext/standard/tests/strings/vfprintf_variation21.phpt @@ -36,47 +36,47 @@ $file_handle = fopen(__FILE__, 'r'); //array of values to iterate over $values = array( - // int data + // int data /*1*/ 0, - 1, - 12345, - -2345, + 1, + 12345, + -2345, - // float data + // float data /*5*/ 10.5, - -10.5, - 10.1234567e10, - 10.7654321E-10, - .5, + -10.5, + 10.1234567e10, + 10.7654321E-10, + .5, - // null data + // null data /*10*/ NULL, - null, + null, - // boolean data + // boolean data /*12*/ true, - false, - TRUE, - FALSE, + false, + TRUE, + FALSE, - // empty data + // empty data /*16*/ "", - '', + '', - // string data + // string data /*18*/ "string", - 'string', + 'string', - // object data + // object data /*20*/ new sample(), - // undefined data + // undefined data /*21*/ @$undefined_var, - // unset data + // unset data /*22*/ @$unset_var, - // resource data + // resource data /*23*/ $file_handle ); @@ -91,9 +91,9 @@ $counter = 1; foreach( $values as $value ) { fprintf($fp, "\n-- Iteration %d --\n",$counter); try { - vfprintf($fp, $format, $value); + vfprintf($fp, $format, $value); } catch (\ValueError $e) { - fwrite($fp, $e->getMessage() . "\n"); + fwrite($fp, $e->getMessage() . "\n"); } $counter++; } diff --git a/ext/standard/tests/strings/vprintf_variation1.phpt b/ext/standard/tests/strings/vprintf_variation1.phpt index 0fb8ed8a03..fd479274ef 100644 --- a/ext/standard/tests/strings/vprintf_variation1.phpt +++ b/ext/standard/tests/strings/vprintf_variation1.phpt @@ -36,50 +36,50 @@ $file_handle = fopen(__FILE__, 'r'); //array of values to iterate over $values = array( - // int data + // int data /*1*/ 0, - 1, - 12345, - -2345, + 1, + 12345, + -2345, - // float data + // float data /*5*/ 10.5, - -10.5, - 10.1234567e10, - 10.7654321E-10, - .5, + -10.5, + 10.1234567e10, + 10.7654321E-10, + .5, - // array data + // array data /*10*/ array(), - array(0), - array(1), - array(1,2), - array('color' => 'red', 'item' => 'pen'), + array(0), + array(1), + array(1,2), + array('color' => 'red', 'item' => 'pen'), - // null data + // null data /*15*/ NULL, - null, + null, - // boolean data + // boolean data /*17*/ true, - false, - TRUE, - FALSE, + false, + TRUE, + FALSE, - // empty data + // empty data /*21*/ "", - '', + '', - // object data + // object data /*23*/ new sample(), - // undefined data + // undefined data /*24*/ @$undefined_var, - // unset data + // unset data /*25*/ @$unset_var, - // resource data + // resource data /*26*/ $file_handle ); diff --git a/ext/standard/tests/strings/vprintf_variation2.phpt b/ext/standard/tests/strings/vprintf_variation2.phpt index 4b59a5046d..12ffb6dd1f 100644 --- a/ext/standard/tests/strings/vprintf_variation2.phpt +++ b/ext/standard/tests/strings/vprintf_variation2.phpt @@ -36,47 +36,47 @@ $file_handle = fopen(__FILE__, 'r'); //array of values to iterate over $values = array( - // int data + // int data /*1*/ 0, - 1, - 12345, - -2345, + 1, + 12345, + -2345, - // float data + // float data /*5*/ 10.5, - -10.5, - 10.1234567e10, - 10.7654321E-10, - .5, + -10.5, + 10.1234567e10, + 10.7654321E-10, + .5, - // null data + // null data /*10*/ NULL, - null, + null, - // boolean data + // boolean data /*12*/ true, - false, - TRUE, - FALSE, + false, + TRUE, + FALSE, - // empty data + // empty data /*16*/ "", - '', + '', - // string data + // string data /*18*/ "string", - 'string', + 'string', - // object data + // object data /*20*/ new sample(), - // undefined data + // undefined data /*21*/ @$undefined_var, - // unset data + // unset data /*22*/ @$unset_var, - // resource data + // resource data /*23*/ $file_handle ); @@ -85,11 +85,11 @@ $counter = 1; foreach($values as $value) { echo "\n-- Iteration $counter --\n"; try { - $result = vprintf($format,$value); - echo "\n"; - var_dump($result); + $result = vprintf($format,$value); + echo "\n"; + var_dump($result); } catch (\ValueError $e) { - echo $e->getMessage(), "\n"; + echo $e->getMessage(), "\n"; } $counter++; }; diff --git a/ext/standard/tests/time/001.phpt b/ext/standard/tests/time/001.phpt index b8498850f1..34b87157f2 100644 --- a/ext/standard/tests/time/001.phpt +++ b/ext/standard/tests/time/001.phpt @@ -15,14 +15,14 @@ $result = ''; set_time_limit(0); for ($i=1;$i<=100000;$i++) { - list($micro,$time)=explode(" ",microtime()); - if ($time > $last_t || ($time == $last_t && $micro >= $last_m)) { - $passed++; - } else if ($failed++ <=10) { - $result .= sprintf('%06d', $i).": $time $micro < $last_t $last_m\n"; - } - $last_m = $micro; - $last_t = $time; + list($micro,$time)=explode(" ",microtime()); + if ($time > $last_t || ($time == $last_t && $micro >= $last_m)) { + $passed++; + } else if ($failed++ <=10) { + $result .= sprintf('%06d', $i).": $time $micro < $last_t $last_m\n"; + } + $last_m = $micro; + $last_t = $time; } echo "Passed: $passed\n"; echo "Failed: $failed\n"; diff --git a/ext/standard/tests/time/bug38524.phpt b/ext/standard/tests/time/bug38524.phpt index 3def28e082..22ff9e4d76 100644 --- a/ext/standard/tests/time/bug38524.phpt +++ b/ext/standard/tests/time/bug38524.phpt @@ -4,7 +4,7 @@ Bug #38524 (strptime() does not initialize the internal date storage structure) <?php if (!function_exists('strptime')) echo "SKIP"; ?> --FILE-- <?php - var_dump(strptime('2006-08-20', '%Y-%m-%d')); + var_dump(strptime('2006-08-20', '%Y-%m-%d')); ?> --EXPECTF-- array(9) { diff --git a/ext/standard/tests/time/bug60222.phpt b/ext/standard/tests/time/bug60222.phpt index 7ea65ce54c..c74d27d53b 100644 --- a/ext/standard/tests/time/bug60222.phpt +++ b/ext/standard/tests/time/bug60222.phpt @@ -3,7 +3,7 @@ Bug #60222 (time_nanosleep() does validate input params) --FILE-- <?php try { - time_nanosleep(-1, 0); + time_nanosleep(-1, 0); } catch (ValueError $exception) { echo $exception->getMessage() . "\n"; } diff --git a/ext/standard/tests/time/idate.phpt b/ext/standard/tests/time/idate.phpt index 0b54405499..1a06070b45 100644 --- a/ext/standard/tests/time/idate.phpt +++ b/ext/standard/tests/time/idate.phpt @@ -5,7 +5,7 @@ idate() function date_default_timezone_set('GMT0'); $tmp = "UYzymndjHGhgistwLBIW"; for($a = 0;$a < strlen($tmp); $a++){ - echo $tmp[$a], ': ', idate($tmp[$a], 1043324459)."\n"; + echo $tmp[$a], ': ', idate($tmp[$a], 1043324459)."\n"; } ?> --EXPECT-- diff --git a/ext/standard/tests/url/base64_decode_basic_002.phpt b/ext/standard/tests/url/base64_decode_basic_002.phpt index c538d15997..647fbd3b5c 100644 --- a/ext/standard/tests/url/base64_decode_basic_002.phpt +++ b/ext/standard/tests/url/base64_decode_basic_002.phpt @@ -16,7 +16,7 @@ var_dump(base64_decode($noWhiteSpace, true)); echo "\nWhitespace does not affect base64_decode, even with \$strict===true:\n"; $withWhiteSpace = "a GVs bG8gd2 - 9ybGQh"; + 9ybGQh"; var_dump(base64_decode($withWhiteSpace)); var_dump(base64_decode($withWhiteSpace, false)); var_dump(base64_decode($withWhiteSpace, true)); diff --git a/ext/standard/tests/url/base64_decode_basic_003.phpt b/ext/standard/tests/url/base64_decode_basic_003.phpt index 3bcd51e192..13c0f449d8 100644 --- a/ext/standard/tests/url/base64_decode_basic_003.phpt +++ b/ext/standard/tests/url/base64_decode_basic_003.phpt @@ -12,29 +12,29 @@ Test base64_decode() function : basic functionality - padding and whitespace echo "Test base64_decode (output as JSON):\n"; $data = [ - "", "=", "==", "===", "====", - "V", "V=", "V==", "V===", "V====", - "VV", "VV=", "VV==", "VV===", "VV====", - "VVV", "VVV=", "VVV==", "VVV===", "VVV====", - "VVVV", "VVVV=", "VVVV==", "VVVV===", "VVVV====", - "=V", "=VV", "=VVV", - "==V", "==VV", "==VVV", - "===V", "===VV", "===VVV", - "====V", "====VV", "====VVV", - "=VVV", "V=VV", "VV=V", "VVV=", - "=VVVV", "V=VVV", "VV=VV", "VVV=V", "VVVV=", - "=VVV=", "V=VV=", "VV=V=", "VVV==", - "\nVV", "V\nV", "VV\n", - "\nVV==", "V\nV==", "VV\n==", "VV=\n=", "VV==\n", - "*VV", "V*V", "VV*", - "*VV==", "V*V==", "VV*==", "VV=*=", "VV==*", - "\0VV==", "V\0V==", "VV\0==", "VV=\0=", "VV==\0", - "\0VVV==", "V\0VV==", "VV\0V==", "VVV\0==", "VVV=\0=", "VVV==\0", + "", "=", "==", "===", "====", + "V", "V=", "V==", "V===", "V====", + "VV", "VV=", "VV==", "VV===", "VV====", + "VVV", "VVV=", "VVV==", "VVV===", "VVV====", + "VVVV", "VVVV=", "VVVV==", "VVVV===", "VVVV====", + "=V", "=VV", "=VVV", + "==V", "==VV", "==VVV", + "===V", "===VV", "===VVV", + "====V", "====VV", "====VVV", + "=VVV", "V=VV", "VV=V", "VVV=", + "=VVVV", "V=VVV", "VV=VV", "VVV=V", "VVVV=", + "=VVV=", "V=VV=", "VV=V=", "VVV==", + "\nVV", "V\nV", "VV\n", + "\nVV==", "V\nV==", "VV\n==", "VV=\n=", "VV==\n", + "*VV", "V*V", "VV*", + "*VV==", "V*V==", "VV*==", "VV=*=", "VV==*", + "\0VV==", "V\0V==", "VV\0==", "VV=\0=", "VV==\0", + "\0VVV==", "V\0VV==", "VV\0V==", "VVV\0==", "VVV=\0=", "VVV==\0", ]; foreach ($data as $a) { - $b = base64_decode($a, false); - $c = base64_decode($a, true); - printf("base64 %-16s non-strict %-8s strict %s\n", json_encode($a), json_encode($b), json_encode($c)); + $b = base64_decode($a, false); + $c = base64_decode($a, true); + printf("base64 %-16s non-strict %-8s strict %s\n", json_encode($a), json_encode($b), json_encode($c)); } echo "Done\n"; ?> diff --git a/ext/standard/tests/url/base64_encode_basic_001.phpt b/ext/standard/tests/url/base64_encode_basic_001.phpt index 764e15f377..ff8c20e1b5 100644 --- a/ext/standard/tests/url/base64_encode_basic_001.phpt +++ b/ext/standard/tests/url/base64_encode_basic_001.phpt @@ -15,9 +15,9 @@ Test base64_encode() function : basic functionality echo "*** Testing base64_encode() : basic functionality ***\n"; for ($i=0; $i<256; $i++) { - $str = pack("c", $i); - $enc = base64_encode($str); - printf("0x%X: %s\n", $i, $enc); + $str = pack("c", $i); + $enc = base64_encode($str); + printf("0x%X: %s\n", $i, $enc); } echo "Done"; diff --git a/ext/standard/tests/url/base64_encode_basic_002.phpt b/ext/standard/tests/url/base64_encode_basic_002.phpt index 15bd9380b1..94af3c93bd 100644 --- a/ext/standard/tests/url/base64_encode_basic_002.phpt +++ b/ext/standard/tests/url/base64_encode_basic_002.phpt @@ -15,29 +15,29 @@ Test base64_encode() function : basic functionality - check algorithm round trip echo "*** Testing base64_encode() : basic functionality ***\n"; $values = array( - "Hello World", - "ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890!%^&*(){}[]", - "\n\t Line with control characters\r\n", - "\xC1\xC2\xC3\xC4\xC5\xC6", - "\75\76\77\78\79\80" + "Hello World", + "ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890!%^&*(){}[]", + "\n\t Line with control characters\r\n", + "\xC1\xC2\xC3\xC4\xC5\xC6", + "\75\76\77\78\79\80" ); echo "\n--- Testing base64_encode() with binary string input ---\n"; $counter = 1; foreach($values as $str) { - echo "-- Iteration $counter --\n"; + echo "-- Iteration $counter --\n"; - $enc = base64_encode($str); - $dec = base64_decode($enc); + $enc = base64_encode($str); + $dec = base64_decode($enc); - if ($dec != $str) { - echo "TEST FAILED\n"; - } else { - echo "TEST PASSED\n"; - } + if ($dec != $str) { + echo "TEST FAILED\n"; + } else { + echo "TEST PASSED\n"; + } - $counter ++; + $counter ++; } ?> diff --git a/ext/standard/tests/url/bug52327.phpt b/ext/standard/tests/url/bug52327.phpt index fb2e0fa25b..3450abcc4b 100644 --- a/ext/standard/tests/url/bug52327.phpt +++ b/ext/standard/tests/url/bug52327.phpt @@ -3,8 +3,8 @@ Bug #52327 (base64_decode() improper handling of leading padding) --FILE-- <?php var_dump( - base64_decode('=VGhl=ICc9=JyBz=eW1i=b2xz=IGFy=ZW4n=dCBh=bGxv=d2Vk=IHdo=ZXJl=IGkg=cHV0=IHRo=ZW0g=by5P'), - base64_decode('=VGhl=ICc9=JyBz=eW1i=b2xz=IGFy=ZW4n=dCBh=bGxv=d2Vk=IHdo=ZXJl=IGkg=cHV0=IHRo=ZW0g=by5P', true) + base64_decode('=VGhl=ICc9=JyBz=eW1i=b2xz=IGFy=ZW4n=dCBh=bGxv=d2Vk=IHdo=ZXJl=IGkg=cHV0=IHRo=ZW0g=by5P'), + base64_decode('=VGhl=ICc9=JyBz=eW1i=b2xz=IGFy=ZW4n=dCBh=bGxv=d2Vk=IHdo=ZXJl=IGkg=cHV0=IHRo=ZW0g=by5P', true) ); ?> --EXPECT-- diff --git a/ext/standard/tests/url/bug55273.phpt b/ext/standard/tests/url/bug55273.phpt index 1408506b42..e5c8fca70c 100644 --- a/ext/standard/tests/url/bug55273.phpt +++ b/ext/standard/tests/url/bug55273.phpt @@ -3,9 +3,9 @@ Bug #55273 (base64_decode() with strict rejects whitespace after pad) --FILE-- <?php function test($s) { - $v = chunk_split(base64_encode($s)); - $r = base64_decode($v, True); - var_dump($v, $r); + $v = chunk_split(base64_encode($s)); + $r = base64_decode($v, True); + var_dump($v, $r); } test('PHP'); diff --git a/ext/standard/tests/url/parse_url_basic_001.phpt b/ext/standard/tests/url/parse_url_basic_001.phpt index 3977a3fc2e..89a63010b9 100644 --- a/ext/standard/tests/url/parse_url_basic_001.phpt +++ b/ext/standard/tests/url/parse_url_basic_001.phpt @@ -14,8 +14,8 @@ Test parse_url() function: Parse a load of URLs without specifying the component include_once(__DIR__ . '/urls.inc'); foreach ($urls as $url) { - echo "\n--> $url: "; - var_dump(parse_url($url)); + echo "\n--> $url: "; + var_dump(parse_url($url)); } echo "Done"; diff --git a/ext/standard/tests/url/parse_url_basic_002.phpt b/ext/standard/tests/url/parse_url_basic_002.phpt index c8b94dec1c..9616278fc6 100644 --- a/ext/standard/tests/url/parse_url_basic_002.phpt +++ b/ext/standard/tests/url/parse_url_basic_002.phpt @@ -14,8 +14,8 @@ Test parse_url() function: Parse a load of URLs without specifying PHP_URL_SCHEM include_once(__DIR__ . '/urls.inc'); foreach ($urls as $url) { - echo "--> $url : "; - var_dump(parse_url($url, PHP_URL_SCHEME)); + echo "--> $url : "; + var_dump(parse_url($url, PHP_URL_SCHEME)); } diff --git a/ext/standard/tests/url/parse_url_basic_003.phpt b/ext/standard/tests/url/parse_url_basic_003.phpt index f917b77b97..668ee5aab2 100644 --- a/ext/standard/tests/url/parse_url_basic_003.phpt +++ b/ext/standard/tests/url/parse_url_basic_003.phpt @@ -14,8 +14,8 @@ Test parse_url() function: Parse a load of URLs without specifying PHP_URL_HOST include_once(__DIR__ . '/urls.inc'); foreach ($urls as $url) { - echo "--> $url : "; - var_dump(parse_url($url, PHP_URL_HOST)); + echo "--> $url : "; + var_dump(parse_url($url, PHP_URL_HOST)); } echo "Done"; diff --git a/ext/standard/tests/url/parse_url_basic_004.phpt b/ext/standard/tests/url/parse_url_basic_004.phpt index 29d4655243..464ed20d42 100644 --- a/ext/standard/tests/url/parse_url_basic_004.phpt +++ b/ext/standard/tests/url/parse_url_basic_004.phpt @@ -14,8 +14,8 @@ Test parse_url() function: Parse a load of URLs without specifying PHP_URL_PORT include_once(__DIR__ . '/urls.inc'); foreach ($urls as $url) { - echo "--> $url : "; - var_dump(parse_url($url, PHP_URL_PORT)); + echo "--> $url : "; + var_dump(parse_url($url, PHP_URL_PORT)); } echo "Done"; diff --git a/ext/standard/tests/url/parse_url_basic_005.phpt b/ext/standard/tests/url/parse_url_basic_005.phpt index 716d8d1dfa..f776181987 100644 --- a/ext/standard/tests/url/parse_url_basic_005.phpt +++ b/ext/standard/tests/url/parse_url_basic_005.phpt @@ -14,8 +14,8 @@ Test parse_url() function: Parse a load of URLs without specifying PHP_URL_USER include_once(__DIR__ . '/urls.inc'); foreach ($urls as $url) { - echo "--> $url : "; - var_dump(parse_url($url, PHP_URL_USER)); + echo "--> $url : "; + var_dump(parse_url($url, PHP_URL_USER)); } echo "Done"; diff --git a/ext/standard/tests/url/parse_url_basic_006.phpt b/ext/standard/tests/url/parse_url_basic_006.phpt index 3ae94ca626..fc6378106b 100644 --- a/ext/standard/tests/url/parse_url_basic_006.phpt +++ b/ext/standard/tests/url/parse_url_basic_006.phpt @@ -14,8 +14,8 @@ Test parse_url() function: Parse a load of URLs without specifying PHP_URL_PASS include_once(__DIR__ . '/urls.inc'); foreach ($urls as $url) { - echo "--> $url : "; - var_dump(parse_url($url, PHP_URL_PASS)); + echo "--> $url : "; + var_dump(parse_url($url, PHP_URL_PASS)); } echo "Done"; diff --git a/ext/standard/tests/url/parse_url_basic_007.phpt b/ext/standard/tests/url/parse_url_basic_007.phpt index 8cad27e958..ebcd968879 100644 --- a/ext/standard/tests/url/parse_url_basic_007.phpt +++ b/ext/standard/tests/url/parse_url_basic_007.phpt @@ -14,8 +14,8 @@ Test parse_url() function: Parse a load of URLs without specifying PHP_URL_PATH include_once(__DIR__ . '/urls.inc'); foreach ($urls as $url) { - echo "--> $url : "; - var_dump(parse_url($url, PHP_URL_PATH)); + echo "--> $url : "; + var_dump(parse_url($url, PHP_URL_PATH)); } echo "Done"; diff --git a/ext/standard/tests/url/parse_url_basic_008.phpt b/ext/standard/tests/url/parse_url_basic_008.phpt index 142da3d561..033a4489d0 100644 --- a/ext/standard/tests/url/parse_url_basic_008.phpt +++ b/ext/standard/tests/url/parse_url_basic_008.phpt @@ -14,8 +14,8 @@ Test parse_url() function: Parse a load of URLs without specifying PHP_URL_QUERY include_once(__DIR__ . '/urls.inc'); foreach ($urls as $url) { - echo "--> $url : "; - var_dump(parse_url($url, PHP_URL_QUERY)); + echo "--> $url : "; + var_dump(parse_url($url, PHP_URL_QUERY)); } echo "Done"; diff --git a/ext/standard/tests/url/parse_url_basic_009.phpt b/ext/standard/tests/url/parse_url_basic_009.phpt index 3634046de2..539d05bbd7 100644 --- a/ext/standard/tests/url/parse_url_basic_009.phpt +++ b/ext/standard/tests/url/parse_url_basic_009.phpt @@ -14,8 +14,8 @@ Test parse_url() function: Parse a load of URLs without specifying PHP_URL_FRAGM include_once(__DIR__ . '/urls.inc'); foreach ($urls as $url) { - echo "--> $url : "; - var_dump(parse_url($url, PHP_URL_FRAGMENT)); + echo "--> $url : "; + var_dump(parse_url($url, PHP_URL_FRAGMENT)); } echo "Done"; diff --git a/ext/standard/tests/url/parse_url_basic_010.phpt b/ext/standard/tests/url/parse_url_basic_010.phpt index 8fecb9d8eb..bf1835fbf8 100644 --- a/ext/standard/tests/url/parse_url_basic_010.phpt +++ b/ext/standard/tests/url/parse_url_basic_010.phpt @@ -12,9 +12,9 @@ Test parse_url() function : check values of URL related constants * check values of URL related constants */ foreach(get_defined_constants() as $constantName => $constantValue) { - if (strpos($constantName, 'PHP_URL')===0) { - echo "$constantName: $constantValue \n"; - } + if (strpos($constantName, 'PHP_URL')===0) { + echo "$constantName: $constantValue \n"; + } } echo "Done"; diff --git a/ext/standard/tests/url/parse_url_unterminated.phpt b/ext/standard/tests/url/parse_url_unterminated.phpt index 7a0cba8ada..f7d5cca896 100644 --- a/ext/standard/tests/url/parse_url_unterminated.phpt +++ b/ext/standard/tests/url/parse_url_unterminated.phpt @@ -14,9 +14,9 @@ if (!function_exists('zend_create_unterminated_string')) die('skip ext/test requ include_once(__DIR__ . '/urls.inc'); foreach ($urls as $url) { - echo "\n--> $url: "; - $str = zend_create_unterminated_string($url); - var_dump(parse_url($str)); + echo "\n--> $url: "; + $str = zend_create_unterminated_string($url); + var_dump(parse_url($str)); zend_terminate_string($str); } diff --git a/ext/standard/tests/versioning/version_compare.phpt b/ext/standard/tests/versioning/version_compare.phpt index 17574e9737..07550dd410 100644 --- a/ext/standard/tests/versioning/version_compare.phpt +++ b/ext/standard/tests/versioning/version_compare.phpt @@ -19,7 +19,7 @@ test("1.0", "1.1"); test("1.2", "1.0.1"); foreach ($special_forms as $f1) { foreach ($special_forms as $f2) { - test("1.0$f1", "1.0$f2"); + test("1.0$f1", "1.0$f2"); } } print "TESTING OPERATORS\n"; @@ -37,16 +37,16 @@ foreach ($special_forms as $f1) { function test($v1, $v2) { $compare = version_compare($v1, $v2); switch ($compare) { - case -1: - print "$v1 < $v2\n"; - break; - case 1: - print "$v1 > $v2\n"; - break; - case 0: - default: - print "$v1 = $v2\n"; - break; + case -1: + print "$v1 < $v2\n"; + break; + case 1: + print "$v1 > $v2\n"; + break; + case 0: + default: + print "$v1 = $v2\n"; + break; } } |