1--TEST-- 2Check that SplObjectStorage::offsetGet generate a warning and return 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 $o1 = new stdClass(); 21 $s[$o1] = 'some_value'; 22 23 var_dump($s->offsetGet($input)); 24} 25 26?> 27--EXPECTF-- 28Warning: SplObjectStorage::offsetGet() expects parameter 1 to be object, array given in %s on line %d 29NULL 30 31Warning: SplObjectStorage::offsetGet() expects parameter 1 to be object, boolean given in %s on line %d 32NULL 33 34Warning: SplObjectStorage::offsetGet() expects parameter 1 to be object, string given in %s on line %d 35NULL 36 37Warning: SplObjectStorage::offsetGet() expects parameter 1 to be object, integer given in %s on line %d 38NULL 39 40Warning: SplObjectStorage::offsetGet() expects parameter 1 to be object, float given in %s on line %d 41NULL 42 43Warning: SplObjectStorage::offsetGet() expects parameter 1 to be object, null given in %s on line %d 44NULL 45