1--TEST--
2Check that SplObjectStorage::detach generate a warning and returns NULL when passed non-object param
3--CREDITS--
4PHPNW Testfest 2009 - Simon Westcott (swestcott@gmail.com)
5--FILE--
6<?php
7
8$data_provider = array(
9	array(),
10	true,
11	"string",
12	12345,
13	1.2345,
14	NULL
15);
16
17foreach($data_provider as $input) {
18
19	$s = new SplObjectStorage();
20
21	var_dump($s->detach($input));
22}
23
24?>
25--EXPECTF--
26Warning: SplObjectStorage::detach() expects parameter 1 to be object, array given in %s on line %d
27NULL
28
29Warning: SplObjectStorage::detach() expects parameter 1 to be object, bool given in %s on line %d
30NULL
31
32Warning: SplObjectStorage::detach() expects parameter 1 to be object, string given in %s on line %d
33NULL
34
35Warning: SplObjectStorage::detach() expects parameter 1 to be object, int given in %s on line %d
36NULL
37
38Warning: SplObjectStorage::detach() expects parameter 1 to be object, float given in %s on line %d
39NULL
40
41Warning: SplObjectStorage::detach() expects parameter 1 to be object, null given in %s on line %d
42NULL
43