1--TEST-- 2Check that SplObjectStorage::removeAll 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->removeAll($input)); 22} 23 24?> 25--EXPECTF-- 26Warning: SplObjectStorage::removeAll() expects parameter 1 to be SplObjectStorage, array given in %s on line %d 27NULL 28 29Warning: SplObjectStorage::removeAll() expects parameter 1 to be SplObjectStorage, boolean given in %s on line %d 30NULL 31 32Warning: SplObjectStorage::removeAll() expects parameter 1 to be SplObjectStorage, string given in %s on line %d 33NULL 34 35Warning: SplObjectStorage::removeAll() expects parameter 1 to be SplObjectStorage, integer given in %s on line %d 36NULL 37 38Warning: SplObjectStorage::removeAll() expects parameter 1 to be SplObjectStorage, float given in %s on line %d 39NULL 40 41Warning: SplObjectStorage::removeAll() expects parameter 1 to be SplObjectStorage, null given in %s on line %d 42NULL 43