summaryrefslogtreecommitdiff
path: root/ext/standard/tests/array/array_intersect_variation5.phpt
diff options
context:
space:
mode:
Diffstat (limited to 'ext/standard/tests/array/array_intersect_variation5.phpt')
-rw-r--r--ext/standard/tests/array/array_intersect_variation5.phpt30
1 files changed, 26 insertions, 4 deletions
diff --git a/ext/standard/tests/array/array_intersect_variation5.phpt b/ext/standard/tests/array/array_intersect_variation5.phpt
index 9aaedeb382..7f36ee3f2e 100644
--- a/ext/standard/tests/array/array_intersect_variation5.phpt
+++ b/ext/standard/tests/array/array_intersect_variation5.phpt
@@ -19,6 +19,17 @@ echo "*** Testing array_intersect() : assoc array with diff keys to \$arr1 argum
$unset_var = 10;
unset ($unset_var);
+// get a resource variable
+$fp = fopen(__FILE__, "r");
+
+// get a class
+class classA
+{
+ public function __toString(){
+ return "Class A object";
+ }
+}
+
// get a heredoc string
$heredoc = <<<EOT
Hello world
@@ -48,12 +59,12 @@ $arrays = array (
"\v\fworld" => 2.2, "pen\n" => 33),
array("hello", $heredoc => "string"), // heredoc
- // array with unset variable
-/*10*/ array( @$unset_var => "hello"),
+ // array with object, unset variable and resource variable
+/*10*/ array(new classA() => 11, @$unset_var => "hello", $fp => 'resource'),
// array with mixed keys
-/*11*/ array('hello' => 1, "fruit" => 2.2,
- 133 => "int", 444.432 => "float",
+/*11*/ array('hello' => 1, new classA() => 2, "fruit" => 2.2,
+ $fp => 'resource', 133 => "int", 444.432 => "float",
@$unset_var => "unset", $heredoc => "heredoc")
);
@@ -74,10 +85,21 @@ foreach($arrays as $arr1) {
$iterator++;
}
+// close the file resource used
+fclose($fp);
+
echo "Done";
?>
--EXPECTF--
*** Testing array_intersect() : assoc array with diff keys to $arr1 argument ***
+
+Warning: Illegal offset type in %s on line %d
+
+Warning: Illegal offset type in %s on line %d
+
+Warning: Illegal offset type in %s on line %d
+
+Warning: Illegal offset type in %s on line %d
-- Iterator 1 --
array(0) {
}