summaryrefslogtreecommitdiff
path: root/ext/standard/tests
diff options
context:
space:
mode:
Diffstat (limited to 'ext/standard/tests')
-rw-r--r--ext/standard/tests/array/array_combine_variation4.phpt12
-rw-r--r--ext/standard/tests/array/array_keys_error.phpt29
-rw-r--r--ext/standard/tests/array/array_map_variation4.phpt8
-rw-r--r--ext/standard/tests/array/array_merge_recursive_variation4.phpt4
-rw-r--r--ext/standard/tests/array/array_reverse_variation4.phpt8
-rw-r--r--ext/standard/tests/array/array_unique_variation3.phpt4
-rw-r--r--ext/standard/tests/array/array_unshift_variation4.phpt8
7 files changed, 11 insertions, 62 deletions
diff --git a/ext/standard/tests/array/array_combine_variation4.phpt b/ext/standard/tests/array/array_combine_variation4.phpt
index a7ea0a9dc4..125221cac8 100644
--- a/ext/standard/tests/array/array_combine_variation4.phpt
+++ b/ext/standard/tests/array/array_combine_variation4.phpt
@@ -60,10 +60,10 @@ $arrays = array (
array("hello", $heredoc => "string"), // heredoc
// array with object, unset variable and resource variable
-/*10*/ array(new classA() => 11, @$unset_var => "hello", $fp => 'resource'),
+/*10*/ array(@$unset_var => "hello", $fp => 'resource'),
// array with mixed keys
-/*11*/ array('hello' => 1, new classA() => 2, "fruit" => 2.2,
+/*11*/ array('hello' => 1, "fruit" => 2.2,
$fp => 'resource', 133 => "int", 444.432 => "float",
@$unset_var => "unset", $heredoc => "heredoc")
);
@@ -71,7 +71,7 @@ $arrays = array (
// array to be passsed to $arr2 argument
$arr2 = array(0 => 0, 2 => "float", 4 => "f3", 33333333 => "f4",
"\tHello" => 111, 2.2, 'color', "Hello world" => "string",
- "pen\n" => 33, new classA() => 11, 133 => "int");
+ "pen\n" => 33, 133 => "int");
// loop through each sub-array within $arrays to check the behavior of array_combine()
// same arrays are passed to both $keys and $values
@@ -90,15 +90,9 @@ echo "Done";
--EXPECTF--
*** Testing array_combine() : assoc array with diff keys to both $keys and $values argument ***
-Warning: Illegal offset type in %s on line %d
-
Notice: Resource ID#%d used as offset, casting to integer (%d) in %s on line %d
-Warning: Illegal offset type in %s on line %d
-
Notice: Resource ID#%d used as offset, casting to integer (%d) in %s on line %d
-
-Warning: Illegal offset type in %s on line %d
-- Iteration 1 --
array(0) {
}
diff --git a/ext/standard/tests/array/array_keys_error.phpt b/ext/standard/tests/array/array_keys_error.phpt
deleted file mode 100644
index 0febae29c7..0000000000
--- a/ext/standard/tests/array/array_keys_error.phpt
+++ /dev/null
@@ -1,29 +0,0 @@
---TEST--
-Test array_keys() function (error conditions)
---FILE--
-<?php
-
-echo "\n*** Testing error conditions ***\n";
-try {
- var_dump(array_keys(new stdclass)); // object
-} catch (TypeError $e) {
- echo $e->getMessage(), "\n";
-}
-var_dump(array_keys(array(1,2,3, new stdClass => array()))); // (W)illegal offset
-
-echo "Done\n";
-?>
---EXPECTF--
-*** Testing error conditions ***
-array_keys() expects parameter 1 to be array, object given
-
-Warning: Illegal offset type in %s on line %d
-array(3) {
- [0]=>
- int(0)
- [1]=>
- int(1)
- [2]=>
- int(2)
-}
-Done
diff --git a/ext/standard/tests/array/array_map_variation4.phpt b/ext/standard/tests/array/array_map_variation4.phpt
index e5b4c062c1..08599e0567 100644
--- a/ext/standard/tests/array/array_map_variation4.phpt
+++ b/ext/standard/tests/array/array_map_variation4.phpt
@@ -58,10 +58,10 @@ $arrays = array (
array("hello", $heredoc => "string"), // heredoc
// array with object, unset variable and resource variable
- array(new classA() => 11, @$unset_var => "hello", $fp => 'resource'),
+ array(@$unset_var => "hello", $fp => 'resource'),
// array with mixed values
-/*11*/ array('hello' => 1, new classA() => 2, "fruit" => 2.2,
+/*11*/ array('hello' => 1, "fruit" => 2.2,
$fp => 'resource', 133 => "int", 444.432 => "float",
@$unset_var => "unset", $heredoc => "heredoc")
);
@@ -79,12 +79,8 @@ echo "Done";
--EXPECTF--
*** Testing array_map() : associative array with diff. keys for 'arr1' argument ***
-Warning: Illegal offset type in %s on line %d
-
Notice: Resource ID#%d used as offset, casting to integer (%d) in %s on line %d
-Warning: Illegal offset type in %s on line %d
-
Notice: Resource ID#%d used as offset, casting to integer (%d) in %s on line %d
-- Iteration 1 --
array(0) {
diff --git a/ext/standard/tests/array/array_merge_recursive_variation4.phpt b/ext/standard/tests/array/array_merge_recursive_variation4.phpt
index f2c1e82a0c..151a515205 100644
--- a/ext/standard/tests/array/array_merge_recursive_variation4.phpt
+++ b/ext/standard/tests/array/array_merge_recursive_variation4.phpt
@@ -50,7 +50,7 @@ $arrays = array (
array("hello", $heredoc => array("heredoc", 'string'), "string"),
// array with object, unset variable and resource variable
-/*8*/ array(new classA() => 11, @$unset_var => array("unset"), $fp => 'resource', 11, "hello")
+/*8*/ array(@$unset_var => array("unset"), $fp => 'resource', 11, "hello")
);
// initialise the second array
@@ -80,8 +80,6 @@ echo "Done";
--EXPECTF--
*** Testing array_merge_recursive() : assoc. array with diff. keys to $arr1 argument ***
-Warning: Illegal offset type in %s on line %d
-
Notice: Resource ID#%d used as offset, casting to integer (%d) in %s on line %d
-- Iteration 1 --
-- With default argument --
diff --git a/ext/standard/tests/array/array_reverse_variation4.phpt b/ext/standard/tests/array/array_reverse_variation4.phpt
index 09b2eb4bee..f6e98dae82 100644
--- a/ext/standard/tests/array/array_reverse_variation4.phpt
+++ b/ext/standard/tests/array/array_reverse_variation4.phpt
@@ -54,10 +54,10 @@ $arrays = array (
array("hello", $heredoc => "string"), // heredoc
// array with object, unset variable and resource variable
- array(new classA() => 11, @$unset_var => "hello", $fp => 'resource'),
+ array(@$unset_var => "hello", $fp => 'resource'),
// array with mixed values
-/*11*/ array('hello' => 1, new classA() => 2, "fruit" => 2.2, $fp => 'resource', 133 => "int", 444.432 => "float", @$unset_var => "unset", $heredoc => "heredoc")
+/*11*/ array('hello' => 1, "fruit" => 2.2, $fp => 'resource', 133 => "int", 444.432 => "float", @$unset_var => "unset", $heredoc => "heredoc")
);
// loop through the various elements of $arrays to test array_reverse()
@@ -83,12 +83,8 @@ echo "Done";
--EXPECTF--
*** Testing array_reverse() : usage variations ***
-Warning: Illegal offset type in %s on line %d
-
Notice: Resource ID#%d used as offset, casting to integer (%d) in %s on line %d
-Warning: Illegal offset type in %s on line %d
-
Notice: Resource ID#%d used as offset, casting to integer (%d) in %s on line %d
-- Iteration 1 --
- default argument -
diff --git a/ext/standard/tests/array/array_unique_variation3.phpt b/ext/standard/tests/array/array_unique_variation3.phpt
index 205bc3a576..e80df1fb65 100644
--- a/ext/standard/tests/array/array_unique_variation3.phpt
+++ b/ext/standard/tests/array/array_unique_variation3.phpt
@@ -50,7 +50,7 @@ $inputs = array (
array("hello", $heredoc => "string", "string"),
// array with object, unset variable and resource variable
-/*8*/ array(new classA() => 11, @$unset_var => "hello", $fp => 'resource', 11, "hello"),
+/*8*/ array(@$unset_var => "hello", $fp => 'resource', 11, "hello"),
);
// loop through each sub-array of $inputs to check the behavior of array_unique()
@@ -68,8 +68,6 @@ echo "Done";
--EXPECTF--
*** Testing array_unique() : assoc. array with diff. keys passed to $input argument ***
-Warning: Illegal offset type in %s on line %d
-
Notice: Resource ID#%d used as offset, casting to integer (%d) in %s on line %d
-- Iteration 1 --
array(1) {
diff --git a/ext/standard/tests/array/array_unshift_variation4.phpt b/ext/standard/tests/array/array_unshift_variation4.phpt
index 7f507c98d0..ee91bba180 100644
--- a/ext/standard/tests/array/array_unshift_variation4.phpt
+++ b/ext/standard/tests/array/array_unshift_variation4.phpt
@@ -63,10 +63,10 @@ $arrays = array (
array("hello", $heredoc => "string"), // heredoc
// array with object, unset variable and resource variable
- array(new classA() => 11, @$unset_var => "hello", $fp => 'resource'),
+ array(@$unset_var => "hello", $fp => 'resource'),
// array with mixed keys
-/*11*/ array('hello' => 1, new classA() => 2, "fruit" => 2.2,
+/*11*/ array('hello' => 1, "fruit" => 2.2,
$fp => 'resource', 133 => "int", 444.432 => "float",
@$unset_var => "unset", $heredoc => "heredoc")
);
@@ -101,12 +101,8 @@ echo "Done";
--EXPECTF--
*** Testing array_unshift() : associative array with different keys ***
-Warning: Illegal offset type in %s on line %d
-
Notice: Resource ID#%d used as offset, casting to integer (%d) in %s on line %d
-Warning: Illegal offset type in %s on line %d
-
Notice: Resource ID#%d used as offset, casting to integer (%d) in %s on line %d
-- Iteration 1 --
int(1)